From smontgomery at mediaspansoftware.com Mon May 1 09:52:28 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 11:52:28 -0400 Subject: [Rxtx] RXTX, Java COMM and Windows Server 2003 on x64 experiences? Message-ID: Just wondering if anybody here has had to deploy RXTX or the javax.comm on Windows Server 2003 machines running on x64 (i.e. Xeon EM64T) and would like to relate how things went. From Sun's site, the Supported System Configurations pages give the options for that system: Java 5.0: - 32-bit Java 5.0 running on the OS in the 32-bit mode - 64-bit Java 5.0 running on the OS in the 64-bit native mode Java 1.4.2: - no options listed for EM64T processors, but potentially the standard 32-bit Java 1.4.2 could run on the OS in 32-bit mode? I guess the two main points of failure would be 1) the JVM itself and 2) the jni components. Make that three: there's gotta be hardware vendor driver support for the OS in the various modes, too. Guess I better go look at Keyspan's website... Thanks in advance for any info anyone might be able to provide. From smontgomery at mediaspansoftware.com Mon May 1 10:18:33 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 12:18:33 -0400 Subject: [Rxtx] Mailing list archive out of date? Message-ID: The mailing list archive at: http://mailman.qbang.org/pipermail/rxtx/ only shows emails through the end of March. Is there a new archive somewhere else? Didn't see anything mentioned on the wiki. From p.cain at phasefale.com.au Mon May 1 22:33:09 2006 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 02 May 2006 14:33:09 +1000 Subject: [Rxtx] RXTX and the Linux kernel. Message-ID: <4456E105.5080106@phasefale.com.au> Hi, First off the problem I am having isn't caused by RXTX itself but I'm hoping someone out there may have some knowledge that may help me. Background: I have an application monitoring a control system through a standard PC serial port which I talk to with rxtx-2.0.5. The application runs on RedHat7.3 kernel version 2.4.18 using Java 1.4. This configuration has been in use for several years and has proved to be stable. But it has become necessary for me to upgrade the OS but I'm running into problems with the serial communications. Its not that the comms don't work on the new OS (its never that simple) the comms work for a variable period of time (sometimes several hours) and then just stop, nothing on the data lines and control lines all indicate that data could flow. The new OS is Ubuntu 5.10 running kernel version 2.6.12. I have installed the OS and software on a PC and had it perform ok, then install the new OS and same software on the very same hardware and experienced the problems of them comms stopping. In the new OS I'm using Java5 to run the app but since I have experience the problem I reverted back to Java1.4 which didn't fix the problem. I've moved the app to a different system RedHat FC3 running 2.6.14 had experienced the problem. Not wanting to go through all the thing I have tried but I have established that it seems to be the 2.6 versions of the kernel that seem to be the problem and not an individual distribution of Linux. I should point out that I am using the same jar and library files for each java and OS combination. So I'm just wondering if anyone has had or heard of problems similar to these ? Or perhaps might know of what changed in the Linux serial driver (something I'm having a hard time establishing). I'm starting to run low on ideas of what to try so any help would be much appreciated. -- Peter Cain Senior Programmer Phasefale Pty Ltd From tjarvi at qbang.org Wed May 3 07:31:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 May 2006 07:31:00 -0600 (MDT) Subject: [Rxtx] Re: Concering ircomm and RXTX In-Reply-To: References: Message-ID: On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From legolas.w at gmail.com Wed May 3 08:46:23 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 19:16:23 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <4458C23F.2000003@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From legolas.w at gmail.com Wed May 3 13:10:57 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 23:40:57 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <44590041.80706@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From Lars.Hennig at wow-portal.com Thu May 4 00:39:15 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Thu, 4 May 2006 08:39:15 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: Message-ID: Hi, I could not find any solution. I therefore decided to to my own native implementation. Allthough it only supports the functions I need, it works pretty well now for me. I think the main problem there is the use of a wrong Windows API function and not setting an timeout. Regards, Lars Hennig W?rth Online World GmbH Tel. (0049)7181-258183 Mob. (0049)160-3522889 Fax. (0049)7940-153299 Lars.Hennig at wow-portal.com Gesendet von: rxtx-bounces at qbang.org 09.04.2006 10:42 Bitte antworten zu RXTX Developers and Users An d.herwald at dsh-elektronik.de, RXTX Developers and Users Kopie Thema Re: [Rxtx] USB Serialport - disconnection problems WV Proj./Teilpr.: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/7b39f374/attachment-0394.html From Pawan.Kharbanda at dot.state.co.us Thu May 4 11:00:58 2006 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Thu, 4 May 2006 11:00:58 -0600 Subject: [Rxtx] Dangling Lock Files Message-ID: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Hi, I have been using RXTX API's for the Serial Communication for quite some time now and for some of the devices we are opening and closing the connection every 2 minutes. This works great for few days and then suddenly I start seeing some "Port in Use Exception" and I see that the Lock files are still in the /var/lock folder after manually removing the lock files it works good for few hours and I see the same problem again. Can somebody explain me the scenarios why I am seeing the dangling Lock files? I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise Servers. Thanks Pawan Kharbanda -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/ba0e9261/attachment-0394.html From tjarvi at qbang.org Thu May 4 14:10:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:10:30 -0600 (MDT) Subject: [Rxtx] Dangling Lock Files In-Reply-To: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> References: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Message-ID: On Thu, 4 May 2006, Kharbanda, Pawan wrote: > Hi, > I have been using RXTX API's for the Serial Communication for quite > some time now and for some of the devices we are opening and closing the > connection every 2 minutes. This works great for few days and then > suddenly I start seeing some "Port in Use Exception" and I see that the > Lock files are still in the /var/lock folder after manually removing the > lock files it works good for few hours and I see the same problem again. > Can somebody explain me the scenarios why I am seeing the dangling Lock > files? > > I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise > Servers. Hi Pawan The next time it happens, look in the lockfile. There will be a pid. ps aux |grep 'pid' I think you will see that the application is still running for some reason. RXTX does a kill -0 on the pid to see if its alive. If not, it will remove the lockfile. So I suspect the previous program did not exit as you expected. -- Trent Jarvi tjarvi at qbang.org From Scott.Hughes at dalsemi.com Thu May 4 14:23:11 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 4 May 2006 15:23:11 -0500 Subject: [Rxtx] Wiki instructions... Message-ID: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire demo apps, when I stumbled across this tip on the wiki to add yourself to the uucp group: It may be simpler to just run usermod -G uucp jarvi Taken from: http://rxtx.qbang.org/wiki/index.php/Installation This does not work as advertised. I should have read the man page for usermod before I tried that out. If there are any groups which are not listed after the -G switch, the user is removed from those groups. On Ubuntu, this is bad... I removed myself from the Admin group, which removed my sudo priviledges. Ubuntu has no root account, so I've disabled the only account which could fix it. Anyone know of a good workaround? Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor From tjarvi at qbang.org Thu May 4 14:32:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:32:09 -0600 (MDT) Subject: [Rxtx] Wiki instructions... In-Reply-To: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> Message-ID: On Thu, 4 May 2006, Scott Hughes wrote: > I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire > demo apps, when I stumbled across this tip on the wiki to add yourself to > the uucp group: > > It may be simpler to just run > > usermod -G uucp jarvi > > Taken from: > http://rxtx.qbang.org/wiki/index.php/Installation > > This does not work as advertised. I should have read the man page for > usermod before I tried that out. If there are any groups which are not > listed after the -G switch, the user is removed from those groups. On > Ubuntu, this is bad... I removed myself from the Admin group, which removed > my sudo priviledges. Ubuntu has no root account, so I've disabled the only > account which could fix it. > > Anyone know of a good workaround? > Yikes This will get your permissions back: in grub/lilo/.. pass the following option to the kernel init=/bin/sh You are now root. when it boots, mount -o remount,rw / add yourself to the groups, reboot to get normal init going. Thats about all I can think of without sudo/root. -- Trent Jarvi tjarvi at qbang.org From Gettings at earth.utah.edu Thu May 4 14:41:22 2006 From: Gettings at earth.utah.edu (Paul Gettings) Date: Thu, 4 May 2006 14:41:22 -0600 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <20060504204122.GA6534@earth.utah.edu> When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get messages on stdout from the JVM: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 As the only change was the version of RXTX (from 2.1.6), I am unsure why the messages suddenly appeared. Anyone know how to get rid of them? Thanks. -- 101 USES FOR A DEAD MICROPROCESSOR (23) Dead cat brush From mmester at sps.edu Mon May 1 21:22:28 2006 From: mmester at sps.edu (Michael Mester) Date: Mon, 1 May 2006 23:22:28 -0400 Subject: [Rxtx] Windows PortInUseException Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> I'm trying to get simple serial communication going with RxTx under Windows XP. I can enumerate the ports fine, but I always run into problems when I try to open one. I get a PortInUseException, but the owner application is "Unknown" and the port is never open. I've tried this on several different systems and all of them give the same behavior. The only thing I can thiunk of that might be causing the problem is that fact that I had to put the serial .dll file in system32 instead of the reccommended folder, because it didn't work in the folder the documentation gives. The library loads fine, though, so I'm not sure whether that makes sense, and I don't know how to fix it anyway. Any help is greatly appreciated. Below is the output of the program, right up to the PortInUseException and the NullPointerException it causes (because the serial port object is not instantiated). C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI Starting GPSTalkerGUI... Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 gnu.io.PortInUseException: Unknown Application Exception in thread "main" java.lang.NullPointerException at GPSTalkerGUI.(GPSTalkerGUI.java:102) at GPSTalkerGUI.main(GPSTalkerGUI.java:161) Again, thank you very much for any help you can give. From lshellman at qwest.net Wed May 3 01:38:34 2006 From: lshellman at qwest.net (Lucious Shellman) Date: Wed, 03 May 2006 01:38:34 -0600 Subject: [Rxtx] Help needed: Project using parallel port Message-ID: <1146641914.8337.14.camel@localhost.localdomain> I was looking for a way to access the parallel port on a PC using Java. Searching the Internet, I came across this site (rxtx.org). What I am trying to do is detect logic levels from a TTL logic IC on the parallel port. I am not trying to do classic parallel port communication. I just want to detect whether a line(s) is (are) high or low. I am using Windows 98. Can rxtx be used to do this? If yes, is there a tutorial for using rxtx posted on the Internet that someone can direct me to. If you need more information, feel free to e-mail me. Unfortunately for me, I need the information ASAP. Thanks. lshellman at qwest.net From webmaster at egyhelp.com Wed May 3 18:43:39 2006 From: webmaster at egyhelp.com (Mohamed Samy) Date: Thu, 4 May 2006 02:43:39 +0200 Subject: [Rxtx] RE: Concering ircomm and RXTX In-Reply-To: Message-ID: <20060503184362.SM01044@Geek> Hey, I issue the command "modprobe ircomm-tty" yet no ttyircomm appears, while the ircomm appear by "modprobe ircomm" so forgive me but I am bit lost. Even searching google for the keyword "ttyircomm" only returns 3 matches. So any way I can start the ttyircomm???? Thanks a lot. -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Wednesday, May 03, 2006 3:31 PM To: Mohamed Samy; rxtx at qbang.org Cc: taj at www.linux.org.uk Subject: Re: Concering ircomm and RXTX On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 4 15:49:49 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 15:49:49 -0600 (MDT) Subject: [Rxtx] Windows PortInUseException In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> Message-ID: On Mon, 1 May 2006, Michael Mester wrote: > > I'm trying to get simple serial communication going with RxTx under > Windows XP. I can enumerate the ports fine, but I always run into > problems when I try to open one. I get a PortInUseException, but the > owner application is "Unknown" and the port is never open. I've tried > this on several different systems and all of them give the same > behavior. The only thing I can thiunk of that might be causing the > problem is that fact that I had to put the serial .dll file in system32 > instead of the reccommended folder, because it didn't work in the folder > the documentation gives. The library loads fine, though, so I'm not sure > whether that makes sense, and I don't know how to fix it anyway. Any > help is greatly appreciated. Below is the output of the program, right > up to the PortInUseException and the NullPointerException it causes > (because the serial port object is not instantiated). > > C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI > Starting GPSTalkerGUI... > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > gnu.io.PortInUseException: Unknown Application > Exception in thread "main" java.lang.NullPointerException > at GPSTalkerGUI.(GPSTalkerGUI.java:102) > at GPSTalkerGUI.main(GPSTalkerGUI.java:161) > Perhaps you are trying to open the port twice in your code? rxtx does open the ports, do a timed out read and then close the ports during enumeration. I think the port is being opened fine. The Unknown Application is always reported. On linux, there is some code that finds the actual application but on windows, its always unknown. If the port enumeration is returning the ports you expect, rxtx has opened the port and closed it with success. The port should open. There is also example code in the contrib directory that comes with rxtx source that has examples you can modify to work. -- Trent Jarvi tjarvi at qbang.org From Christian.Klemke at t-online.de Thu May 4 23:37:23 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Fri, 5 May 2006 07:37:23 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu> Message-ID: <004f01c67005$fc72fee0$016a10ac@NB600> Hi Paul, I was wondering about the same question some days ago and took a look at the source files. Unfortunately, I found that you can only get rid of that messages by altering and recompiling the Java code. There is a final static boolean variable called "devel" in the file "RXTXCommDriver.java" which is set to "true". This constellation causes the output after the native libraries have been loaded. No mechanism exists to suppress them otherwise :-(. Trent, does that mean that 2.1.7 is still officially a "development" version ? When will this value be changed to "false" by default ? With 2.1.8 ? It would be nice to provide a means to suppress such messages besides that static flag (maybe by setting a property called "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The output can indeed by annoying, especially when used with console applications, where the message potentially appears "in the middle" of your own output. Another possibility would be not to use System.out directly, but instead some PrintStream field which is initially set to System.out but can programatically be changed. That would allow for any kind of redirection or suppression by implementing appropriate user-defined PrintStream subclasses and making RXTX use that stream. What do you think ? Best regards, Christian ----- Original Message ----- From: "Paul Gettings" To: Sent: Thursday, May 04, 2006 10:41 PM Subject: [Rxtx] RXTX causing stdout messages > When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get > messages on stdout from the JVM: > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > As the only change was the version of RXTX (from 2.1.6), I am unsure > why the messages suddenly appeared. Anyone know how to get rid of > them? > > Thanks. > > -- > 101 USES FOR A DEAD MICROPROCESSOR > (23) Dead cat brush > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri May 5 06:09:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 06:09:46 -0600 (MDT) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <004f01c67005$fc72fee0$016a10ac@NB600> References: <20060504204122.GA6534@earth.utah.edu> <004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: On Fri, 5 May 2006, Christian Klemke wrote: > Hi Paul, > > I was wondering about the same question some days ago and took a look at the > source files. Unfortunately, I found that you can only get rid of that > messages by altering and recompiling the Java code. There is a final static > boolean variable called "devel" in the file "RXTXCommDriver.java" which is > set to "true". This constellation causes the output after the native > libraries have been loaded. No mechanism exists to suppress them otherwise > :-(. > > Trent, does that mean that 2.1.7 is still officially a "development" version > ? When will this value be changed to "false" by default ? With 2.1.8 ? It > would be nice to provide a means to suppress such messages besides that > static flag (maybe by setting a property called > "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The > output can indeed by annoying, especially when used with console > applications, where the message potentially appears "in the middle" of your > own output. Another possibility would be not to use System.out directly, but > instead some PrintStream field which is initially set to System.out but can > programatically be changed. That would allow for any kind of redirection or > suppression by implementing appropriate user-defined PrintStream subclasses > and making RXTX use that stream. What do you think ? > A patch for using properties would be accepted I'm sure. The reason the default is to display the message is not related to the development state of rxtx anymore. The problem is that people first using rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. The message prevents a great deal of email thats easily explained by the message. I question if we should support rxtx 2.0 at all anymore. If you post a patch in bugzilla, we'll put it into CVS this weekend. we'll be going through and doing such things anyhow. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri May 5 13:23:56 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 13:23:56 -0600 (MDT) Subject: [Rxtx] How to read from RxTx parallel port in Win XP In-Reply-To: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> References: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> Message-ID: On Thu, 27 Apr 2006, Worsley, Bob (Development Engineer) wrote: > I'm sorry if this is a dumb question, but I didn't find the answer in > the archives. > > I'm using the RxTx binaries for Windows on a reasonably current notebook > PC running Windows XP. I can send stuff to a printer on the parallel > port (LPT1), but I can't get anything back. > > I wrote a class that has the methods listed below. I write some data to > the printer with the "write" method and then try to read a response > using the "read" method, but I never get any data. I'd greatly > appreciate any help you can give! > > Bob Worsley > bobwoyid2 at yahoo.com > > > > > private ParallelPort parallelPort = null; > private RXTXCommDriver parallelPortDriver = null; > > > public boolean initialize() throws IOException { > if (parallelPort != null) { > return false; // Already initialized > } > > // Create the parallel port; > parallelPortDriver = new RXTXCommDriver(); > parallelPort = > (ParallelPort)parallelPortDriver.getCommPort(address, > CommPortIdentifier.PORT_PARALLEL); > > // Set the parallel port parameters. > try { > parallelPort.enableReceiveTimeout(READ_TIMEOUT); > parallelPort.disableReceiveFraming(); > parallelPort.disableReceiveThreshold(); > //parallelPort.setMode(mode); !!!!errors > } catch (UnsupportedCommOperationException e) { > throw (new IOException("Parallel port with address '" + > address > + "' cannot be configured as specified")); > } > > return true; > } > > > > public void write(final byte[] bytes) throws IOException { > initialize(); > while (busyReading) { > Thread.yield(); > } > busyWriting = true; > if (bytes.length < 1) { > return; > } > OutputStream outputStream = parallelPort.getOutputStream(); > outputStream.write(bytes); > outputStream.flush(); > outputStream.close(); > Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); > busyWriting = false; > } > > > public byte[] read() throws IOException { > > // Read up to MAX_BYTES bytes. > initialize(); > while (busyWriting) { > Thread.yield(); > } > busyReading = true; > byte[] buff = new byte[MAX_BYTES_READ]; > InputStream inputStream = parallelPort.getInputStream(); > // This read blocks until input data is available > int bytesRead = inputStream.read(buff); > inputStream.close(); > // If no data read, create empty array > if (bytesRead == -1) { > bytesRead = 0; > } > byte[] deviceBytes = new byte[bytesRead]; > System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); > if (bytesRead > 0) { > Debug.p("PPIOP.read - got data: '" + new > String(deviceBytes) + "'"); > } > busyReading = false; > return deviceBytes; > } > Hi Bob I've only used rxtx to test a hello world page printing but there are others that have used it. PPIOP? hmm what is this? :) The rxtx parallel support is behind the serial support but should be OK. As you note, the setting of modes is not supported. rxtx uses what is provided when the port is open. Are your asserting the pin for the printer being online? I suspect what often happens is people try to just use the data pins but the C API rxtx uses wants the printer to be online. There should be some posts relating to this in the rxtx mail-list archive. Some APIs are probably reading and writing from the port address (also suggested in your code as something you are looking at). RXTX currently uses a higher level C/C++ API for port access. This can still work if the API thinks the 'printer' is there. -- Trent Jarvi tjarvi at qbang.org From agrodellic at gmail.com Sat May 6 08:39:40 2006 From: agrodellic at gmail.com (Leigh Stewart) Date: Sat, 6 May 2006 10:39:40 -0400 Subject: [Rxtx] sun commapi 3 Message-ID: I think I read here: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html that rxtx-2.0 is basically fracked for now? Does anyone know of a workaround? ie can i somehow get an older version of sun's comm api and use that (not easy to find)? i mean 2.0 must be working for someone...how is it being tested. 2.1 isnt working for me....im getting nasty native exceptions etc, which is why im so set on 2.0... any ideas? From tjarvi at qbang.org Sun May 7 15:40:27 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 7 May 2006 15:40:27 -0600 (MDT) Subject: [Rxtx] sun commapi 3 In-Reply-To: References: Message-ID: On Sat, 6 May 2006, Leigh Stewart wrote: > > 2.1 isnt working for me....im getting nasty native exceptions etc, > which is why im so set on 2.0... any ideas? > Hi Leigh What native exceptions are you seeing? Which OS? The native code is almost identical between rxtx 2.0 and 2.1. Only the names have been changed to protect the inocent. :) ie: javax_comm_... vs gnu_io_... So the odds are very likely that even if you do find commapi 2.0 and get it installed, you will run into the same error. It would be better to just find and fix the problem. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Mon May 8 10:47:20 2006 From: mail at willicon.de (WILLICon) Date: Mon, 08 May 2006 18:47:20 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 Message-ID: <445F7618.3070303@willicon.de> Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/ef37e8ec/attachment-0394.html From tjarvi at qbang.org Mon May 8 16:14:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 May 2006 16:14:51 -0600 (MDT) Subject: [Rxtx] Screenshot of Application using RXTX (fwd) Message-ID: Just though someone may end up searching for 0x0D and 0x0A. Here are the details from his system. SuSE Linux 10.0 (x86_64) Kernel 2.6.13-15.8 j2se 1.4.2_11 (i586) Sun: comm3.0_u1 rxtx: rxtx-2.1-7 ---------- Forwarded message ---------- Date: Sat, 6 May 2006 20:01:46 +0200 From: Michael Poppitz To: taj at www.linux.org.uk Subject: Screenshot of Application using RXTX Hi Trent, the rxtx package works like a charm. Sun's package seemed to replace all 0x0D with 0x0A in received data on my Linux box, which is really annoying when transfering binary data. But rxtx came and saved the day - and turned out to be a lot more convenient as it does not require a configuration file. I use it for connecting to a home made logic analyzer. (http://www.sump.org/projects/analyzer/) Thanks for your great job, Michael -------------- next part -------------- A non-text attachment was scrubbed... Name: la_client.png Type: image/png Size: 16592 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/45494fbb/la_client-0394.png From tjarvi at qbang.org Tue May 9 14:56:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 May 2006 14:56:05 -0600 (MDT) Subject: [Rxtx] RXTX javax.comm: which one to install? In-Reply-To: <20060509161742.43547.qmail@web53814.mail.yahoo.com> References: <20060509161742.43547.qmail@web53814.mail.yahoo.com> Message-ID: On Tue, 9 May 2006, Adenilson Cavalcanti wrote: > Dear Trent Jarvi > > I'm trying to write a small Java app running in linux that interfaces with a device connected to serial port. > > I do have some questions about RXTX and javax.comm state of affairs, since I'm new to Java programming (used to program in plain old C writting to devices using termios and open/write/read syscalls, but this is another story). > > I ask you the favor to clarify this issues (if possible...): > > a) Sun offers to download a file (comm3.0_u1_PUTAUNIXVERSION.zip) which does contain .so files. Does it work out of box? > > b) Case negative, its there that we should use 'librxtx*.so' provided by your site? > > c) Sun's comm3 API version does work with which version of rxtx? > > I already searched google and read documentation available in rxtx site ("Java Comm Serial API How-to") but still have this issues unsolved. Any help will be appreciated. > > Best regards > > Adenilson Hi Adenilson, RXTX does not currently support javax.comm in Sun's CommAPI 3.0. I would recommend using package gnu.io provided by rxtx 2.1. -- Trent Jarvi tjarvi at qbang.org From chris.develder at intec.ugent.be Wed May 10 08:45:40 2006 From: chris.develder at intec.ugent.be (Chris Develder) Date: Wed, 10 May 2006 16:45:40 +0200 Subject: [Rxtx] rxtx troubles on ARM Message-ID: <4461FC94.6040909@intec.ugent.be> Hi all, Sorry to bother you, but I don't seem to get RXTX working on an ARM processor (xscale ixp 425, big endian). I managed to crosscompile the rxtx libs and moved it over to the ARM. Using jamvm (which is the only open source java VM we got working on the ARM), I get the following error result when running SimpleRead from Sun's javax.comm examples (commapi\examples\Simple\SimpleRead) -- see bottom of mail for complete output: "java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver" However, output shows that the RXTXCommDriver code is accessible (cf. debug and devel output of lib versions). So it doesn't seem to be a missing lib/jar issue. The error happens before RXTXCommDriver.initialize() is called, since the first line there is System.out.println("RXTXCommDriver:initialize()"); Any ideas? Cheers, Chris ---------------------------- [root at xxx(ttyp1) /work/cdvelder/xscale/test]# jamvm -Djava.library.path=/work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/jre/lib/arm -classpath /work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/lib/ext/RXTXcomm.jar:./comm.jar:. SimpleRead RXTXCommDriver {} Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTXCommDriver: Jar version = RXTX-2.1-7 native lib Version = RXTX-2.1-7 java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver gnu/io/RXTXCommDriver at javax.comm.CommPortIdentifier.loadDriver (CommPortIdentifier.java:239) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:109) at SimpleRead.main (Unknown Source) java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive (Native Method) at com.sun.comm.Portmapping.registerCommPorts (Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase (Portmapping.java:100) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:138) at SimpleRead.main (Unknown Source) From joachim at buechse.de Fri May 12 00:44:48 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 08:44:48 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) Message-ID: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Good day, I guess that only a selected few (hi Trent) will be able to answer this question, but the answer might be interesting for anyone trying to debug or understand the code. Apparently the MonitorThread is started and stopped in RXTXPort.addEventListener and RXTXPort.removeEventListener. This would indicate that (originally?) the MonitorThread is only required when there is an EventListener. However the MonitorThread is also started in the RXTXPort constructor, which could mean that RXTX won't work at all if it isn't there. It seems to me, that if anyone would add an event listener and later on remove it, he could potentially wreak the port. Because the second action would kill the MonitorThread. For the moment I am only trying to understand the role of and idea behind the MonitorThread. But of course there is a deeper reason thor my question: If the MonitorThread needs to exist anyway, it could be the thread that cleans up the port (ie calls nativeClose) - this would eliminate (a further) problem I am seeing with some USB drivers on Mac OSX. (Close blocks (after releasing the tty, but still) in the USB driver if the device is "not responding"). Greetings, Joachim From tjarvi at qbang.org Fri May 12 07:10:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 12 May 2006 07:10:59 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Fri, 12 May 2006, Joachim Buechse wrote: > Good day, > > I guess that only a selected few (hi Trent) will be able to answer > this question, but the answer might be interesting for anyone trying > to debug or understand the code. > > Apparently the MonitorThread is started and stopped in > RXTXPort.addEventListener and RXTXPort.removeEventListener. This > would indicate that (originally?) the MonitorThread is only required > when there is an EventListener. However the MonitorThread is also > started in the RXTXPort constructor, which could mean that RXTX won't > work at all if it isn't there. > > It seems to me, that if anyone would add an event listener and later > on remove it, he could potentially wreak the port. Because the second > action would kill the MonitorThread. > > > For the moment I am only trying to understand the role of and idea > behind the MonitorThread. But of course there is a deeper reason thor > my question: > > If the MonitorThread needs to exist anyway, it could be the thread > that cleans up the port (ie calls nativeClose) - this would eliminate > (a further) problem I am seeing with some USB drivers on Mac OSX. > (Close blocks (after releasing the tty, but still) in the USB driver > if the device is "not responding"). > Hi Jaochim Before commapi, rxtx did not support events. You could read, write and change port settings. The MonitorThread was added as an afterthought to support commapi events. So the way things are now his historical spaghetti not a well devised plan. It is my opinion that the MonitorThread should exist as long as the port is open. The odd starting of the thread in the constructor and addEventListener was just to get past the obvious problem of people using the port without adding listeners. -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Fri May 12 07:59:50 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 15:59:50 +0200 Subject: [Rxtx] MonitorThread -> ChangeRequest In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: <2B1E508C-8CEE-4AB7-914D-E7BA25C871A2@buechse.de> In this case I suggest removing the starting/stopping of MonitorThread in addEventListener / removeEventListener. This should not affect existing projects. On 12.05.2006, at 15:10, Trent Jarvi wrote: > It is my opinion that the MonitorThread should exist as long as the > port > is open. The odd starting of the thread in the constructor and > addEventListener was just to get past the obvious problem of people > using > the port without adding listeners. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Fri May 12 11:43:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 19:43:21 +0200 Subject: [Rxtx] Spring Cleaning - some suggestions Message-ID: The current implementation of RXTX contains quite a lot of code that will break if it is used from several threads (especially on a multi processor machine). I think it would be nice to clean this up. I suggest the following changes (which keep the current semantics and should not influence existing projects in a negative way): - InterruptedException will never be ignored or reset - read methods will be protected with a Monitor - write methods will be protected with a (separate) Monitor - close() sets the read and write monitors into a "closed" state which will lead to IOExceptions for any following call to RXTXPort.read/write. - close() will wait a finite amount of time (maybe 500ms) for the release of the read and write monitors after that, it will trigger the closing of the file descriptor to abort any pending read or write. - close() will not call close(file_desc). Instead it will "interrupt" (ie set a flag and then, pthread_kill(ABRT)) the MonitorThread, the MonitorThread will call close(file_desc). - the monitors are properly released in a finally block the try of which starts directly after obtaining the monitor. - finally will not call close(file_desc) it will only "interrupt" the MonitorThread (see above) - the native-code (esp read) does not use SA_RESTART but checks Thread.interrupted() when it receives a SIGNAL (ie system call returns with EINTR or other signalling method). The read/write monitors will be allocated from a factory whose mode can be set to fast/normal/advanced. In fast-mode it will create "non thread safe, non synchronized" pseudo-monitors. In default mode, the monitors will store the owning thread. In "advanced" mode setting the monitors into closed state will "interrupt()" threads which are blocked in a native read/write. {Reasoning close behaviour: Calling close on a file descriptor in Windows unblocks any read() or write() on the same file descriptor with an error. On Solaris < 2.7 and MacOS X however the close() will/ can block - until the read or write have finished:-(( Even the JDK people have trouble with this. I dont know how Linux reacts in this case. The best practice for BSD/Solaris is to send a signal to the thread which will usually unblock the read/write with an EINTR - this however is not guarenteed as it also depends on the device driver. So the only resolution that will certainly not block the thread calling RXTXPort.close() (which will often enough be the AWT event dispatcher or the VM finalizer thread) is to call close(fd) from another thread.} {Reasoning read behaviour: It is rather uncommon to receive a signal while reading or writing - it will happen, but checking Thread.interrupted() when it happens will not degrade performance. The checking of Thread.interrupted() can be handled by returning to Java and potententially reentering into the native code if the thread was not interrupted or by calling back into the VM from the native code. On top of this, many functions like read(byte[]) or read(byte [], int, int) are allowed to return less than the requested amount of data. Only int read() is a bit more tricky. } [Trent: From the code I can tell, that you experimented quite a bit with signals. Do you know if the Java Thread.interrupt() triggers a unix signal on Linux/Solaris? If so, which one?? References: - http://java.sun.com/docs/hotspot/VMOptions.html - http://www.hp.com/products1/unix/java/infolibrary/prog_guide/ signals.html ] On OS X (hotspot client jdk-1.4.2) I did not see any signal propagated to the SELECT of the event_loop/MonitorThread (ie no EINTR) when I call monThread.interrupt(). This is a pitty, but thats the way it is. I simply assume this is true for most system calls. How to handle this? Of course it would be possible to install/ deinstall a specific signal handler before/after every native read and to natively send an ABRT signal if RXTXPort.close is called. A more elegant solution might be to have an additional "signaling" socket which is always included in the SELECT. Or the simplest solution: cap the timeout of the select to 500 ms (the loop around it exists already) after every timeout check the Thread.interrupted() flag. From a performance perspective this should be completely invisible... On the other hand, all write() calls need to be preceeded by a SELECT as well, to avoid running into a blocking write. Best regards, Joachim From lyon at docjava.com Sat May 13 05:54:52 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 13 May 2006 07:54:52 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Dmitry suggests that we acquire an implementation of a serial port reference, use it, then release it (i.e., check it back in). Joachim says that making serial ports thread friendly might be a good idea. This is a good idea. The design pattern that is close to this idea is the "Object Pool Design Pattern". # Object Pool Manage the reuse of objects for a type of object that is expensive to create or only a limited number of a kind of object can be created. It has been described at: http://www.developer.com/java/ent/article.php/626171 and in Marks' book, Patterns in Java, Volume 1. However, the Object Pool is intended to pool objects so that each object is just like every other object. The intent of the Parametric Singleton is to enable others to access the same resource at the same time (as long as the same parameters were used in construction). It sounds like we need a NEW Design Pattern (Oh no, Doug is doing it again!). Yes friends, you got me on a role (roll) :) If you like design patterns, you can thank me later. If you don't like design patterns, blame Dmitry, it was his idea ;) And Dave, thanks for the feedback on Singleton abuse. It has led me to change the way I think about application contexts, which we will see, below. We need (drum roll please): The Parametric Object Pool Design Pattern (POP) By Douglas A. Lyon ABSTRACT The goal of the Parametric Singleton design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values, in a given context. In comparison, the goal of the POP design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values and that only one reference to the class is checked out at a time, in a given context. A context is a namespace for holding identifiers during execution. In Java, A context can be changed in any of several ways. For example, creation of a new class loader, the deserialization of an old POP or the creation of a new process all create a new namespace. The POP Design Pattern combines the Parametric Singleton Design Pattern with the check out mechanism of the Object Pool Design Pattern. This enables unique creation of instances of a class. These instances are cached in a table. When a clients asks for an instance with these parameters, the cache is checked. If the instance is not in the cache it is created. If the instance is available, the clients checks out the instance. A reference is left to the clients that checked out the instance. The POP has the role of creating objects uniquely, from parameters. It also has the role of keeping track of which clients has checked out a given object. This is just like a library keeping track of who borrowed a book. If a resource is left unavailable in a system, a deadlock can occur. Deadlock debugging is facilitated by mapping a resource to the clients that have checked it out. We apply our POP Design Pattern to the retrieval of serial ports. The goal of our system is to make sure that serial ports are checked out to only one client at a time, and that they be checked back in when the client is done. The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. Users are discouraged from calling this the Parametric Object Oriented Pool (POOP). Introduction The intent of the POP Design Pattern is to ensure that a class has only one instance for a given set of parameter values. It also provides a point of access that is global to a given context. The POP uses the Singleton Design Pattern to ensure that there is only one POP, in the given context. The POP DP is responsible for checking out a reference to a given instance, and keeping track of that instance. The instance is responsible for sharing that instance. POP requires that users of the DP implement an interface that enables a recall facility. Thus, if there is a contention for a consumed resource, the deadlock can be resolved in an orderly fashion. Motivation A system cannot tolerate multiple instances of some classes with identical parameters used by different instances at the same time. For example, you cannot have two instances use the same serial port, at the same time. You cannot have two instances that are trying to listen to the same socket connection. You cannot have two instances writing to the same file structure at the same time. Further, once a serial port is checked out by a client, it is assigned to the client. This is like the spin-lock service provided by the operating system, only in the application layer. Naturally, deadlock will occur if a resource is not released, therefore the client of the resource is tracked. Recalling a resource is required for the POP DP by virtue of the implementation of an interface. The policy on how to break a deadlock (by honoring the recall) is application specific. As the operating system is often thought of as the arbiter of consumed resources (i.e., tape drives, serial ports, etc.) we frequently leave it to an operating system implementation to resolve these contention issues. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on naming conventions (which are not well standardized). The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. The POP Design Pattern can take on the role of the peer method mapper that homogenizes the API for different operating environments. That is, it can wrapper the different locking mechanisms used in different operating systems. POP that is responsible for keeping track of the instances created and the client that has checked them out. The POP Design Pattern is implemented using the Singleton Design Pattern. In Java, the POP implementation is declared final, so that it cannot be subclassed. The class also has a private constructor, so that other classes cannot instance it. The new design pattern is called the POP design pattern and it provides a way to check out and create instances with given parameters. Applicability Use the POP Design Pattern when: 1. There must be exactly one instance of a class with the given parameters in a given context. 2. The instances must be accessible to clients from a well-known access point. 3. The instances are reusable. 4. Only one client can check out an instance at a time. Structure Insert UML diagram here. Participants The POP Clients that need instances 1. The POP defines an instance upon request from a client, if, and only if, the instance does not already exist. 2. The POP returns the instance to the client. 3. The POP is responsible for creating unique instances from given parameters. 4. The POP is responsible to recalling instances from clients. Collaborations Clients obtain a reference to a POP instance only through the singleton design pattern. If the POP instance is left in an improper state (e.g., the serial port was left open) it is NOT the role of the POP to close the IO port. However, the POP can be requested to get the instance released. Nor is it the role of the POP Design Pattern to open the port. That role is delegate to some other part of the system. Further, it is the role of the POP Design Pattern to check out resources. However, it is still possible to have, multiple threads that have multiple references to the same resource at the same time. Checkout and resource requests are MUTEX locked (i.e., synchronized). Consequences The POP Design Pattern has several benefits: 1. Controlled access to parametrically defined instances. Since the POP encapsulates its instances, there is some limited control over how and when clients access it. 2. Reduced name space. The POP pattern avoids global variables that store instances created from the same parameter. Implementation Here are implementation issues to consider when using the POP pattern: 1. Unique mapping of parameters. The POP pattern requires that there be a mean to isomorphically map the parameter space into the instance space and back again. 2. Ensure unique instances. The POP pattern makes unique instances from parameters, and it does so only once. 3. Cache instances for fast retrieval. The POP must be able to look up instances, given some set of parameters, and do so from some data structure. That is, there must be enough space to hold references to all the instances the program will need. Also, a mechanism is needed to look up and retrieve the instances quickly enough to satisfy the clients. Sample Code To be written....any volunteers? Thanks! - Doug >I don't think I get it > >On Mar 22, 2006, at 9:36 AM, David Garnier wrote: >>Using the singleton pattern in this case is >>just convenient for the programmer. Problems >>arises >>pretty quickly, especially if you attempt to unit-test your classes. > > >so you're saying that something isn't so good >because you can not test it in the convenient >way? >if that's true, I'm totally disagree >change your test, debug whatever, but if >software is efficient at runtime, works fine and >only problem is some unit test >(which is some kind of framework for testing) >then dump that unit test , dump that unit >framework and make something appropriate to the >software >you're testing > >so if Douglas want to use singletons, what's the problem? >and what do you mean by abusing of singleton usage? > >of course singleton doesn't prevent concurrent >access to the resource across the processes >unless >you're using some OS facility to prevent it, besides >singleton as it was introduced is relevant only >and only inside of the same process >otherwise it's not singleton it's something else >(let's say network singleton: so you have remote >invocation facility >and some factory method that return object created by that facility) > >I don't have any problem with using any kind of singletons. > Parametric Singleton idea (if I understand it >right) could be easily implemented in the >following way: >use a map >populate map with instances of some class and key is your parameter >(you can use lazy population too) > >if somebody ask the key check the value if it's null so resource is taken >if somebody returns the resource put it back to the map > >public synchronized static Object getSomeResource(Object parameter); >public synchronized static void returnResource(Object parameter); > >getSomeResource (inside of the same process) could return null in 2 cases >1. if somebody (from other thread for example) already took that resource >2. if OS API said that resource corresponded to >that parameter (serial port with parameter = 1 >(port #)) >is locked and unavailable; >I'm not sure that in case of serial ports we >even need those Parametric Singletons >(unless lock checking is a very expensive operation) >just ask the OS about availability of that >resource and if it's available give it away >and then OS will lock it and therefore in next >time somebody ask it just answer that resource >is locked >and return null > >for example system has 2 serial ports available >so I ask getResource("tty"); >or I ask getResource("Bluetooth-Modem"); > >and if OS is ok you can give tty or Bluetooth-Modem or both > >no need for any additional pattern I think > >back to the problem >mac os x doesn't recognize locking via files, so >it handles locking via some API >an instance of the singleton in each process >should recognize that resource is locked >(by using that API) that's all >we don't have to make things more complicate >then they are just because there is some nice >design pattern or nice unit test framework or whatever >keep things simple, make them work fast, don't introduce middle layers >unless you have really good reason to do so > >of course I could be entirely wrong, so sorry about that in advance > >thanks > > >Dmitry Markman > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx >Good day, > >I guess that only a selected few (hi Trent) will be able to answer? >this question, but the answer might be interesting for anyone trying? >to debug or understand the code. > >Apparently the MonitorThread is started and stopped in? >RXTXPort.addEventListener and RXTXPort.removeEventListener. This? >would indicate that (originally?) the MonitorThread is only required? >when there is an EventListener. However the MonitorThread is also? >started in the RXTXPort constructor, which could mean that RXTX won't? >work at all if it isn't there. > >It seems to me, that if anyone would add an event listener and later? >on remove it, he could potentially wreak the port. Because the second? >action would kill the MonitorThread. > > >For the moment I am only trying to understand the role of and idea? >behind the MonitorThread. But of course there is a deeper reason thor? >my question: > >If the MonitorThread needs to exist anyway, it could be the thread? >that cleans up the port (ie calls nativeClose) - this would eliminate? >(a further) problem I am seeing with some USB drivers on Mac OSX.? >(Close blocks (after releasing the tty, but still) in the USB driver? >if the device is "not responding"). > >Greetings, >Joachim > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Sat May 13 10:07:37 2006 From: joachim at buechse.de (Joachim Buechse) Date: Sat, 13 May 2006 18:07:37 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Douglas, Looking at the current code, leaves me with the feeling, that there is a lot to do. Defining an API that wraps javax.comm to provide what you describe is certainly possible, but I wonder how much benefit it will actually provide. Personally I think the API defined by javax.comm "request/lock" a port with: cp= new CommunicationPort(identifier) "release" a port with: cp.close(); works quite nice for 99% of the applications. In my experience, the most efficient and elegant implementation is to wrap a port/socket/.. into a business object which declares the remote operations that are possible. Ie "uploadFile", "waitForPrompt", "getSerialNumber", "sendContact", "executeCommand", etc Those methods are then either synchronized or guarded by a monitor. I do not see how your design pattern applied to the port resource would help implementing this. [details start, skip if you agree to the above] When I talked about "thread-safe" I didn't mean several independent "sessions" accessing the port concurrently. I think this is a very rare usage. I believe the most common use case for serial ports today is the control of an external device from a PC running a GUI based application. To implement a clean Swing/AWT-GUI one needs to pass any action that can block to a "worker" thread (else the GUI blocks, the application appears dead). While it is possible to use own prespawned thread that will accept Runnables which operate on the port, this is not very elegant. It is more common to spawn a new thread for every action triggered by the user. Additionally the ABORT of a running operation is often implemented via a port.close() delegated to a different thread. - During the lifetime of a port, it will usually be accessed from several different threads. Instance variables need to be set/read in synchronized regions to guarantee a correct operation based on the Java memory model. - Synchronizing the access is usually handled on the application level (synchronizing the reads/writes is usually useless from the applications view because it is not a transaction mechanism). [details end] I am very open to learn about other scenarios where your proposed design pattern applied to the port resource is beneficial to the application implementor. Best regards, Joachim On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > Dmitry suggests that we acquire an implementation of > a serial port reference, use it, then release it (i.e., check it > back in). > > Joachim says that making serial ports thread friendly might be a > good idea. > > This is a good idea. The design pattern that is close to this idea > is the "Object Pool Design Pattern". > # Object Pool From jredman at ergotech.com Sun May 14 14:28:24 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 14:28:24 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers Message-ID: <446792E8.4000506@ergotech.com> Does anyone know of any work to make RXTX work with Ethernet (telent) Terminal Servers? If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? We've used RXTX with upwards of 100 virtual COM ports on Windows and it works well. Linux is more problematic. It would be good to have an OS independent solution to accesses remote Ethernet serial ports. Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From legolas.w at gmail.com Sun May 14 14:26:34 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:56:34 +0430 Subject: [Rxtx] does any one have a working sample of RXTX and LPT port Message-ID: <4467927A.4000008@gmail.com> Hi Thank you for reading my post does any one has a working sample for RXTX and LPT port ? Thanks From legolas.w at gmail.com Sun May 14 14:27:29 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:57:29 +0430 Subject: [Rxtx] does RXTX support Trigerr on parallel port? Message-ID: <446792B1.4040905@gmail.com> Hi does RXTX support trigger on LPT port ? if so , how i can use it ? Thanks From tjarvi at qbang.org Sun May 14 17:40:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 17:40:59 -0600 (MDT) Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: <446792E8.4000506@ergotech.com> References: <446792E8.4000506@ergotech.com> Message-ID: On Sun, 14 May 2006, Jim Redman wrote: > Does anyone know of any work to make RXTX work with Ethernet (telent) > Terminal Servers? > > If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 > Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? > Hi Jim It appears the author of NVTCom has decided to release the library into the public domain. Integration with rxtx is possible but it would be best to contact the author and find out what his intent is. I would suggest contacting the author with a proposal of what you would like to do and take it from there. We could 'take' public domain software but its better to show respect to the authors and respect their wishes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:10:23 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:10:23 -0600 (MDT) Subject: [Rxtx] does any one have a working sample of RXTX and LPT port In-Reply-To: <4467927A.4000008@gmail.com> References: <4467927A.4000008@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > Thank you for reading my post > does any one has a working sample for RXTX and LPT port ? > Thanks Hi Legolas LPT port support in rxtx is spotty. That means some people have sent in patches for what they do and it works well for them. The original code was not very good. It may have been 3 hours work :/ To get started, Sun has some demo programs with their commapi. With rxtx 2.1 you can change their code from using javax.com to gnu.io and it -should- work. But if it does not you can post here and on bugzilla. There has been more interest lately off the list and maybe there will be enough community resources to get what you need going. If you do get a sample program together, we would gladly put it in the contrib directory so the next person can get things going faster. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:12:12 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:12:12 -0600 (MDT) Subject: [Rxtx] does RXTX support Trigerr on parallel port? In-Reply-To: <446792B1.4040905@gmail.com> References: <446792B1.4040905@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > does RXTX support trigger on LPT port ? > if so , how i can use it ? > Hi Legolas As mentioned in the previous post, rxtx parallel support is not very mature. But if you can point to something that describes the trigger feature, we can probably make sure its there and give a quick code example. -- Trent Jarvi tjarvi at qbang.org From jredman at ergotech.com Sun May 14 22:22:48 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 22:22:48 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: References: <446792E8.4000506@ergotech.com> Message-ID: <44680218.4080008@ergotech.com> Trent, Trent Jarvi wrote: > On Sun, 14 May 2006, Jim Redman wrote: > >> Does anyone know of any work to make RXTX work with Ethernet (telent) >> Terminal Servers? >> >> If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 >> Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? >> > > Hi Jim > > It appears the author of NVTCom has decided to release the library into > the public domain. Integration with rxtx is possible but it would be best > to contact the author and find out what his intent is. > > I would suggest contacting the author with a proposal of what you would > like to do and take it from there. We could 'take' public domain software > but its better to show respect to the authors and respect their wishes. > I sent Marco(?), the author of the library, a note before asking the list - I'll let you know the response. If anyone is already working on it, or has an interest and more time and energy than me, I'd hate to duplicate the efforts. If no one is, and no one objects, maybe I'll see what I can do. Jim > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From Christian.Klemke at t-online.de Mon May 15 02:23:06 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Mon, 15 May 2006 10:23:06 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu><004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: <008a01c677f8$cae18590$02fea8c0@NB600> Hi Trent, Hi Paul, I finally found some time to create a simple patch to enable the optional suppression of version output to the console. It is based on a new system property called "gnu.io.rxtx.NoVersionOutput" which can by set to "true" if necessary. I had some problems accessing CVS, therefore I downloaded the rxtx-2.1-7r2 source archive from ftp.qbang.org (which is linked on the rxtx.org download page) and worked with that release. Please find my proposed patch in the attachment ! Regards, Christian ----- Original Message ----- From: "Trent Jarvi" To: "RXTX Developers and Users" Cc: ""Paul Gettings"" Sent: Friday, May 05, 2006 2:09 PM Subject: Re: [Rxtx] RXTX causing stdout messages > On Fri, 5 May 2006, Christian Klemke wrote: > >> Hi Paul, >> >> I was wondering about the same question some days ago and took a look at >> the >> source files. Unfortunately, I found that you can only get rid of that >> messages by altering and recompiling the Java code. There is a final >> static >> boolean variable called "devel" in the file "RXTXCommDriver.java" which >> is >> set to "true". This constellation causes the output after the native >> libraries have been loaded. No mechanism exists to suppress them >> otherwise >> :-(. >> >> Trent, does that mean that 2.1.7 is still officially a "development" >> version >> ? When will this value be changed to "false" by default ? With 2.1.8 ? It >> would be nice to provide a means to suppress such messages besides that >> static flag (maybe by setting a property called >> "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The >> output can indeed by annoying, especially when used with console >> applications, where the message potentially appears "in the middle" of >> your >> own output. Another possibility would be not to use System.out directly, >> but >> instead some PrintStream field which is initially set to System.out but >> can >> programatically be changed. That would allow for any kind of redirection >> or >> suppression by implementing appropriate user-defined PrintStream >> subclasses >> and making RXTX use that stream. What do you think ? >> > > A patch for using properties would be accepted I'm sure. > > The reason the default is to display the message is not related to the > development state of rxtx anymore. The problem is that people first using > rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. > The message prevents a great deal of email thats easily explained by the > message. > > I question if we should support rxtx 2.0 at all anymore. > > If you post a patch in bugzilla, we'll put it into CVS this weekend. > we'll be going through and doing such things anyhow. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_version_output_patch.diff Type: application/octet-stream Size: 991 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060515/3173c2b6/rxtx_version_output_patch-0394.obj From lyon at docjava.com Mon May 15 06:06:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 May 2006 08:06:21 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Joachim makes several good points. Let me see if I can address some of them below: >Hello Douglas, > >Looking at the current code, leaves me with the feeling, that there? >is a lot to do. Yes! >Defining an API that wraps javax.comm to provide what? >you describe is certainly possible, but I wonder how much benefit it? >will actually provide. > >Personally I think the API defined by javax.comm > >"request/lock" a port with: > cp= new CommunicationPort(identifier) >"release" a port with: > cp.close(); > >works quite nice for 99% of the applications. I don't know what percentage of applications turn off locking, the way that I do in my version of the RXTX lib. I do know that this is not safe practice. I also know that it was motivated by the multi-platform nature of my code and that this was the only way I could make things work, at the time. Java does not appear to have a cross-platform standard for locking resources on various platforms. Each OS appears to have its own standard. The question of who breaks deadlocks and how this is done remains open, as this is not an easy question to resolve. Let me continue, below: > >In my experience, the most efficient and elegant implementation is to? >wrap a port/socket/.. into a business object which declares the? >remote operations that are possible. Ie "uploadFile",? >"waitForPrompt", "getSerialNumber", "sendContact", "executeCommand",? >etc Those methods are then either synchronized or guarded by a? >monitor. I do not see how your design pattern applied to the port? >resource would help implementing this. I have no problem with high-level wrappers that are application specific. That is a very good idea, but orthogonal with respect to the issue of deadlocks. More below: > >[details start, skip if you agree to the above] >When I talked about "thread-safe" I didn't mean several independent? >"sessions" accessing the port concurrently. I think this is a very? >rare usage. That is probably why turning locking off works so well! On the other hand, it is not safe and I shouldn't do it. >I believe the most common use case for serial ports today? >is the control of an external device from a PC running a GUI based? >application. To implement a clean Swing/AWT-GUI one needs to pass any? >action that can block to a "worker" thread (else the GUI blocks, the? >application appears dead). While it is possible to use own prespawned? >thread that will accept Runnables which operate on the port, this is? >not very elegant. It is more common to spawn a new thread for every? >action triggered by the user. Additionally the ABORT of a running? >operation is often implemented via a port.close() delegated to a? >different thread. Here lies the heart of serial port concern. An application opens a serial port and then dies. The application is restarted and finds the port locked. How do we clear the lock? Must the application's user reside in the UUCP group? Must installers of the serial port add users to the UUCP group? Should locking be handled at a high-level of abstraction in an operating system independent way? Should the implementation of the locking mechanism be translated into an API that is dependent on the OS convention? Suppose that we restrict the discussion to serial ports. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on inconsistent naming conventions. Hence my feeling that we need to mirror what is done in other API's; we need a locking toolkit that references peer methods, IMHO. >From the Java programming point of view, the locking API is portable across different platforms, but has, as its implementation, a native peer method that uses the conventions of the underlying OS. This enables portable resource locking (in theory!). Consider, for example: org.apache.commons.transaction.locking with: Interface LockManager at: http://jakarta.apache.org/commons/transaction/apidocs/org/apache/commons/transaction/locking/LockManager.html Or, more recently: java.util.concurrent.locks Interface Lock based on Doug Lea's code: http://kickjava.com/src/EDU/oswego/cs/dl/util/concurrent/ReadWriteLock.java.htm Should we incorporate a clean, portable design into serial port use, one that is consistent with current locking APIs? Basically, a comm port is a resource and resources are typically controlled by managers. Thus, I suggest that we make use of a CommPortManager to help control and centralize serial port usage. The question of how this is done remains open, IMHO, but using core API's like: java.util.concurrent.locks might not be amiss. High-level methods (getAllPorts, getAllSerialPorts, getAllParallelPorts, etc...) might be welcome additions. Basic questions like, "what if a port is in use?" remain open, hence my proposal for the new design pattern. Isn't it the CommPortManager's role to break the deadlock? Cheers! - Doug > >- During the lifetime of a port, it will usually be accessed from? >several different threads. Instance variables need to be set/read in? >synchronized regions to guarantee a correct operation based on the? >Java memory model. >- Synchronizing the access is usually handled on the application? >level (synchronizing the reads/writes is usually useless from the? >applications view because it is not a transaction mechanism). >[details end] > >I am very open to learn about other scenarios where your proposed? >design pattern applied to the port resource is beneficial to the? >application implementor. > >Best regards, >Joachim > >On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > >> Dmitry suggests that we acquire an implementation of >> a serial port reference, use it, then release it (i.e., check it? >> back in). >> > > Joachim says that making serial ports thread friendly might be a? >> good idea. >> >> This is a good idea. The design pattern that is close to this idea >> is the "Object Pool Design Pattern". >> # Object Pool > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Mon May 15 06:58:19 2006 From: joachim at buechse.de (Joachim Buechse) Date: Mon, 15 May 2006 14:58:19 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Doug, I agree fully, that locking of the system resource should be abstracted from the user (programmer). Currently this is already the case, but I agree it might be nice to extract the code into a separate class, which uses platform dependent providers to do its job. What I described in my email was not targeted at allocating the system resource, but at handling an already allocated system resource inside the framework. I agree that it may be possible to combine the two - however, I would suggest to do this in phase2. I can contribute a work over of RXTXPort.java which implements clean internal locking and proper close behavior (which I would call phase 1). I could do this this week. However I strongly believe that there is little sense in trying to do this as a series of patches. It will be closer to a rewrite than to a patch. I have already provided a number of suggested patches via Bugzilla, but this is quite inconvenient (for me). My working copy diverges more and more from the master and hence it gets more and more annoying to provide self contained patches. Best regards, Joachim From tjarvi at qbang.org Mon May 15 08:27:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 May 2006 08:27:51 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Mon, 15 May 2006, Joachim Buechse wrote: > Hello Doug, > > I agree fully, that locking of the system resource should be > abstracted from the user (programmer). Currently this is already the > case, but I agree it might be nice to extract the code into a > separate class, which uses platform dependent providers to do its job. > > What I described in my email was not targeted at allocating the > system resource, but at handling an already allocated system resource > inside the framework. I agree that it may be possible to combine the > two - however, I would suggest to do this in phase2. > > I can contribute a work over of RXTXPort.java which implements clean > internal locking and proper close behavior (which I would call phase > 1). I could do this this week. > > However I strongly believe that there is little sense in trying to do > this as a series of patches. It will be closer to a rewrite than to a > patch. I have already provided a number of suggested patches via > Bugzilla, but this is quite inconvenient (for me). My working copy > diverges more and more from the master and hence it gets more and > more annoying to provide self contained patches. > For methodical testing purposes (which does go on) the incremental patches are better. I'm lagging behind in bugzilla but thats soon to change (this week). It has just been rather chaotic up until now. I moved, purchased a house, and jumped into the fire of a feature freeze timeframe at a new job. btw, we see the Solaris close issues on 2.8 also. 9 and 10 are fine. I'll work towards making those test results public and allow others to run new rxtx code through them. We had the OK at one point but setting up the environment is involved. It isn't just a collection of java classes. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Tue May 16 02:01:47 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:01:47 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] Message-ID: <446986EB.209@willicon.de> Hi, any ideas for my problem? Hans -------- Original-Nachricht -------- Betreff: [Rxtx] Problem under Mac OSX 10.3.9 Datum: Mon, 08 May 2006 18:47:20 +0200 Von: WILLICon Antwort an: RXTX Developers and Users An: RXTX Developers and Users Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/b0741c2b/attachment-0394.html From joachim at buechse.de Tue May 16 02:15:08 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 10:15:08 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: Hello Hans, I am using RXTX on OS X for my own project. I do not see the problem you describe. I had some troubles installing it because the current version uses lock files which is non-standard on OS X. I have created a patched version which I currently use. This version does not need to modify user groups and hence does not need an installer. I just pop it in the application directory. If you send me a link where I can download your OSX installer, I will have a quick look. Regards, Joachim On 16.05.2006, at 10:01, WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we > have some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + > spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + > spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always > the value "false". > I can only get the status, while I open the port and catch the > exception. > > Any ideas? > > Hans > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail at willicon.de Tue May 16 02:26:53 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:26:53 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: References: <446986EB.209@willicon.de> Message-ID: <44698CCD.7050709@willicon.de> Joachim, tanks for the answer. I'll send You a mail. Hans Joachim Buechse schrieb: > Hello Hans, > > I am using RXTX on OS X for my own project. I do not see the problem > you describe. > > I had some troubles installing it because the current version uses > lock files which is non-standard on OS X. I have created a patched > version which I currently use. This version does not need to modify > user groups and hence does not need an installer. I just pop it in > the application directory. If you send me a link where I can download > your OSX installer, I will have a quick look. > > Regards, > Joachim > > On 16.05.2006, at 10:01, WILLICon wrote: > > >> Hi, >> >> any ideas for my problem? >> >> Hans >> >> -------- Original-Nachricht -------- >> Betreff: [Rxtx] Problem under Mac OSX 10.3.9 >> Datum: Mon, 08 May 2006 18:47:20 +0200 >> Von: WILLICon >> Antwort an: RXTX Developers and Users >> An: RXTX Developers and Users >> >> >> Hi, >> >> I use for RXTX for communicate with CyclingComputers. >> >> It works good under Win32, Sloaris and Linux but with Mac OSX we >> have some problems. >> >> My users install the Mac OSX serial lib from the actual binary. >> >> After starting the program, they get this error message: >> >> java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while >> loading gnu.io.RXTXCommDriver >> >> Remember, this error comes only under Mac OSX. >> >> That is the code for the error: >> >> Enumeration portList = CommPortIdentifier.getPortIdentifiers(); >> spInUse = getBundleStr("serialPortInUse"); >> spFree = getBundleStr("serialPortFree"); >> while (portList.hasMoreElements()) { >> CommPortIdentifier portId = (CommPortIdentifier) >> portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (osName != null && osName.startsWith("mac")) { >> if (!portId.getName().startsWith("dev/cu.")) { >> continue; >> } >> } >> if (portId.isCurrentlyOwned()) { >> serialPortNames.add(portId.getName() + " - " + >> spInUse); >> } >> else { >> serialPortNames.add(portId.getName() + " - " + >> spFree); >> } >> } >> } >> if (serialPortNames.size() == 0) { >> serialPortNames.add(getBundleStr("serialPortNotFound")); >> } >> >> BTW: The methode isCurrentlyOwned() is not working. I get always >> the value "false". >> I can only get the status, while I open the port and catch the >> exception. >> >> Any ideas? >> >> Hans >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/948333be/attachment-0394.html From jredman at ergotech.com Tue May 16 07:35:52 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 16 May 2006 07:35:52 -0600 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: <4469D538.6070408@ergotech.com> Hans, I have no direct insight, but would note that what you have is a "NoClassDefFoundError" not a "ClassNotFoundException". So the class javax/comm/CommDriver is found, but one of its dependencies is missing. NoClassDefFoundError are a bigger problem to resolve because you get no indication of the real problem. Jim WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we have > some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > * spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always the > value "false". > I can only get the status, while I open the port and catch the exception. > > Any ideas? > > Hans > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.de Tue May 16 08:01:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 16:01:21 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 In-Reply-To: <4469AFC3.6000002@willicon.de> References: <44698EBC.8000008@willicon.de> <8C5680C4-E2BA-42FF-B221-36E1124FA6A4@buechse.de> <4469AFC3.6000002@willicon.de> Message-ID: <9825A602-D6ED-4C28-BF33-9A7C984FACD5@buechse.de> Hallo Hans, you include RXTX 2.17 in your "bikeXexperience.jar" (2.17 uses Interfaces from gnu.io.* not javax.comm.*). Now inspect your error log closely: The class gnu.io.RXTXCommDriver tries to load javax.comm.CommDriver: this is only the case for RXTX 2.07. I assume, that the user has installed Version 2.07 into one of the java.ext.dirs . The VM always tries to load classes from the "system" path first. The current Mac installer distributed with RXTX in fact installs RXTXcomm.jar and librxtxSerial.jnilib into /Library/Java/Extensions. (I wrote some time ago that I consider this as a bad idea because of potential version conflicts-> thanks for delivering the example). For 2.07 it does so without installing the javax.comm classes it seems. I would recommend that you instruct your users to install version 2.17 only. Until RXTX is changed to use TIOCEXCL instead of lock files, you can hardly avoid the installer, as the user needs to be added to a special group and a lockfile directory needs be created. More precisely you are waiting for: http://bugzilla.qbang.org/show_bug.cgi?id=50 [RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL)] Regards, Joachim -------------- next part -------------- A non-text attachment was scrubbed... Name: log.tiff Type: image/tiff Size: 38394 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/e3e52128/log-0394.tiff -------------- next part -------------- > > Ich verwende RXTX 2.17. Das orginal RXTXcomm.jar ist in > CyclingDataManager.jar enthalten. > From tjarvi at qbang.org Wed May 17 23:18:15 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 May 2006 23:18:15 -0600 (MDT) Subject: [Rxtx] update Message-ID: So we have several patches and these have stacked up. I'd like to thank everyone for being patient. Tests for the most intrusive patches look good so far. I still have to get some bits together on my end but it looks like we can catch everything up in CVS this week. I'll try to post a normal list of what went in by whom with links Saturday. But I'm not seeing anything that raises flags yet. I also think I'll be able to submit a patch for nonstandard baud rates. I have to confirm w32 but I think its going to be a one line fix. I don't know if its bugzilla or people tinkering with patch files before submitting but patches are not applying cleanly. So the patches have to be done by hand. This may make things difficult for people hoping to add other patches on top. I'm trying to make that go well but ... -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Thu May 18 02:23:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 May 2006 10:23:47 +0200 Subject: [Rxtx] update In-Reply-To: References: Message-ID: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Hello Trent, in fact I tinkered with the patches (never used this mechanism before, usually I "communicate" via cvs) ... so sorry for any trouble you had applying them. Basicly I edited the patches to make them self contained. Having the tests run with different speeds on different platforms, may well be an effect of caching. I have seen quite interesting propagation delays for the closing flag on my PowerPC system, which makes me doubt, that the propagation of output_buffer_empty_flag works as it should. Maybe the communication mechanism between the two threads should be replaced by something like pthread_cond_*. Could you describe which problems you see on Solaris/SPARC? I'd be interested to see if they exist on OS X (PowerPC) as well... As you seem to work on the stuff at the moment I would like to suggest the following additions (it looks more than it is, I posted some context to make clear where to apply the change). See the comments in braces for what was changed Greetings, Joachim (1) The end of the drain loop could be: --- report("drain_loop: received EINTR in tcdrain\n"); --- (added "in tcdrain" to make debug output clearer) (2) The start of the drain loop should be: --- for(i=0;;i++) { report_verbose("drain_loop: looping\n"); #if defined(__sun__) /* FIXME: No time to test on all OS's for production */ if( eis->eventloop_interrupted ) { goto end; } if (usleep(5000)) { report("drain_loop: received EINTR"); } #else if (usleep(1000000)) { report("drain_loop: received EINTR"); } #endif /* __sun__ */ --- (added a check for "eis->eventloop_interrupted" before the sleep) (3) The end of interrupt_event_loop could (and maybe should) be: --- #if !defined(TIOCSERGETLSR) && !defined(WIN32) /* make sure that the drainloop unblocks from tcdrain */ pthread_kill(index->drain_tid, SIGABRT); /* TODO use wait/join/SIGCHLD/?? instead of sleep? */ usleep(50 * 1000); /* Under normal conditions, SIGABRT will unblock tcdrain. However a non-responding USB device combined with an unclean driver may still block. This is very ugly because it may block the call to close indefinetly. */ if (index->closing != 1) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); index->closing = 1; } #endif report("interruptEventLoop: interrupted\n"); --- (added some comments and pthread_cancel for resisting drain thread) On 18.05.2006, at 07:18, Trent Jarvi wrote: > > So we have several patches and these have stacked up. I'd like to > thank > everyone for being patient. > > Tests for the most intrusive patches look good so far. I still > have to > get some bits together on my end but it looks like we can catch > everything > up in CVS this week. > > I'll try to post a normal list of what went in by whom with links > Saturday. But I'm not seeing anything that raises flags yet. I also > think I'll be able to submit a patch for nonstandard baud rates. > I have > to confirm w32 but I think its going to be a one line fix. > > I don't know if its bugzilla or people tinkering with patch files > before > submitting but patches are not applying cleanly. So the patches > have to > be done by hand. This may make things difficult for people hoping > to add > other patches on top. I'm trying to make that go well but ... > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu May 18 22:28:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 18 May 2006 22:28:00 -0600 (MDT) Subject: [Rxtx] update In-Reply-To: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> References: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Message-ID: On Thu, 18 May 2006, Joachim Buechse wrote: > Hello Trent, > > in fact I tinkered with the patches (never used this mechanism > before, usually I "communicate" via cvs) ... so sorry for any trouble > you had applying them. Basicly I edited the patches to make them self > contained. I think we are close to moving towards that. > > Having the tests run with different speeds on different platforms, > may well be an effect of caching. I have seen quite interesting > propagation delays for the closing flag on my PowerPC system, which > makes me doubt, that the propagation of output_buffer_empty_flag > works as it should. Maybe the communication mechanism between the two > threads should be replaced by something like pthread_cond_*. Could > you describe which problems you see on Solaris/SPARC? I'd be > interested to see if they exist on OS X (PowerPC) as well... This is interesting. I have seen problems with output buffer empty in applications that require it. I'm trying to get a bug list and or test results open for everyone to see but that may take time. But missed output buffer events ... yep. With Sparc, we have seen a few things. One was a kernel race condition that went away when we reimaged and updated 2.8. RXTX was hanging on close, top showed no cpu use but there was 2 second delays just typing on console. The other is our tests now take ~4 times longer on Solaris. Someone is looking at timing just open, close, read, write, ... to see if they can find where the slowdown is. This happened after solaris 2.8. I'll try to share more when/if there is something interesting. This may well not be solvable in userland. > > As you seem to work on the stuff at the moment I would like to > suggest the following additions (it looks more than it is, I posted > some context to make clear where to apply the change). See the > comments in braces for what was changed I'll take a look. This could all come together Saturday but I also have an event to attend that day. I may not wrap this up until Sunday. -- Trent Jarvi tjarvi at qbang.org From andrewlord at internode.on.net Sun May 21 20:10:02 2006 From: andrewlord at internode.on.net (Andrew Lord) Date: Mon, 22 May 2006 11:40:02 +0930 Subject: [Rxtx] Kernel include files do not match kernel Message-ID: <200605221140.03271.andrewlord@internode.on.net> Hi, I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel 2.6.12-18 with the command: ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include However I get the message: ## checking java.version 1.5.0_06 ## checking os.version 2.6.12-18mdk ## ## WARNING: Kernel include files do not match the current kernel ## ## configure: creating ./config.status etc. Is there a problem with the way I'm specifying the 'include' directory ? If not, how else can I specify the correct directory for the include files please ? Cheers, Andrew From tjarvi at qbang.org Sun May 21 20:31:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 May 2006 20:31:31 -0600 (MDT) Subject: [Rxtx] Kernel include files do not match kernel In-Reply-To: <200605221140.03271.andrewlord@internode.on.net> References: <200605221140.03271.andrewlord@internode.on.net> Message-ID: On Mon, 22 May 2006, Andrew Lord wrote: > Hi, > > I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel > 2.6.12-18 with the command: > > ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk > CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include > > However I get the message: > > ## checking java.version 1.5.0_06 > ## checking os.version 2.6.12-18mdk > ## > ## WARNING: Kernel include files do not match the current kernel > ## > ## configure: creating ./config.status > etc. > > Is there a problem with the way I'm specifying the 'include' directory ? If > not, how else can I specify the correct directory for the include files > please ? > Hi Andrew I'm fairly sure your --with-kernel option does nothing. The CPPFLAGS should do what you want. Maybe put an #error message in /usr/src/linux.../incude/linux/version.h But I don't recall a recent problem with version missmatches. It should work. Distros will even ship include files that don't match versions exactly. In theory it should never matter for users. I used to compile new kernels by hand and really didnt have a distro. I didnt have a seperate package of kernel headers for users (myself). When changing a gateway from linux 1.2.12 to 2.1.77, I would worry about such messages. So if you are doing something that weird, the message may be of use to you. If you just see the message on a distro you installed, it is more than likely harmless. -- Trent Jarvi tjarvi at qbang.org From mrogers at spro.net Mon May 22 14:45:39 2006 From: mrogers at spro.net (Mike Rogers) Date: Mon, 22 May 2006 14:45:39 -0600 Subject: [Rxtx] Sun's CommAPI -- think May? Message-ID: <447222F3.9040302@spro.net> Hi, Any word from Sun about progress towards fixing the Java CommAPI v3 "incompatibilities" so RXTX 2.0 can operate within the framework's namespace (javax.comm)? I recall mention of a May time frame. Thanks, Mike From paul.klissner at sun.com Mon May 22 15:09:27 2006 From: paul.klissner at sun.com (Paul Klissner) Date: Mon, 22 May 2006 14:09:27 -0700 Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <447222F3.9040302@spro.net> References: <447222F3.9040302@spro.net> Message-ID: <44722887.8080308@sun.com> Mike Rogers wrote: > Hi, > > Any word from Sun about progress towards fixing the Java CommAPI v3 > "incompatibilities" so RXTX 2.0 can operate within the framework's > namespace (javax.comm)? I recall mention of a May time frame. > > Thanks, > > Mike > We've had a lot of work come in. This hasn't been the only priority. I'm running behind the plan in addressing this, but will be looking at it again soon. Rather than state a new, I'll just say it is in progress, and not off the table. I'll get this fixed as soon as I can. Good timing for asking as we just started discussing javax.comm plans today, and I'll have some cycles to work on it soon. Paul From yhua537 at cse.unsw.edu.au Mon May 22 16:03:05 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Tue, 23 May 2006 08:03:05 +1000 (EST) Subject: [Rxtx] install rxtx in XP Message-ID: Hi Guys, I am new to serial port programming, and have no experience on programming java in xp, but my project require me to builld a communication link between xp and a UART device. Most of the information in the web site seems for linux only. including the commands such as export and chmod. How do I install rxtx in xp? cheers YiQi Huang From mark at mdsh.com Tue May 23 01:24:20 2006 From: mark at mdsh.com (Mark Himsley) Date: Tue, 23 May 2006 08:24:20 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off , it includes DLLs for Windows and the JAR for Java. Follow the Windows instructions in the INSTALL. ie RXTXcomm.jar goes in \jre\lib\ext (under java) rxtxSerial.dll goes in \jre\bin So, assuming a fairly standard Java install, copy RXTXcomm.jar into C:\Program Files\Java\jre1.5.0_06\lib\ext and copy rxtxSerial.dll into C:\Program Files\Java\jre1.5.0_06\bin Yes, it really is that simple. On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > I am new to serial port programming, and have no experience on > programming java in xp, but my project require me to builld a > communication link between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang -- Mark Himsley From joachim at buechse.de Tue May 23 02:51:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 23 May 2006 10:51:47 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) Unless it is absolutely required you should NOT install RXTX in your global Java Runtime Environment. This will for sure create versioning conflicts - if not now, than in the future, if not on your system than at your clients. Instead put the dll in your application directory and include the RXTXcomm.jar in your classpath. This is much safer and not a bit more complicated. Regards, Joachim On 23.05.2006, at 09:24, Mark Himsley wrote: > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR > for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > >> I am new to serial port programming, and have no experience on >> programming java in xp, but my project require me to builld a >> communication link between xp and a UART device. >> >> Most of the information in the web site seems for linux only. >> including >> the commands such as export and chmod. How do I install rxtx in xp? >> >> cheers >> YiQi Huang > > > > -- > Mark Himsley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tod at todbot.com Tue May 23 03:12:22 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 02:12:22 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I totally agree: do not contaminate the Java installation. I put all the RXTX files in a directory and then change my java invocation to be: % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* Alternatively, use Launch4J to create a double-clickable application and keep the RXTX libraries in the directory of the application. -=tod On May 23, 2006, at 1:51 AM, Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > >> Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off >> , it includes DLLs for Windows and the JAR >> for Java. >> >> Follow the Windows instructions in the INSTALL. >> >> ie >> >> RXTXcomm.jar goes in \jre\lib\ext (under java) >> rxtxSerial.dll goes in \jre\bin >> >> So, assuming a fairly standard Java install, copy RXTXcomm.jar into >> C:\Program Files\Java\jre1.5.0_06\lib\ext >> and copy rxtxSerial.dll into >> C:\Program Files\Java\jre1.5.0_06\bin >> >> Yes, it really is that simple. >> >> >> >> On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: >> >>> I am new to serial port programming, and have no experience on >>> programming java in xp, but my project require me to builld a >>> communication link between xp and a UART device. >>> >>> Most of the information in the web site seems for linux only. >>> including >>> the commands such as export and chmod. How do I install rxtx in xp? >>> >>> cheers >>> YiQi Huang >> >> >> >> -- >> Mark Himsley >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From smontgomery at mediaspansoftware.com Tue May 23 08:46:53 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Tue, 23 May 2006 10:46:53 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: Message-ID: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Joachim and Tod mentioned how to keep the files RXTX requires on Windows XP out of the Java installations - thanks gentlemen! Are there similar suggestions for an RXTX install on OS X? The current "canonical" OS X installation instructions "contaminate the Java installation", to use Tod's words. Our app will run fine under 1.4.2 and 5.0 on OS X, and a lot of users will have both. We've already been burned by the recent switch from 1.4.2 to 5.0 as the platform default. Any suggestions welcomed. From tod at todbot.com Tue May 23 13:27:55 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 12:27:55 -0700 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <9BA0F670-A862-42E7-BB2C-130D775ABDF9@todbot.com> Hi Sean, It depends on how you build and deploy your code. If you're using shell scripts, you can do something like this: #!/bin/sh # pick one JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/ Commands/java #JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/ Commands/java $JAVA -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* That both picks which VM to use and uses the RXTX in the directory called 'rxtxlib'. If you want your shell script to be clever, you could test for the existence of the different 'java' executables and go from there (maybe even use different jar files). I am almost positive all OS X systems with Java 1.5 are guaranteed to also have Java 1.4.2. If you're using Jar Builder or XCode, you can specify which JVM to use and add the extra args in the Info.plist file. The paths specified in the 'java' invocation then are based off of the $JAVAROOT variable that the JavaApplicationStub sets for you. For my app, I've have been compiling two sets of jars, one compiled with 1.4.2 and one with 1.5, but they both run under 1.5. So I have a similar shell script that chooses a different 'javac' depending on the need. -=tod On May 23, 2006, at 7:46 AM, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From yhua537 at cse.unsw.edu.au Tue May 23 11:09:37 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 03:09:37 +1000 (EST) Subject: [Rxtx] install rxtx in XP (Mark Himsley, Joachim Buechse, Tod E. Kurt> In-Reply-To: References: Message-ID: > Message: 8 > Date: Tue, 23 May 2006 08:03:05 +1000 (EST) > From: YiQi Huang > Subject: [Rxtx] install rxtx in XP > To: rxtx at qbang.org > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > Hi Guys, > > I am new to serial port programming, and have no experience on programming > java in xp, but my project require me to builld a communication link > between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang > > > ------------------------------ > > Message: 9 > Date: Tue, 23 May 2006 08:24:20 +0100 > From: Mark Himsley > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=us-ascii; format=flowed > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > ------------------------------ > > Message: 10 > Date: Tue, 23 May 2006 10:51:47 +0200 > From: Joachim Buechse > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > > ------------------------------ > > Message: 11 > Date: Tue, 23 May 2006 02:12:22 -0700 > From: "Tod E. Kurt" > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I totally agree: do not contaminate the Java installation. > > I put all the RXTX files in a directory and then change my java > invocation to be: > > % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* > > Alternatively, use Launch4J to create a double-clickable application > and keep the RXTX libraries in the directory of the application. > > -=tod > > Hi, Thanks guys, I don't know if this is the correct way to reply your mecessage, if wrong, please point out. Thank you for Mark to give the detail instructions and Joachim to point out the cons ot installing in the java directory, and specially thanks for Tod to give the instrection in detail. Sorry to ask another stupid question: I have followed Tod's instruction. Now I think i am ready to start hacking. But where is the RXTX API documentation? Is it the same as using normal java comm API? btw, where could i find some examples to start with? Thanks very much cheers YiQi Huang From tjarvi at qbang.org Tue May 23 16:09:32 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 May 2006 16:09:32 -0600 (MDT) Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <44722887.8080308@sun.com> References: <447222F3.9040302@spro.net> <44722887.8080308@sun.com> Message-ID: > Good timing for asking as we just started discussing javax.comm plans > today, and I'll have some cycles to work on it soon. Hi Paul I assume you mean Sun is discussing plans concerning its own internal actions and there is no community involvment at this point. -- Trent Jarvi tjarvi at qbang.org From yhua537 at cse.unsw.edu.au Tue May 23 22:50:01 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 14:50:01 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } From mmester at sps.edu Tue May 23 22:58:21 2006 From: mmester at sps.edu (Michael Mester) Date: Wed, 24 May 2006 00:58:21 -0400 Subject: [Rxtx] install rxtx in XP References: Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below -----Original Message----- From: rxtx-bounces at qbang.org on behalf of YiQi Huang Sent: Wed 5/24/2006 12:50 AM To: RXTX Developers and Users Subject: Re: [Rxtx] install rxtx in XP Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3950 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060523/b36d0c63/attachment-0394.bin From yhua537 at cse.unsw.edu.au Tue May 23 23:05:50 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 15:05:50 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: Yes, Michael you are right, it should be semicolons, But it still can't find the correct library. On Wed, 24 May 2006, Michael Mester wrote: > I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below > > > -----Original Message----- > From: rxtx-bounces at qbang.org on behalf of YiQi Huang > Sent: Wed 5/24/2006 12:50 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] install rxtx in XP > > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > cheers YiQi Huang From tod at todbot.com Wed May 24 00:01:57 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 23:01:57 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Yes, sorry, classpath entries are semicolon-separated on Windows and colon-separated on everything else. Your example code below is importing the wrong set of classes. It should not "import javax.comm.*", instead it should "import gnu.io.*". When I make that change, your example program compiles. The "javax.comm" package is the one released by Sun, the "gnu.io" package is the RXTX one. You might've seen some discussion that the two will be merged or become compatible, but that hasn't happened yet. -=tod On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > > Yes, Michael you are right, it should be semicolons, But it still > can't > find the correct library. > > On Wed, 24 May 2006, Michael Mester wrote: > >> I believe the entries in the classpath need to be seperated with >> semicolons, not a colon as you have in your command below >> >> >> -----Original Message----- >> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >> Sent: Wed 5/24/2006 12:50 AM >> To: RXTX Developers and Users >> Subject: Re: [Rxtx] install rxtx in XP >> >> Hi, >> >> Sorry guys.I follow Tod's instruction, and here is what i did: >> >> put >> RXTXcomm.jar, >> rxtxParallel.dll, >> rxtxSerial.dll >> in >> C:\RXTX_files >> >> and I got a SimpleRead class attached below, compile it with : >> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >> it still saying "cannot find symbol". >> >> Is there anything I did wrong? Do I need the comm.jar from Sun? >> >> Thanks & regards >> YiQi Huang >> >> >> //////////////////////////////////////////////////////// >> // SimpleRead.java >> //////////////////////////////////////////////////////// >> >> import java.io.*; >> import java.util.*; >> import javax.comm.*; >> >> public class SimpleRead >> implements Runnable, SerialPortEventListener { >> static CommPortIdentifier portId; >> static Enumeration portList; >> InputStream inputStream; >> SerialPort serialPort; >> Thread readThread; >> public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == >> CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals("COM1")) { >> //if (portId.getName().equals("/dev/term/a")) { >> SimpleRead reader = new SimpleRead(); >> } >> } >> } >> } >> public SimpleRead() { >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", >> 2000); >> } catch (PortInUseException e) {} >> try { >> inputStream = serialPort.getInputStream(); >> } catch (IOException e) {} >> try { >> serialPort.addEventListener(this); >> } catch (TooManyListenersException e) {} >> serialPort.notifyOnDataAvailable(true); >> try { >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } catch (UnsupportedCommOperationException e) {} >> readThread = new Thread(this); >> readThread.start(); >> } >> public void run() { >> try { >> Thread.sleep(20000); >> } catch (InterruptedException e) {} >> } >> public void serialEvent(SerialPortEvent event) { >> switch(event.getEventType()) { >> case SerialPortEvent.BI: >> case SerialPortEvent.OE: >> case SerialPortEvent.FE: >> case SerialPortEvent.PE: >> case SerialPortEvent.CD: >> case SerialPortEvent.CTS: >> case SerialPortEvent.DSR: >> case SerialPortEvent.RI: >> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >> break; >> case SerialPortEvent.DATA_AVAILABLE: >> byte[] readBuffer = new byte[20]; >> try { >> while (inputStream.available() > 0) { >> int numBytes = inputStream.read(readBuffer); >> } >> System.out.print(new String(readBuffer)); >> } catch (IOException e) {} >> break; >> } >> } >> } >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > cheers > YiQi Huang > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From joachim at buechse.de Wed May 24 00:10:06 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:10:06 +0200 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Hi Sean, my preferred way of dealing with RXTX on OS X is to include the RXTX classes into my application jar and to put the RXTX lib in the same directory as this jar. To make it even more comfortable, you can include the lib in the jar and have some startup code extract it and write it to a temporary file from which you load it with System.load(). Unfortunately the current version of RXTX for OS X requires tinkering with user groups as it is based on lockfiles - and hence it needs the RXTX OS X installer or you need to duplicated this functionality in your own installer. I have created my own native version which is not based on lockfiles but tty locking (the standard way to do it on OSX). I hope that these patches will be integrated soon into the distribution. Regards, Joachim On 23.05.2006, at 16:46, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Wed May 24 00:16:12 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:16:12 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <7017ECFC-B13E-4806-B321-9FFCAC5830F0@buechse.de> I assume you downloaded rxtx-217 (not 207). Instead of importing javax.comm.* you must import gnu.io.* The classes have the same name, but they are not in the same package. On 24.05.2006, at 06:50, YiQi Huang wrote: > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From yhua537 at cse.unsw.edu.au Wed May 24 00:17:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 16:17:45 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Message-ID: Thanks Tod again, i kept reading "gnu.io.*" as "gun.io.*" last few hours after i read some commons from web. Thanks very much Tod. thanks YiQi Huang On Tue, 23 May 2006, Tod E. Kurt wrote: > Yes, sorry, classpath entries are semicolon-separated on Windows and > colon-separated on everything else. > > Your example code below is importing the wrong set of classes. It > should not "import javax.comm.*", instead it should "import > gnu.io.*". When I make that change, your example program compiles. > The "javax.comm" package is the one released by Sun, the "gnu.io" > package is the RXTX one. You might've seen some discussion that the > two will be merged or become compatible, but that hasn't happened yet. > > -=tod > > > On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > >> >> Yes, Michael you are right, it should be semicolons, But it still >> can't >> find the correct library. >> >> On Wed, 24 May 2006, Michael Mester wrote: >> >>> I believe the entries in the classpath need to be seperated with >>> semicolons, not a colon as you have in your command below >>> >>> >>> -----Original Message----- >>> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >>> Sent: Wed 5/24/2006 12:50 AM >>> To: RXTX Developers and Users >>> Subject: Re: [Rxtx] install rxtx in XP >>> >>> Hi, >>> >>> Sorry guys.I follow Tod's instruction, and here is what i did: >>> >>> put >>> RXTXcomm.jar, >>> rxtxParallel.dll, >>> rxtxSerial.dll >>> in >>> C:\RXTX_files >>> >>> and I got a SimpleRead class attached below, compile it with : >>> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >>> it still saying "cannot find symbol". >>> >>> Is there anything I did wrong? Do I need the comm.jar from Sun? >>> >>> Thanks & regards >>> YiQi Huang >>> >>> >>> //////////////////////////////////////////////////////// >>> // SimpleRead.java >>> //////////////////////////////////////////////////////// >>> >>> import java.io.*; >>> import java.util.*; >>> import javax.comm.*; >>> >>> public class SimpleRead >>> implements Runnable, SerialPortEventListener { >>> static CommPortIdentifier portId; >>> static Enumeration portList; >>> InputStream inputStream; >>> SerialPort serialPort; >>> Thread readThread; >>> public static void main(String[] args) { >>> portList = CommPortIdentifier.getPortIdentifiers(); >>> while (portList.hasMoreElements()) { >>> portId = (CommPortIdentifier) portList.nextElement(); >>> if (portId.getPortType() == >>> CommPortIdentifier.PORT_SERIAL) { >>> if (portId.getName().equals("COM1")) { >>> //if (portId.getName().equals("/dev/term/a")) { >>> SimpleRead reader = new SimpleRead(); >>> } >>> } >>> } >>> } >>> public SimpleRead() { >>> try { >>> serialPort = (SerialPort) portId.open("SimpleReadApp", >>> 2000); >>> } catch (PortInUseException e) {} >>> try { >>> inputStream = serialPort.getInputStream(); >>> } catch (IOException e) {} >>> try { >>> serialPort.addEventListener(this); >>> } catch (TooManyListenersException e) {} >>> serialPort.notifyOnDataAvailable(true); >>> try { >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, >>> SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> } catch (UnsupportedCommOperationException e) {} >>> readThread = new Thread(this); >>> readThread.start(); >>> } >>> public void run() { >>> try { >>> Thread.sleep(20000); >>> } catch (InterruptedException e) {} >>> } >>> public void serialEvent(SerialPortEvent event) { >>> switch(event.getEventType()) { >>> case SerialPortEvent.BI: >>> case SerialPortEvent.OE: >>> case SerialPortEvent.FE: >>> case SerialPortEvent.PE: >>> case SerialPortEvent.CD: >>> case SerialPortEvent.CTS: >>> case SerialPortEvent.DSR: >>> case SerialPortEvent.RI: >>> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >>> break; >>> case SerialPortEvent.DATA_AVAILABLE: >>> byte[] readBuffer = new byte[20]; >>> try { >>> while (inputStream.available() > 0) { >>> int numBytes = inputStream.read(readBuffer); >>> } >>> System.out.print(new String(readBuffer)); >>> } catch (IOException e) {} >>> break; >>> } >>> } >>> } >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> >> cheers >> YiQi Huang >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From smontgomery at mediaspansoftware.com Wed May 24 10:24:13 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 12:24:13 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: Tod & Joachim, Thanks for the info, that's very helpful. I'll give that a whirl when I move to rxtx 2.1. I'm still using the older 2.0.7 version for now (don't ask), which probably requires the Sun comm.jar, javax.comm.properties and librxtxSerial.jnilib to be in very specific places in each jvm's file hierarchy. From tjarvi at qbang.org Wed May 24 11:59:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 11:59:16 -0600 (MDT) Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: On Wed, 24 May 2006, Sean Montgomery wrote: > Tod & Joachim, > > Thanks for the info, that's very helpful. I'll give that a whirl > when I move to rxtx 2.1. I'm still using the older 2.0.7 version for > now (don't ask), which probably requires the Sun comm.jar, > javax.comm.properties and librxtxSerial.jnilib to be in very specific > places in each jvm's file hierarchy. > You will need comm.jar from Sun then. It must be Sun's version 2.* or older for Linux or Solaris. I assume they have this in download archives. The default offering from Sun is version 3.0. This version currently does not support rxtx. The older version will probably be fine for your needs. -- Trent Jarvi tjarvi at qbang.org From smontgomery at mediaspansoftware.com Wed May 24 12:19:06 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 14:19:06 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: <3939EFB8-11E1-4E3E-A684-5B3C525577CD@mediaspansoftware.com> Yup, that's right, thanks Trent. I've been using these files for quite a while now. Thanks for bringing it up. I almost didn't mention using 2.0.7 because I didn't want to give any new members of the list the wrong idea! :-) On May 24, 2006, at 1:59 PM, Trent Jarvi wrote: > On Wed, 24 May 2006, Sean Montgomery wrote: > >> Tod & Joachim, >> >> Thanks for the info, that's very helpful. I'll give that a whirl >> when I move to rxtx 2.1. I'm still using the older 2.0.7 version for >> now (don't ask), which probably requires the Sun comm.jar, >> javax.comm.properties and librxtxSerial.jnilib to be in very specific >> places in each jvm's file hierarchy. >> > > You will need comm.jar from Sun then. It must be Sun's version 2.* or > older for Linux or Solaris. I assume they have this in download > archives. > > The default offering from Sun is version 3.0. This version > currently does > not support rxtx. > > The older version will probably be fine for your needs. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mark at mdsh.com Wed May 24 15:55:46 2006 From: mark at mdsh.com (Mark Himsley) Date: Wed, 24 May 2006 22:55:46 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <37B0FC4B1F3237321F093ABE@MacMini.local> On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) That's no problem. BUT, do note that the instructions I elaborated on are in the INSTALL file within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone please update the INSTALL file? > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > > , it includes DLLs for Windows and the JAR > > for Java. > > > > Follow the Windows instructions in the INSTALL. > > > > ie > > > > RXTXcomm.jar goes in \jre\lib\ext (under java) > > rxtxSerial.dll goes in \jre\bin > > > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > > C:\Program Files\Java\jre1.5.0_06\lib\ext > > and copy rxtxSerial.dll into > > C:\Program Files\Java\jre1.5.0_06\bin > > > > Yes, it really is that simple. > > > > > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > > > >> I am new to serial port programming, and have no experience on > >> programming java in xp, but my project require me to builld a > >> communication link between xp and a UART device. > >> > >> Most of the information in the web site seems for linux only. > >> including > >> the commands such as export and chmod. How do I install rxtx in xp? > >> > >> cheers > >> YiQi Huang > > > > > > > > -- > > Mark Himsley > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Mark Himsley From tjarvi at qbang.org Wed May 24 16:41:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 16:41:46 -0600 (MDT) Subject: [Rxtx] install rxtx in XP In-Reply-To: <37B0FC4B1F3237321F093ABE@MacMini.local> References: <37B0FC4B1F3237321F093ABE@MacMini.local> Message-ID: On Wed, 24 May 2006, Mark Himsley wrote: > > > On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > >> I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > That's no problem. > > BUT, do note that the instructions I elaborated on are in the INSTALL file > within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone > please update the INSTALL file? > > The INSTALL file may be updated by anyone at anytime. http://rxtx.qbang.org/wiki/index.php/Installation We are moving it to the wiki so end users may put the type of answers they would like to see in. Sometimes it's best if developers don't give what appears to be cryptic answers. You can even put in that jre/lib/ext is not the right place but you don't understand the classpath solution mentioned on the mail-list and then we know what to add. -- Trent Jarvi tjarvi at qbang.org From stramit at gmail.com Wed May 24 21:45:31 2006 From: stramit at gmail.com (Tim Cooper) Date: Thu, 25 May 2006 13:45:31 +1000 Subject: [Rxtx] Accessing Virtual Com Port Message-ID: Hi, I have to develop an application that talks to a virtual com port (in this case com3) which translates any messages sent across a USB cable to a micro. Using C++ I can talk to this com port and I know that it is configured, present, and working. For the application that I am trying to write I want to use RXTX for the communication. My problem is that the configured virtual port (in windows) is not showing up when I do an enumeration over the available ports. The output I get is (com 3 is not present) : Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 PORT FOUND: COM1 PORT FOUND: LPT1 Is there anything that I need to do to make com3 available to RXTX and my application? Timothy Cooper -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060524/c5591648/attachment-0394.html From antonio.luis at iscte.pt Thu May 25 01:39:13 2006 From: antonio.luis at iscte.pt (=?ISO-8859-1?Q?Ant=F3nio_Lopes?=) Date: Thu, 25 May 2006 08:39:13 +0100 Subject: [Rxtx] RXTX on Pocket PC Message-ID: <44755F21.8060103@iscte.pt> Hello everyone, I've been using RXTX to communicate with serial ports in Windows and it's been quite successful. However, I'm now considering porting my application from Windows to Pocket PC but I can't seem to find the RXTX binaries (*.jar and *.dll) to use in Pocket PC. I've been "digging" on the mailing list's archives and also on the web and I can't find these anywhere. Can anyone in this mailing list give me some pointers on this? Where can I find the necessary files and basic installation instructions? Thanks very much for your help. I very much appreciate any help that you can provide me. Regards, -- Ant?nio Lopes @contact: antonio.luis at iscte.pt @work: ADETTI - ISCTE @web: http://antonio.lopes.googlepages.com/home From doug at dupreeinc.com Fri May 26 15:45:50 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Fri, 26 May 2006 14:45:50 -0700 Subject: [Rxtx] rxtx slow startup Message-ID: <4477770E.9010400@dupreeinc.com> Hello, I hope there are people still reading this mailing list. The archive appeared to not have anything new after 4/2005. I was using the commapi from sun for a project where a java application reads data from test equipment connected to the serial port. I had to upgrade the ftdi vcp driver on my pc and the old sun commapi no longer works with hardware flow control. as an experiment I replaced the javax.com with gnu.io in the SerialDemo.java project that was included with the commapi. This compiled fine using JBuilder 2006 and JRE 1.5.0_05. RXTX also works with the latest ftdi drivers so life is wonderful again... almost... When using the commapi jar the SerialDemo program starts in about 1 second on my system. Using the RXTX jar it takes over 56 seconds to start. Has anyone else seen this problem? Is there a workaround to get the startup performance close to the old commapi? The last thing printed to the console before this delay is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks for your time! Doug From yhua537 at cse.unsw.edu.au Sat May 27 05:46:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 21:46:45 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <4477770E.9010400@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> Message-ID: hi Doug The archive hasn't been update for a long time, But people certainly still reading the list. I don't have enough experience to help on your problem, but without any detail about what your problem doing during that 56 seconds, it is hard to target the your question, I think. cheers YiQi On Fri, 26 May 2006, Doug Thistlethwaite wrote: > Hello, > > I hope there are people still reading this mailing list. The archive > appeared to not have anything new after 4/2005. > > I was using the commapi from sun for a project where a java application > reads data from test equipment connected to the serial port. I had to > upgrade the ftdi vcp driver on my pc and the old sun commapi no longer > works with hardware flow control. as an experiment I replaced the > javax.com with gnu.io in the SerialDemo.java project that was included > with the commapi. This compiled fine using JBuilder 2006 and JRE > 1.5.0_05. RXTX also works with the latest ftdi drivers so life is > wonderful again... almost... > > When using the commapi jar the SerialDemo program starts in about 1 > second on my system. Using the RXTX jar it takes over 56 seconds to > start. Has anyone else seen this problem? Is there a workaround to get > the startup performance close to the old commapi? > > The last thing printed to the console before this delay is: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Thanks for your time! > > Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------- Just a student, Still a student ------------------------------- From yhua537 at cse.unsw.edu.au Sat May 27 06:04:26 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 22:04:26 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: Sorry, I don't think you could understand what I mean .I mean this: Without any detail about what your program is doing during that 56 seconds, it is hard for anyone to target the problem. On Sat, 27 May 2006, YiQi Huang wrote: > hi Doug > > The archive hasn't been update for a long time, But people certainly still > reading the list. > > I don't have enough experience to help on your problem, but without any > detail about what your problem doing during that 56 seconds, it is hard to > target the your question, I think. > > cheers > YiQi > > On Fri, 26 May 2006, Doug Thistlethwaite wrote: > >> Hello, >> >> I hope there are people still reading this mailing list. The archive >> appeared to not have anything new after 4/2005. >> >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From jredman at ergotech.com Sat May 27 08:32:02 2006 From: jredman at ergotech.com (Jim Redman) Date: Sat, 27 May 2006 08:32:02 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: <447862E2.4080506@ergotech.com> Doug, Since you mentioned it, we have a system that is also seems slow. From memory (I don't have one of the slow systems around), I'm not sure that it's consistent, it seems that sometimes it may take longer than others. Since it's part of the bootup it hasn't raised a flag and I haven't researched it. The same code runs much faster on other systems, so now you've got me wondering what's different. The slow system boots DSL (http://www.damnsmalllinux.org/) from a compact flash. FC4 is on my desktop where I haven't noticed a slow down. I think that the rxtx code is the same in both cases with lock files disabled. The slow system has a bunch of serial ports defined, including 4 USB serial ports that do not exist - they are not plugged in. Any clues in there? Jim > On Fri, 26 May 2006, Doug Thistlethwaite wrote: >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Sat May 27 10:41:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 May 2006 10:41:54 -0600 (MDT) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447862E2.4080506@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: On Sat, 27 May 2006, Jim Redman wrote: > Doug, > > Since you mentioned it, we have a system that is also seems slow. From > memory (I don't have one of the slow systems around), I'm not sure that > it's consistent, it seems that sometimes it may take longer than others. > Since it's part of the bootup it hasn't raised a flag and I haven't > researched it. > > The same code runs much faster on other systems, so now you've got me > wondering what's different. > > The slow system boots DSL (http://www.damnsmalllinux.org/) from a > compact flash. FC4 is on my desktop where I haven't noticed a slow > down. I think that the rxtx code is the same in both cases with lock > files disabled. > > The slow system has a bunch of serial ports defined, including 4 USB > serial ports that do not exist - they are not plugged in. > > Any clues in there? > rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. When it does this, it will try to open each port and do a timed out read. most systems will not have entries in device if the port is not there. But some minimal systems will just put all the device files there in case hardware is added. The list of devices scanned used to be ~10-20 times longer than it is today. That was getting very slow. I suspect moving the device files not used to a backup directory would increase the enumeration. I'll look into why the mail-list archive is not updating. The last update was about when I thought I 'fixed' the cron jobs. I probably didn't actually fix it but rather moved the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon May 29 19:46:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 May 2006 19:46:47 -0600 (MDT) Subject: [Rxtx] Mail-List Archives are updating. Message-ID: It was pointed out earlier that the archive is dated. This was a missing crontab entry. The list is currently archived by the week on the web page. It is updated once a day. So every 7 days it starts a new link and updates it daily. I've been limited in what I could do while my cable modem was disconnected this last week. rxtx.org is something I do on my own time. The patches and credits will be comming next. Many of these can be seen in bugzilla right now. -- Trent Jarvi tjarvi at qbang.org From doug at dupreeinc.com Tue May 30 11:18:41 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 10:18:41 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: <447C7E71.4080204@dupreeinc.com> Trent, YiQi, and Jim: Thanks to all for the replies and information! I am just back from a long weekend and I am now trying to figure out what I was doing! :) As for more information. First off, this example is being run under windows XP. I am developing test equipment that communicates with a java application via a serial port. I have been using the commapi for several years and have not had a problem. Recently, I have started a design modification that will replace the RS232 connection with a USB port. I am using the ftdi module for prototyping and I discovered that their virtual com port driver was not compatible with the commapi that Sun released. It turns out that it has problems with hardware flow control ( it works on incoming but not outgoing communications). The way I figured this out was by experimenting with the SerialDemo that was included with the Sum commapi. One nice thing about this example is it has the ability to set incoming and outgoing flow control independently. After I installed RXTX into my JBuilder 2006 IDE, I just replaced all all instances of javax.comm with gnu.io and it compiled and runs without a hitch (except for the slow startup). I Paused the JBuilder IDE during this long pause and the last few entries in the stack trace are: testRead() : -1, gnu.io.RXTXCommDriver registerValidPorts() : 255, gnu.io.RXTXCommDriver registerScannedPorts() : 777, gnu.io.RXTXCommDriver This was all initiated by the following call in the programs init routine: Enumeration en = CommPortIdentifier.getPortIdentifiers(); After looking at this, My guess is that Trent is correct in that the delay is in scanning for ports. I guess one solution would be to not scan for ports, though it would be nice to detect what is available on the system. Is there any way to reduce the number of ports scanned by this function in windows XP? Thanks again for your time, Doug Trent Jarvi wrote: >On Sat, 27 May 2006, Jim Redman wrote: > > > >>Doug, >> >>Since you mentioned it, we have a system that is also seems slow. From >>memory (I don't have one of the slow systems around), I'm not sure that >>it's consistent, it seems that sometimes it may take longer than others. >>Since it's part of the bootup it hasn't raised a flag and I haven't >>researched it. >> >>The same code runs much faster on other systems, so now you've got me >>wondering what's different. >> >>The slow system boots DSL (http://www.damnsmalllinux.org/) from a >>compact flash. FC4 is on my desktop where I haven't noticed a slow >>down. I think that the rxtx code is the same in both cases with lock >>files disabled. >> >>The slow system has a bunch of serial ports defined, including 4 USB >>serial ports that do not exist - they are not plugged in. >> >>Any clues in there? >> >> >> > >rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. > >When it does this, it will try to open each port and do a timed out read. >most systems will not have entries in device if the port is not there. >But some minimal systems will just put all the device files there in case >hardware is added. > >The list of devices scanned used to be ~10-20 times longer than it is >today. That was getting very slow. > >I suspect moving the device files not used to a backup directory would >increase the enumeration. > >I'll look into why the mail-list archive is not updating. The last update >was about when I thought I 'fixed' the cron jobs. I probably didn't >actually fix it but rather moved the problem. > >-- >Trent Jarvi >tjarvi at qbang.org > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/86796453/attachment-0391.html From doug at dupreeinc.com Tue May 30 14:36:09 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 13:36:09 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447C7E71.4080204@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com> Message-ID: <447CACB9.1000801@dupreeinc.com> Hello all, I also notice this pause (not as long however) when I call: CommPortIdentifier.getPortIdentifier(PortName); I would think that if I supply the name of the port, it would not have to go through the same discovery process. If you have any ideas of how to get rid of this startup delay, I would really appreciate it. Thanks, Doug Doug Thistlethwaite wrote: > Trent, YiQi, and Jim: > > Thanks to all for the replies and information! I am just back from a > long weekend and I am now trying to figure out what I was doing! :) > > As for more information. First off, this example is being run under > windows XP. I am developing test equipment that communicates with a > java application via a serial port. I have been using the commapi for > several years and have not had a problem. Recently, I have started a > design modification that will replace the RS232 connection with a USB > port. I am using the ftdi module for prototyping and I discovered > that their virtual com port driver was not compatible with the commapi > that Sun released. It turns out that it has problems with hardware > flow control ( it works on incoming but not outgoing communications). > The way I figured this out was by experimenting with the SerialDemo > that was included with the Sum commapi. One nice thing about this > example is it has the ability to set incoming and outgoing flow > control independently. > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup). > > I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are: > > testRead() : -1, gnu.io.RXTXCommDriver > registerValidPorts() : 255, gnu.io.RXTXCommDriver > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > This was all initiated by the following call in the programs init routine: > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > After looking at this, My guess is that Trent is correct in that the > delay is in scanning for ports. I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system. Is there any way to reduce the number of ports scanned by > this function in windows XP? > > Thanks again for your time, > > Doug > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/edaa5c3c/attachment-0391.html From lynn at swcp.com Tue May 30 15:07:18 2006 From: lynn at swcp.com (lynn@swcp.com) Date: Tue, 30 May 2006 21:07:18 -0000 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CACB9.1000801@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: *IF* the name of the port is supplied, we might want to use the preferences mechanism (java.util.prefs) where we could have previously saved the info for the port. We could do a quick check to see that things have not changed before using it. If things have changed (or never been defined) we would do a full port scan and save detected ports in the preferences. This way if the hardware is not changed, you only pay the time penalty one time. just an idea... Lynn Doug Thistlethwaite said: > This is a multi-part message in MIME format. > --------------070808020900080005070500 > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > Content-Transfer-Encoding: 7bit > > Hello all, > > I also notice this pause (not as long however) when I call: > > CommPortIdentifier.getPortIdentifier(PortName); > > I would think that if I supply the name of the port, it would not have > to go through the same discovery process. If you have any ideas of how > to get rid of this startup delay, I would really appreciate it. > > Thanks, > > Doug > > Doug Thistlethwaite wrote: > > > Trent, YiQi, and Jim: > > > > Thanks to all for the replies and information! I am just back from a > > long weekend and I am now trying to figure out what I was doing! :) > > > > As for more information. First off, this example is being run under > > windows XP. I am developing test equipment that communicates with a > > java application via a serial port. I have been using the commapi for > > several years and have not had a problem. Recently, I have started a > > design modification that will replace the RS232 connection with a USB > > port. I am using the ftdi module for prototyping and I discovered > > that their virtual com port driver was not compatible with the commapi > > that Sun released. It turns out that it has problems with hardware > > flow control ( it works on incoming but not outgoing communications). > > The way I figured this out was by experimenting with the SerialDemo > > that was included with the Sum commapi. One nice thing about this > > example is it has the ability to set incoming and outgoing flow > > control independently. > > > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > > all instances of javax.comm with gnu.io and it compiled and runs > > without a hitch (except for the slow startup). > > > > I Paused the JBuilder IDE during this long pause and the last few > > entries in the stack trace are: > > > > testRead() : -1, gnu.io.RXTXCommDriver > > registerValidPorts() : 255, gnu.io.RXTXCommDriver > > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > > > This was all initiated by the following call in the programs init routine: > > > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > > > After looking at this, My guess is that Trent is correct in that the > > delay is in scanning for ports. I guess one solution would be to not > > scan for ports, though it would be nice to detect what is available on > > the system. Is there any way to reduce the number of ports scanned by > > this function in windows XP? > > > > Thanks again for your time, > > > > Doug > > > > --------------070808020900080005070500 > Content-Type: text/html; charset=ISO-8859-1 > Content-Transfer-Encoding: 7bit > > > > > > > > > Hello all,
>
> I also notice this pause (not as long however) when I call:
>
>          CommPortIdentifier.getPortIdentifier(PortName);
>
> I would think that if I supply the name of the port, it would not have > to go through the same discovery process.  If you have any ideas of how > to get rid of this startup delay, I would really appreciate it.
>
> Thanks,
>
> Doug
>
> Doug Thistlethwaite wrote: >
> > Trent, YiQi, and Jim:
>
> Thanks to all for the replies and information!  I am just back from a > long weekend and I am now trying to figure out what I was doing! :)
>
> As for more information.  First off, this example is being run under > windows XP.  I am developing test equipment that communicates with a > java application via a serial port.  I have been using the commapi for > several years and have not had a problem.  Recently, I have started a > design modification that will replace the RS232 connection with a USB > port.  I am using the ftdi module for prototyping and I discovered that > their virtual com port driver was not compatible with the commapi that > Sun released.  It turns out that it has problems with hardware flow > control ( it works on incoming but not outgoing communications).  The > way I figured this out was by experimenting with the SerialDemo that > was included with the Sum commapi.  One nice thing about this example > is it has the ability to set incoming and outgoing flow control > independently.
>
> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup).
>
> I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are:
>
> testRead() : -1, gnu.io.RXTXCommDriver
> registerValidPorts() : 255, gnu.io.RXTXCommDriver
> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>
> This was all initiated by the following call in the programs init > routine:
>
> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>
> After looking at this,  My guess is that Trent is correct in that the > delay is in scanning for ports.  I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system.  Is there any way to reduce the number of ports scanned by > this function in windows XP? 
>
> Thanks again for your time,
>
> Doug
>
>
> > > > --------------070808020900080005070500-- > -- From jredman at ergotech.com Tue May 30 15:42:35 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 30 May 2006 15:42:35 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: <447CBC4B.2080206@ergotech.com> Lynn, If I understand your idea correctly, I don't think that this would work well for, say, USB ports since these can be easily added/removed by the end user. Jim lynn at swcp.com wrote: > *IF* the name of the port is supplied, we might want to use the preferences > mechanism (java.util.prefs) where we could have previously saved the info for > the port. We could do a quick check to see that things have not changed > before using it. If things have changed (or never been defined) we would do a > full port scan and save detected ports in the preferences. > > This way if the hardware is not changed, you only pay the time penalty one time. > > just an idea... > Lynn > > > Doug Thistlethwaite said: > >> This is a multi-part message in MIME format. >> --------------070808020900080005070500 >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >> Content-Transfer-Encoding: 7bit >> >> Hello all, >> >> I also notice this pause (not as long however) when I call: >> >> CommPortIdentifier.getPortIdentifier(PortName); >> >> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process. If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it. >> >> Thanks, >> >> Doug >> >> Doug Thistlethwaite wrote: >> >>> Trent, YiQi, and Jim: >>> >>> Thanks to all for the replies and information! I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :) >>> >>> As for more information. First off, this example is being run under >>> windows XP. I am developing test equipment that communicates with a >>> java application via a serial port. I have been using the commapi for >>> several years and have not had a problem. Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port. I am using the ftdi module for prototyping and I discovered >>> that their virtual com port driver was not compatible with the commapi >>> that Sun released. It turns out that it has problems with hardware >>> flow control ( it works on incoming but not outgoing communications). >>> The way I figured this out was by experimenting with the SerialDemo >>> that was included with the Sum commapi. One nice thing about this >>> example is it has the ability to set incoming and outgoing flow >>> control independently. >>> >>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup). >>> >>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are: >>> >>> testRead() : -1, gnu.io.RXTXCommDriver >>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>> >>> This was all initiated by the following call in the programs init routine: >>> >>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>> >>> After looking at this, My guess is that Trent is correct in that the >>> delay is in scanning for ports. I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system. Is there any way to reduce the number of ports scanned by >>> this function in windows XP? >>> >>> Thanks again for your time, >>> >>> Doug >>> >> --------------070808020900080005070500 >> Content-Type: text/html; charset=ISO-8859-1 >> Content-Transfer-Encoding: 7bit >> >> >> >> >> >> >> >> >> Hello all,
>>
>> I also notice this pause (not as long however) when I call:
>>
>>         >  CommPortIdentifier.getPortIdentifier(PortName);
>>
>> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process.  If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it.
>>
>> Thanks,
>>
>> Doug
>>
>> Doug Thistlethwaite wrote: >>
>> >> Trent, YiQi, and Jim:
>>
>> Thanks to all for the replies and information!  I am just back from a >> long weekend and I am now trying to figure out what I was doing! :)
>>
>> As for more information.  First off, this example is being run under >> windows XP.  I am developing test equipment that communicates with a >> java application via a serial port.  I have been using the commapi for >> several years and have not had a problem.  Recently, I have started a >> design modification that will replace the RS232 connection with a USB >> port.  I am using the ftdi module for prototyping and I discovered that >> their virtual com port driver was not compatible with the commapi that >> Sun released.  It turns out that it has problems with hardware flow >> control ( it works on incoming but not outgoing communications).  The >> way I figured this out was by experimenting with the SerialDemo that >> was included with the Sum commapi.  One nice thing about this example >> is it has the ability to set incoming and outgoing flow control >> independently.
>>
>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >> all instances of javax.comm with gnu.io and it compiled and runs >> without a hitch (except for the slow startup).
>>
>> I Paused the JBuilder IDE during this long pause and the last few >> entries in the stack trace are:
>>
>> testRead() : -1, gnu.io.RXTXCommDriver
>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>
>> This was all initiated by the following call in the programs init >> routine:
>>
>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>
>> After looking at this,  My guess is that Trent is correct in that the >> delay is in scanning for ports.  I guess one solution would be to not >> scan for ports, though it would be nice to detect what is available on >> the system.  Is there any way to reduce the number of ports scanned by >> this function in windows XP? 
>>
>> Thanks again for your time,
>>
>> Doug
>>
>>
>> >> >> >> --------------070808020900080005070500-- >> > > > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From yhua537 at cse.unsw.edu.au Tue May 30 18:10:23 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 31 May 2006 10:10:23 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CBC4B.2080206@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: Doug, In the SerialDemo, it allow us to save the parameters into a file, and use it when your program start up. Would this help? YiQi On Tue, 30 May 2006, Jim Redman wrote: > Lynn, > > If I understand your idea correctly, I don't think that this would work > well for, say, USB ports since these can be easily added/removed by the > end user. > > Jim > > lynn at swcp.com wrote: >> *IF* the name of the port is supplied, we might want to use the preferences >> mechanism (java.util.prefs) where we could have previously saved the info for >> the port. We could do a quick check to see that things have not changed >> before using it. If things have changed (or never been defined) we would do a >> full port scan and save detected ports in the preferences. >> >> This way if the hardware is not changed, you only pay the time penalty one time. >> >> just an idea... >> Lynn >> >> >> Doug Thistlethwaite said: >> >>> This is a multi-part message in MIME format. >>> --------------070808020900080005070500 >>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>> Content-Transfer-Encoding: 7bit >>> >>> Hello all, >>> >>> I also notice this pause (not as long however) when I call: >>> >>> CommPortIdentifier.getPortIdentifier(PortName); >>> >>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process. If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it. >>> >>> Thanks, >>> >>> Doug >>> >>> Doug Thistlethwaite wrote: >>> >>>> Trent, YiQi, and Jim: >>>> >>>> Thanks to all for the replies and information! I am just back from a >>>> long weekend and I am now trying to figure out what I was doing! :) >>>> >>>> As for more information. First off, this example is being run under >>>> windows XP. I am developing test equipment that communicates with a >>>> java application via a serial port. I have been using the commapi for >>>> several years and have not had a problem. Recently, I have started a >>>> design modification that will replace the RS232 connection with a USB >>>> port. I am using the ftdi module for prototyping and I discovered >>>> that their virtual com port driver was not compatible with the commapi >>>> that Sun released. It turns out that it has problems with hardware >>>> flow control ( it works on incoming but not outgoing communications). >>>> The way I figured this out was by experimenting with the SerialDemo >>>> that was included with the Sum commapi. One nice thing about this >>>> example is it has the ability to set incoming and outgoing flow >>>> control independently. >>>> >>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>> all instances of javax.comm with gnu.io and it compiled and runs >>>> without a hitch (except for the slow startup). >>>> >>>> I Paused the JBuilder IDE during this long pause and the last few >>>> entries in the stack trace are: >>>> >>>> testRead() : -1, gnu.io.RXTXCommDriver >>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>> >>>> This was all initiated by the following call in the programs init routine: >>>> >>>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>> >>>> After looking at this, My guess is that Trent is correct in that the >>>> delay is in scanning for ports. I guess one solution would be to not >>>> scan for ports, though it would be nice to detect what is available on >>>> the system. Is there any way to reduce the number of ports scanned by >>>> this function in windows XP? >>>> >>>> Thanks again for your time, >>>> >>>> Doug >>>> >>> --------------070808020900080005070500 >>> Content-Type: text/html; charset=ISO-8859-1 >>> Content-Transfer-Encoding: 7bit >>> >>> >>> >>> >>> >>> >>> >>> >>> Hello all,
>>>
>>> I also notice this pause (not as long however) when I call:
>>>
>>>         >>  CommPortIdentifier.getPortIdentifier(PortName);
>>>
>>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process.  If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it.
>>>
>>> Thanks,
>>>
>>> Doug
>>>
>>> Doug Thistlethwaite wrote: >>>
>>> >>> Trent, YiQi, and Jim:
>>>
>>> Thanks to all for the replies and information!  I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :)
>>>
>>> As for more information.  First off, this example is being run under >>> windows XP.  I am developing test equipment that communicates with a >>> java application via a serial port.  I have been using the commapi for >>> several years and have not had a problem.  Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port.  I am using the ftdi module for prototyping and I discovered that >>> their virtual com port driver was not compatible with the commapi that >>> Sun released.  It turns out that it has problems with hardware flow >>> control ( it works on incoming but not outgoing communications).  The >>> way I figured this out was by experimenting with the SerialDemo that >>> was included with the Sum commapi.  One nice thing about this example >>> is it has the ability to set incoming and outgoing flow control >>> independently.
>>>
>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup).
>>>
>>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are:
>>>
>>> testRead() : -1, gnu.io.RXTXCommDriver
>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>
>>> This was all initiated by the following call in the programs init >>> routine:
>>>
>>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>
>>> After looking at this,  My guess is that Trent is correct in that the >>> delay is in scanning for ports.  I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system.  Is there any way to reduce the number of ports scanned by >>> this function in windows XP? 
>>>
>>> Thanks again for your time,
>>>
>>> Doug
>>>
>>>
>>> >>> >>> >>> --------------070808020900080005070500-- >>> >> >> >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From halbleib at rechnerbetriebsgruppe.de Wed May 31 02:06:16 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 10:06:16 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp Message-ID: <447D4E78.30302@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, I getting an error while reloading my app in tomcat. At the first start everything runs well, but if i reload mit webapp by tomcat manager i get the following error. java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader Is there a possibility to unload the native library rxtxSerial.dll? thx for all help! regards tom -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 b8FT80HQ1xlbDLnRecDANCc= =heb1 -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 02:52:17 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 10:52:17 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D4E78.30302@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> Message-ID: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Hello Tom, To the best of my knowledge it is impossible to unload native libraries once loaded into the JVM. The exception you see stems from the fact, that Tomcat creates a new classloader when you "reload" the weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar is loaded from the session class loader. Try to add RXTXComm.jar to your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. Regards, Joachim On 31.05.2006, at 10:06, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 > b8FT80HQ1xlbDLnRecDANCc= > =heb1 > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From halbleib at rechnerbetriebsgruppe.de Wed May 31 03:28:35 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 11:28:35 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Message-ID: <447D61C3.1030807@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Joachim, I'm still not getting it. How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml-file? Perhaps web.xml? Regards, Tom Joachim Buechse schrieb: > Hello Tom, > > To the best of my knowledge it is impossible to unload native > libraries once loaded into the JVM. The exception you see stems from > the fact, that Tomcat creates a new classloader when you "reload" the > weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar > is loaded from the session class loader. Try to add RXTXComm.jar to > your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. > > Regards, > Joachim > > On 31.05.2006, at 10:06, Tom Halbleib wrote: > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL tzNy+/0iIUfkYYgt1+UT1ko= =pkpY -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 04:03:42 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 12:03:42 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D61C3.1030807@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> <447D61C3.1030807@rechnerbetriebsgruppe.de> Message-ID: -Xbootclasspath/a: is a start option to the java vm. Google is your friend in finding how to modfiy it and what it means: tomcat modifying bootclasspath Regards, Joachim On 31.05.2006, at 11:28, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Joachim, > > I'm still not getting it. > How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml- > file? > Perhaps web.xml? > > Regards, > Tom > > Joachim Buechse schrieb: >> Hello Tom, >> >> To the best of my knowledge it is impossible to unload native >> libraries once loaded into the JVM. The exception you see stems from >> the fact, that Tomcat creates a new classloader when you "reload" the >> weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar >> is loaded from the session class loader. Try to add RXTXComm.jar to >> your bootlclasspath (-Xbootclasspath/a:) and the problem should go >> away. >> >> Regards, >> Joachim >> >> On 31.05.2006, at 10:06, Tom Halbleib wrote: >> >> Hi all, >> >> I getting an error while reloading my app in tomcat. At the first >> start >> everything runs well, but if i reload mit webapp by tomcat manager >> i get >> the following error. >> >> java.lang.UnsatisfiedLinkError: Native Library >> C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in >> another classloader thrown while loading gnu.io.RXTXCommDriver >> Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: >> Native >> Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already >> loaded >> in another classloader >> >> >> Is there a possibility to unload the native library rxtxSerial.dll? >> >> thx for all help! >> >> regards >> >> tom > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL > tzNy+/0iIUfkYYgt1+UT1ko= > =pkpY > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From impakt01 at optusnet.com.au Wed May 31 06:55:42 2006 From: impakt01 at optusnet.com.au (Daren) Date: Wed, 31 May 2006 22:55:42 +1000 Subject: [Rxtx] (no subject) Message-ID: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/ade7ad37/attachment-0391.html From doug at dupreeinc.com Wed May 31 10:19:19 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 31 May 2006 09:19:19 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: <447DC207.3070702@dupreeinc.com> I am not sure what you are saying. The Save parameters menu option saves the current settings (baud, data bits, etc.). The long pause (~60 seconds) is when the application first starts (before loading the saved parameters). This does bring up a question, though I hate this type of kludge approach to getting this library to work... What exactly is a PortIdentifier? Is it always the same? If I stored the results from "CommPortIdentifier.getPortIdentifier(PortName);" in a file, could I use this the next time the program is executed? In this case I am using a virtual com port driver to connect to the device through a USB port. Doug YiQi Huang wrote: >Doug, > >In the SerialDemo, it allow us to save the parameters into a file, and use >it when your program start up. Would this help? > >YiQi > >On Tue, 30 May 2006, Jim Redman wrote: > > > >>Lynn, >> >>If I understand your idea correctly, I don't think that this would work >>well for, say, USB ports since these can be easily added/removed by the >>end user. >> >>Jim >> >>lynn at swcp.com wrote: >> >> >>>*IF* the name of the port is supplied, we might want to use the preferences >>>mechanism (java.util.prefs) where we could have previously saved the info for >>>the port. We could do a quick check to see that things have not changed >>>before using it. If things have changed (or never been defined) we would do a >>>full port scan and save detected ports in the preferences. >>> >>>This way if the hardware is not changed, you only pay the time penalty one time. >>> >>>just an idea... >>>Lynn >>> >>> >>>Doug Thistlethwaite said: >>> >>> >>> >>>>This is a multi-part message in MIME format. >>>>--------------070808020900080005070500 >>>>Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>>>Content-Transfer-Encoding: 7bit >>>> >>>>Hello all, >>>> >>>>I also notice this pause (not as long however) when I call: >>>> >>>> CommPortIdentifier.getPortIdentifier(PortName); >>>> >>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process. If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it. >>>> >>>>Thanks, >>>> >>>>Doug >>>> >>>>Doug Thistlethwaite wrote: >>>> >>>> >>>> >>>>>Trent, YiQi, and Jim: >>>>> >>>>>Thanks to all for the replies and information! I am just back from a >>>>>long weekend and I am now trying to figure out what I was doing! :) >>>>> >>>>>As for more information. First off, this example is being run under >>>>>windows XP. I am developing test equipment that communicates with a >>>>>java application via a serial port. I have been using the commapi for >>>>>several years and have not had a problem. Recently, I have started a >>>>>design modification that will replace the RS232 connection with a USB >>>>>port. I am using the ftdi module for prototyping and I discovered >>>>>that their virtual com port driver was not compatible with the commapi >>>>>that Sun released. It turns out that it has problems with hardware >>>>>flow control ( it works on incoming but not outgoing communications). >>>>>The way I figured this out was by experimenting with the SerialDemo >>>>>that was included with the Sum commapi. One nice thing about this >>>>>example is it has the ability to set incoming and outgoing flow >>>>>control independently. >>>>> >>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>>without a hitch (except for the slow startup). >>>>> >>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>>entries in the stack trace are: >>>>> >>>>>testRead() : -1, gnu.io.RXTXCommDriver >>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>>> >>>>>This was all initiated by the following call in the programs init routine: >>>>> >>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>>> >>>>>After looking at this, My guess is that Trent is correct in that the >>>>>delay is in scanning for ports. I guess one solution would be to not >>>>>scan for ports, though it would be nice to detect what is available on >>>>>the system. Is there any way to reduce the number of ports scanned by >>>>>this function in windows XP? >>>>> >>>>>Thanks again for your time, >>>>> >>>>>Doug >>>>> >>>>> >>>>> >>>>--------------070808020900080005070500 >>>>Content-Type: text/html; charset=ISO-8859-1 >>>>Content-Transfer-Encoding: 7bit >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>>Hello all,
>>>>
>>>>I also notice this pause (not as long however) when I call:
>>>>
>>>>        >>>> >>>> >>> CommPortIdentifier.getPortIdentifier(PortName);
>>> >>> >>>>
>>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process.  If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it.
>>>>
>>>>Thanks,
>>>>
>>>>Doug
>>>>
>>>>Doug Thistlethwaite wrote: >>>>
>>>> >>>>Trent, YiQi, and Jim:
>>>>
>>>>Thanks to all for the replies and information!  I am just back from a >>>>long weekend and I am now trying to figure out what I was doing! :)
>>>>
>>>>As for more information.  First off, this example is being run under >>>>windows XP.  I am developing test equipment that communicates with a >>>>java application via a serial port.  I have been using the commapi for >>>>several years and have not had a problem.  Recently, I have started a >>>>design modification that will replace the RS232 connection with a USB >>>>port.  I am using the ftdi module for prototyping and I discovered that >>>>their virtual com port driver was not compatible with the commapi that >>>>Sun released.  It turns out that it has problems with hardware flow >>>>control ( it works on incoming but not outgoing communications).  The >>>>way I figured this out was by experimenting with the SerialDemo that >>>>was included with the Sum commapi.  One nice thing about this example >>>>is it has the ability to set incoming and outgoing flow control >>>>independently.
>>>>
>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>without a hitch (except for the slow startup).
>>>>
>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>entries in the stack trace are:
>>>>
>>>>testRead() : -1, gnu.io.RXTXCommDriver
>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>>
>>>>This was all initiated by the following call in the programs init >>>>routine:
>>>>
>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>>
>>>>After looking at this,  My guess is that Trent is correct in that the >>>>delay is in scanning for ports.  I guess one solution would be to not >>>>scan for ports, though it would be nice to detect what is available on >>>>the system.  Is there any way to reduce the number of ports scanned by >>>>this function in windows XP? 
>>>>
>>>>Thanks again for your time,
>>>>
>>>>Doug
>>>>
>>>>
>>>> >>>> >>>> >>>>--------------070808020900080005070500-- >>>> >>>> >>>> >>> >>> >>> >>-- >>Jim Redman >>(505) 662 5156 x85 >>http://www.ergotech.com >>_______________________________________________ >>Rxtx mailing list >>Rxtx at qbang.org >>http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > >cheers >YiQi Huang >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/61d4d4c9/attachment-0390.html From impakt01 at optusnet.com.au Wed May 31 17:02:54 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 09:02:54 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Message-ID: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Hi all, I downloaded 2.1.7-pre16 and managed to build it and get it going. I made the changes as suggested by Peter Smith in an old post, by adding his code to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. Still not working, it opens the port at 9600 according to portmon.exe . Has anyone managed to get this going at a custom rate? Here is the post I'm referring to: http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 Thanks, Daren ________________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Daren Sent: Wednesday, 31 May 2006 10:56 PM To: rxtx at qbang.org Subject: [Rxtx] (no subject) Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren From tjarvi at qbang.org Wed May 31 21:44:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 May 2006 21:44:01 -0600 (MDT) Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> References: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Message-ID: On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org From impakt01 at optusnet.com.au Wed May 31 22:06:04 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 14:06:04 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: Message-ID: <200606010406.k51464X2010447@mail03.syd.optusnet.com.au> Trent, I have managed to successfully open the port at this speed using Realterm (available on sourceforge). From memory this uses DLPortIO. Using portmon.exe with realterm, even there it says that the port has opened at 1953. I changed termios.c:560 to dcb->BaudRate = 1953 ; and it still opens the port at 9600. Daren -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Thursday, 1 June 2006 1:44 PM To: RXTX Developers and Users Subject: Re: [Rxtx] custom baud rate win32 On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From smontgomery at mediaspansoftware.com Mon May 1 09:52:28 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 11:52:28 -0400 Subject: [Rxtx] RXTX, Java COMM and Windows Server 2003 on x64 experiences? Message-ID: Just wondering if anybody here has had to deploy RXTX or the javax.comm on Windows Server 2003 machines running on x64 (i.e. Xeon EM64T) and would like to relate how things went. From Sun's site, the Supported System Configurations pages give the options for that system: Java 5.0: - 32-bit Java 5.0 running on the OS in the 32-bit mode - 64-bit Java 5.0 running on the OS in the 64-bit native mode Java 1.4.2: - no options listed for EM64T processors, but potentially the standard 32-bit Java 1.4.2 could run on the OS in 32-bit mode? I guess the two main points of failure would be 1) the JVM itself and 2) the jni components. Make that three: there's gotta be hardware vendor driver support for the OS in the various modes, too. Guess I better go look at Keyspan's website... Thanks in advance for any info anyone might be able to provide. From smontgomery at mediaspansoftware.com Mon May 1 10:18:33 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 12:18:33 -0400 Subject: [Rxtx] Mailing list archive out of date? Message-ID: The mailing list archive at: http://mailman.qbang.org/pipermail/rxtx/ only shows emails through the end of March. Is there a new archive somewhere else? Didn't see anything mentioned on the wiki. From p.cain at phasefale.com.au Mon May 1 22:33:09 2006 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 02 May 2006 14:33:09 +1000 Subject: [Rxtx] RXTX and the Linux kernel. Message-ID: <4456E105.5080106@phasefale.com.au> Hi, First off the problem I am having isn't caused by RXTX itself but I'm hoping someone out there may have some knowledge that may help me. Background: I have an application monitoring a control system through a standard PC serial port which I talk to with rxtx-2.0.5. The application runs on RedHat7.3 kernel version 2.4.18 using Java 1.4. This configuration has been in use for several years and has proved to be stable. But it has become necessary for me to upgrade the OS but I'm running into problems with the serial communications. Its not that the comms don't work on the new OS (its never that simple) the comms work for a variable period of time (sometimes several hours) and then just stop, nothing on the data lines and control lines all indicate that data could flow. The new OS is Ubuntu 5.10 running kernel version 2.6.12. I have installed the OS and software on a PC and had it perform ok, then install the new OS and same software on the very same hardware and experienced the problems of them comms stopping. In the new OS I'm using Java5 to run the app but since I have experience the problem I reverted back to Java1.4 which didn't fix the problem. I've moved the app to a different system RedHat FC3 running 2.6.14 had experienced the problem. Not wanting to go through all the thing I have tried but I have established that it seems to be the 2.6 versions of the kernel that seem to be the problem and not an individual distribution of Linux. I should point out that I am using the same jar and library files for each java and OS combination. So I'm just wondering if anyone has had or heard of problems similar to these ? Or perhaps might know of what changed in the Linux serial driver (something I'm having a hard time establishing). I'm starting to run low on ideas of what to try so any help would be much appreciated. -- Peter Cain Senior Programmer Phasefale Pty Ltd From tjarvi at qbang.org Wed May 3 07:31:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 May 2006 07:31:00 -0600 (MDT) Subject: [Rxtx] Re: Concering ircomm and RXTX In-Reply-To: References: Message-ID: On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From legolas.w at gmail.com Wed May 3 08:46:23 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 19:16:23 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <4458C23F.2000003@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From legolas.w at gmail.com Wed May 3 13:10:57 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 23:40:57 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <44590041.80706@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From Lars.Hennig at wow-portal.com Thu May 4 00:39:15 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Thu, 4 May 2006 08:39:15 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: Message-ID: Hi, I could not find any solution. I therefore decided to to my own native implementation. Allthough it only supports the functions I need, it works pretty well now for me. I think the main problem there is the use of a wrong Windows API function and not setting an timeout. Regards, Lars Hennig W?rth Online World GmbH Tel. (0049)7181-258183 Mob. (0049)160-3522889 Fax. (0049)7940-153299 Lars.Hennig at wow-portal.com Gesendet von: rxtx-bounces at qbang.org 09.04.2006 10:42 Bitte antworten zu RXTX Developers and Users An d.herwald at dsh-elektronik.de, RXTX Developers and Users Kopie Thema Re: [Rxtx] USB Serialport - disconnection problems WV Proj./Teilpr.: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/7b39f374/attachment-0395.html From Pawan.Kharbanda at dot.state.co.us Thu May 4 11:00:58 2006 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Thu, 4 May 2006 11:00:58 -0600 Subject: [Rxtx] Dangling Lock Files Message-ID: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Hi, I have been using RXTX API's for the Serial Communication for quite some time now and for some of the devices we are opening and closing the connection every 2 minutes. This works great for few days and then suddenly I start seeing some "Port in Use Exception" and I see that the Lock files are still in the /var/lock folder after manually removing the lock files it works good for few hours and I see the same problem again. Can somebody explain me the scenarios why I am seeing the dangling Lock files? I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise Servers. Thanks Pawan Kharbanda -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/ba0e9261/attachment-0395.html From tjarvi at qbang.org Thu May 4 14:10:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:10:30 -0600 (MDT) Subject: [Rxtx] Dangling Lock Files In-Reply-To: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> References: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Message-ID: On Thu, 4 May 2006, Kharbanda, Pawan wrote: > Hi, > I have been using RXTX API's for the Serial Communication for quite > some time now and for some of the devices we are opening and closing the > connection every 2 minutes. This works great for few days and then > suddenly I start seeing some "Port in Use Exception" and I see that the > Lock files are still in the /var/lock folder after manually removing the > lock files it works good for few hours and I see the same problem again. > Can somebody explain me the scenarios why I am seeing the dangling Lock > files? > > I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise > Servers. Hi Pawan The next time it happens, look in the lockfile. There will be a pid. ps aux |grep 'pid' I think you will see that the application is still running for some reason. RXTX does a kill -0 on the pid to see if its alive. If not, it will remove the lockfile. So I suspect the previous program did not exit as you expected. -- Trent Jarvi tjarvi at qbang.org From Scott.Hughes at dalsemi.com Thu May 4 14:23:11 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 4 May 2006 15:23:11 -0500 Subject: [Rxtx] Wiki instructions... Message-ID: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire demo apps, when I stumbled across this tip on the wiki to add yourself to the uucp group: It may be simpler to just run usermod -G uucp jarvi Taken from: http://rxtx.qbang.org/wiki/index.php/Installation This does not work as advertised. I should have read the man page for usermod before I tried that out. If there are any groups which are not listed after the -G switch, the user is removed from those groups. On Ubuntu, this is bad... I removed myself from the Admin group, which removed my sudo priviledges. Ubuntu has no root account, so I've disabled the only account which could fix it. Anyone know of a good workaround? Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor From tjarvi at qbang.org Thu May 4 14:32:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:32:09 -0600 (MDT) Subject: [Rxtx] Wiki instructions... In-Reply-To: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> Message-ID: On Thu, 4 May 2006, Scott Hughes wrote: > I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire > demo apps, when I stumbled across this tip on the wiki to add yourself to > the uucp group: > > It may be simpler to just run > > usermod -G uucp jarvi > > Taken from: > http://rxtx.qbang.org/wiki/index.php/Installation > > This does not work as advertised. I should have read the man page for > usermod before I tried that out. If there are any groups which are not > listed after the -G switch, the user is removed from those groups. On > Ubuntu, this is bad... I removed myself from the Admin group, which removed > my sudo priviledges. Ubuntu has no root account, so I've disabled the only > account which could fix it. > > Anyone know of a good workaround? > Yikes This will get your permissions back: in grub/lilo/.. pass the following option to the kernel init=/bin/sh You are now root. when it boots, mount -o remount,rw / add yourself to the groups, reboot to get normal init going. Thats about all I can think of without sudo/root. -- Trent Jarvi tjarvi at qbang.org From Gettings at earth.utah.edu Thu May 4 14:41:22 2006 From: Gettings at earth.utah.edu (Paul Gettings) Date: Thu, 4 May 2006 14:41:22 -0600 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <20060504204122.GA6534@earth.utah.edu> When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get messages on stdout from the JVM: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 As the only change was the version of RXTX (from 2.1.6), I am unsure why the messages suddenly appeared. Anyone know how to get rid of them? Thanks. -- 101 USES FOR A DEAD MICROPROCESSOR (23) Dead cat brush From mmester at sps.edu Mon May 1 21:22:28 2006 From: mmester at sps.edu (Michael Mester) Date: Mon, 1 May 2006 23:22:28 -0400 Subject: [Rxtx] Windows PortInUseException Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> I'm trying to get simple serial communication going with RxTx under Windows XP. I can enumerate the ports fine, but I always run into problems when I try to open one. I get a PortInUseException, but the owner application is "Unknown" and the port is never open. I've tried this on several different systems and all of them give the same behavior. The only thing I can thiunk of that might be causing the problem is that fact that I had to put the serial .dll file in system32 instead of the reccommended folder, because it didn't work in the folder the documentation gives. The library loads fine, though, so I'm not sure whether that makes sense, and I don't know how to fix it anyway. Any help is greatly appreciated. Below is the output of the program, right up to the PortInUseException and the NullPointerException it causes (because the serial port object is not instantiated). C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI Starting GPSTalkerGUI... Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 gnu.io.PortInUseException: Unknown Application Exception in thread "main" java.lang.NullPointerException at GPSTalkerGUI.(GPSTalkerGUI.java:102) at GPSTalkerGUI.main(GPSTalkerGUI.java:161) Again, thank you very much for any help you can give. From lshellman at qwest.net Wed May 3 01:38:34 2006 From: lshellman at qwest.net (Lucious Shellman) Date: Wed, 03 May 2006 01:38:34 -0600 Subject: [Rxtx] Help needed: Project using parallel port Message-ID: <1146641914.8337.14.camel@localhost.localdomain> I was looking for a way to access the parallel port on a PC using Java. Searching the Internet, I came across this site (rxtx.org). What I am trying to do is detect logic levels from a TTL logic IC on the parallel port. I am not trying to do classic parallel port communication. I just want to detect whether a line(s) is (are) high or low. I am using Windows 98. Can rxtx be used to do this? If yes, is there a tutorial for using rxtx posted on the Internet that someone can direct me to. If you need more information, feel free to e-mail me. Unfortunately for me, I need the information ASAP. Thanks. lshellman at qwest.net From webmaster at egyhelp.com Wed May 3 18:43:39 2006 From: webmaster at egyhelp.com (Mohamed Samy) Date: Thu, 4 May 2006 02:43:39 +0200 Subject: [Rxtx] RE: Concering ircomm and RXTX In-Reply-To: Message-ID: <20060503184362.SM01044@Geek> Hey, I issue the command "modprobe ircomm-tty" yet no ttyircomm appears, while the ircomm appear by "modprobe ircomm" so forgive me but I am bit lost. Even searching google for the keyword "ttyircomm" only returns 3 matches. So any way I can start the ttyircomm???? Thanks a lot. -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Wednesday, May 03, 2006 3:31 PM To: Mohamed Samy; rxtx at qbang.org Cc: taj at www.linux.org.uk Subject: Re: Concering ircomm and RXTX On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 4 15:49:49 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 15:49:49 -0600 (MDT) Subject: [Rxtx] Windows PortInUseException In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> Message-ID: On Mon, 1 May 2006, Michael Mester wrote: > > I'm trying to get simple serial communication going with RxTx under > Windows XP. I can enumerate the ports fine, but I always run into > problems when I try to open one. I get a PortInUseException, but the > owner application is "Unknown" and the port is never open. I've tried > this on several different systems and all of them give the same > behavior. The only thing I can thiunk of that might be causing the > problem is that fact that I had to put the serial .dll file in system32 > instead of the reccommended folder, because it didn't work in the folder > the documentation gives. The library loads fine, though, so I'm not sure > whether that makes sense, and I don't know how to fix it anyway. Any > help is greatly appreciated. Below is the output of the program, right > up to the PortInUseException and the NullPointerException it causes > (because the serial port object is not instantiated). > > C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI > Starting GPSTalkerGUI... > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > gnu.io.PortInUseException: Unknown Application > Exception in thread "main" java.lang.NullPointerException > at GPSTalkerGUI.(GPSTalkerGUI.java:102) > at GPSTalkerGUI.main(GPSTalkerGUI.java:161) > Perhaps you are trying to open the port twice in your code? rxtx does open the ports, do a timed out read and then close the ports during enumeration. I think the port is being opened fine. The Unknown Application is always reported. On linux, there is some code that finds the actual application but on windows, its always unknown. If the port enumeration is returning the ports you expect, rxtx has opened the port and closed it with success. The port should open. There is also example code in the contrib directory that comes with rxtx source that has examples you can modify to work. -- Trent Jarvi tjarvi at qbang.org From Christian.Klemke at t-online.de Thu May 4 23:37:23 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Fri, 5 May 2006 07:37:23 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu> Message-ID: <004f01c67005$fc72fee0$016a10ac@NB600> Hi Paul, I was wondering about the same question some days ago and took a look at the source files. Unfortunately, I found that you can only get rid of that messages by altering and recompiling the Java code. There is a final static boolean variable called "devel" in the file "RXTXCommDriver.java" which is set to "true". This constellation causes the output after the native libraries have been loaded. No mechanism exists to suppress them otherwise :-(. Trent, does that mean that 2.1.7 is still officially a "development" version ? When will this value be changed to "false" by default ? With 2.1.8 ? It would be nice to provide a means to suppress such messages besides that static flag (maybe by setting a property called "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The output can indeed by annoying, especially when used with console applications, where the message potentially appears "in the middle" of your own output. Another possibility would be not to use System.out directly, but instead some PrintStream field which is initially set to System.out but can programatically be changed. That would allow for any kind of redirection or suppression by implementing appropriate user-defined PrintStream subclasses and making RXTX use that stream. What do you think ? Best regards, Christian ----- Original Message ----- From: "Paul Gettings" To: Sent: Thursday, May 04, 2006 10:41 PM Subject: [Rxtx] RXTX causing stdout messages > When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get > messages on stdout from the JVM: > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > As the only change was the version of RXTX (from 2.1.6), I am unsure > why the messages suddenly appeared. Anyone know how to get rid of > them? > > Thanks. > > -- > 101 USES FOR A DEAD MICROPROCESSOR > (23) Dead cat brush > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri May 5 06:09:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 06:09:46 -0600 (MDT) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <004f01c67005$fc72fee0$016a10ac@NB600> References: <20060504204122.GA6534@earth.utah.edu> <004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: On Fri, 5 May 2006, Christian Klemke wrote: > Hi Paul, > > I was wondering about the same question some days ago and took a look at the > source files. Unfortunately, I found that you can only get rid of that > messages by altering and recompiling the Java code. There is a final static > boolean variable called "devel" in the file "RXTXCommDriver.java" which is > set to "true". This constellation causes the output after the native > libraries have been loaded. No mechanism exists to suppress them otherwise > :-(. > > Trent, does that mean that 2.1.7 is still officially a "development" version > ? When will this value be changed to "false" by default ? With 2.1.8 ? It > would be nice to provide a means to suppress such messages besides that > static flag (maybe by setting a property called > "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The > output can indeed by annoying, especially when used with console > applications, where the message potentially appears "in the middle" of your > own output. Another possibility would be not to use System.out directly, but > instead some PrintStream field which is initially set to System.out but can > programatically be changed. That would allow for any kind of redirection or > suppression by implementing appropriate user-defined PrintStream subclasses > and making RXTX use that stream. What do you think ? > A patch for using properties would be accepted I'm sure. The reason the default is to display the message is not related to the development state of rxtx anymore. The problem is that people first using rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. The message prevents a great deal of email thats easily explained by the message. I question if we should support rxtx 2.0 at all anymore. If you post a patch in bugzilla, we'll put it into CVS this weekend. we'll be going through and doing such things anyhow. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri May 5 13:23:56 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 13:23:56 -0600 (MDT) Subject: [Rxtx] How to read from RxTx parallel port in Win XP In-Reply-To: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> References: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> Message-ID: On Thu, 27 Apr 2006, Worsley, Bob (Development Engineer) wrote: > I'm sorry if this is a dumb question, but I didn't find the answer in > the archives. > > I'm using the RxTx binaries for Windows on a reasonably current notebook > PC running Windows XP. I can send stuff to a printer on the parallel > port (LPT1), but I can't get anything back. > > I wrote a class that has the methods listed below. I write some data to > the printer with the "write" method and then try to read a response > using the "read" method, but I never get any data. I'd greatly > appreciate any help you can give! > > Bob Worsley > bobwoyid2 at yahoo.com > > > > > private ParallelPort parallelPort = null; > private RXTXCommDriver parallelPortDriver = null; > > > public boolean initialize() throws IOException { > if (parallelPort != null) { > return false; // Already initialized > } > > // Create the parallel port; > parallelPortDriver = new RXTXCommDriver(); > parallelPort = > (ParallelPort)parallelPortDriver.getCommPort(address, > CommPortIdentifier.PORT_PARALLEL); > > // Set the parallel port parameters. > try { > parallelPort.enableReceiveTimeout(READ_TIMEOUT); > parallelPort.disableReceiveFraming(); > parallelPort.disableReceiveThreshold(); > //parallelPort.setMode(mode); !!!!errors > } catch (UnsupportedCommOperationException e) { > throw (new IOException("Parallel port with address '" + > address > + "' cannot be configured as specified")); > } > > return true; > } > > > > public void write(final byte[] bytes) throws IOException { > initialize(); > while (busyReading) { > Thread.yield(); > } > busyWriting = true; > if (bytes.length < 1) { > return; > } > OutputStream outputStream = parallelPort.getOutputStream(); > outputStream.write(bytes); > outputStream.flush(); > outputStream.close(); > Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); > busyWriting = false; > } > > > public byte[] read() throws IOException { > > // Read up to MAX_BYTES bytes. > initialize(); > while (busyWriting) { > Thread.yield(); > } > busyReading = true; > byte[] buff = new byte[MAX_BYTES_READ]; > InputStream inputStream = parallelPort.getInputStream(); > // This read blocks until input data is available > int bytesRead = inputStream.read(buff); > inputStream.close(); > // If no data read, create empty array > if (bytesRead == -1) { > bytesRead = 0; > } > byte[] deviceBytes = new byte[bytesRead]; > System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); > if (bytesRead > 0) { > Debug.p("PPIOP.read - got data: '" + new > String(deviceBytes) + "'"); > } > busyReading = false; > return deviceBytes; > } > Hi Bob I've only used rxtx to test a hello world page printing but there are others that have used it. PPIOP? hmm what is this? :) The rxtx parallel support is behind the serial support but should be OK. As you note, the setting of modes is not supported. rxtx uses what is provided when the port is open. Are your asserting the pin for the printer being online? I suspect what often happens is people try to just use the data pins but the C API rxtx uses wants the printer to be online. There should be some posts relating to this in the rxtx mail-list archive. Some APIs are probably reading and writing from the port address (also suggested in your code as something you are looking at). RXTX currently uses a higher level C/C++ API for port access. This can still work if the API thinks the 'printer' is there. -- Trent Jarvi tjarvi at qbang.org From agrodellic at gmail.com Sat May 6 08:39:40 2006 From: agrodellic at gmail.com (Leigh Stewart) Date: Sat, 6 May 2006 10:39:40 -0400 Subject: [Rxtx] sun commapi 3 Message-ID: I think I read here: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html that rxtx-2.0 is basically fracked for now? Does anyone know of a workaround? ie can i somehow get an older version of sun's comm api and use that (not easy to find)? i mean 2.0 must be working for someone...how is it being tested. 2.1 isnt working for me....im getting nasty native exceptions etc, which is why im so set on 2.0... any ideas? From tjarvi at qbang.org Sun May 7 15:40:27 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 7 May 2006 15:40:27 -0600 (MDT) Subject: [Rxtx] sun commapi 3 In-Reply-To: References: Message-ID: On Sat, 6 May 2006, Leigh Stewart wrote: > > 2.1 isnt working for me....im getting nasty native exceptions etc, > which is why im so set on 2.0... any ideas? > Hi Leigh What native exceptions are you seeing? Which OS? The native code is almost identical between rxtx 2.0 and 2.1. Only the names have been changed to protect the inocent. :) ie: javax_comm_... vs gnu_io_... So the odds are very likely that even if you do find commapi 2.0 and get it installed, you will run into the same error. It would be better to just find and fix the problem. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Mon May 8 10:47:20 2006 From: mail at willicon.de (WILLICon) Date: Mon, 08 May 2006 18:47:20 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 Message-ID: <445F7618.3070303@willicon.de> Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/ef37e8ec/attachment-0395.html From tjarvi at qbang.org Mon May 8 16:14:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 May 2006 16:14:51 -0600 (MDT) Subject: [Rxtx] Screenshot of Application using RXTX (fwd) Message-ID: Just though someone may end up searching for 0x0D and 0x0A. Here are the details from his system. SuSE Linux 10.0 (x86_64) Kernel 2.6.13-15.8 j2se 1.4.2_11 (i586) Sun: comm3.0_u1 rxtx: rxtx-2.1-7 ---------- Forwarded message ---------- Date: Sat, 6 May 2006 20:01:46 +0200 From: Michael Poppitz To: taj at www.linux.org.uk Subject: Screenshot of Application using RXTX Hi Trent, the rxtx package works like a charm. Sun's package seemed to replace all 0x0D with 0x0A in received data on my Linux box, which is really annoying when transfering binary data. But rxtx came and saved the day - and turned out to be a lot more convenient as it does not require a configuration file. I use it for connecting to a home made logic analyzer. (http://www.sump.org/projects/analyzer/) Thanks for your great job, Michael -------------- next part -------------- A non-text attachment was scrubbed... Name: la_client.png Type: image/png Size: 16592 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/45494fbb/la_client-0395.png From tjarvi at qbang.org Tue May 9 14:56:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 May 2006 14:56:05 -0600 (MDT) Subject: [Rxtx] RXTX javax.comm: which one to install? In-Reply-To: <20060509161742.43547.qmail@web53814.mail.yahoo.com> References: <20060509161742.43547.qmail@web53814.mail.yahoo.com> Message-ID: On Tue, 9 May 2006, Adenilson Cavalcanti wrote: > Dear Trent Jarvi > > I'm trying to write a small Java app running in linux that interfaces with a device connected to serial port. > > I do have some questions about RXTX and javax.comm state of affairs, since I'm new to Java programming (used to program in plain old C writting to devices using termios and open/write/read syscalls, but this is another story). > > I ask you the favor to clarify this issues (if possible...): > > a) Sun offers to download a file (comm3.0_u1_PUTAUNIXVERSION.zip) which does contain .so files. Does it work out of box? > > b) Case negative, its there that we should use 'librxtx*.so' provided by your site? > > c) Sun's comm3 API version does work with which version of rxtx? > > I already searched google and read documentation available in rxtx site ("Java Comm Serial API How-to") but still have this issues unsolved. Any help will be appreciated. > > Best regards > > Adenilson Hi Adenilson, RXTX does not currently support javax.comm in Sun's CommAPI 3.0. I would recommend using package gnu.io provided by rxtx 2.1. -- Trent Jarvi tjarvi at qbang.org From chris.develder at intec.ugent.be Wed May 10 08:45:40 2006 From: chris.develder at intec.ugent.be (Chris Develder) Date: Wed, 10 May 2006 16:45:40 +0200 Subject: [Rxtx] rxtx troubles on ARM Message-ID: <4461FC94.6040909@intec.ugent.be> Hi all, Sorry to bother you, but I don't seem to get RXTX working on an ARM processor (xscale ixp 425, big endian). I managed to crosscompile the rxtx libs and moved it over to the ARM. Using jamvm (which is the only open source java VM we got working on the ARM), I get the following error result when running SimpleRead from Sun's javax.comm examples (commapi\examples\Simple\SimpleRead) -- see bottom of mail for complete output: "java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver" However, output shows that the RXTXCommDriver code is accessible (cf. debug and devel output of lib versions). So it doesn't seem to be a missing lib/jar issue. The error happens before RXTXCommDriver.initialize() is called, since the first line there is System.out.println("RXTXCommDriver:initialize()"); Any ideas? Cheers, Chris ---------------------------- [root at xxx(ttyp1) /work/cdvelder/xscale/test]# jamvm -Djava.library.path=/work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/jre/lib/arm -classpath /work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/lib/ext/RXTXcomm.jar:./comm.jar:. SimpleRead RXTXCommDriver {} Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTXCommDriver: Jar version = RXTX-2.1-7 native lib Version = RXTX-2.1-7 java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver gnu/io/RXTXCommDriver at javax.comm.CommPortIdentifier.loadDriver (CommPortIdentifier.java:239) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:109) at SimpleRead.main (Unknown Source) java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive (Native Method) at com.sun.comm.Portmapping.registerCommPorts (Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase (Portmapping.java:100) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:138) at SimpleRead.main (Unknown Source) From joachim at buechse.de Fri May 12 00:44:48 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 08:44:48 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) Message-ID: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Good day, I guess that only a selected few (hi Trent) will be able to answer this question, but the answer might be interesting for anyone trying to debug or understand the code. Apparently the MonitorThread is started and stopped in RXTXPort.addEventListener and RXTXPort.removeEventListener. This would indicate that (originally?) the MonitorThread is only required when there is an EventListener. However the MonitorThread is also started in the RXTXPort constructor, which could mean that RXTX won't work at all if it isn't there. It seems to me, that if anyone would add an event listener and later on remove it, he could potentially wreak the port. Because the second action would kill the MonitorThread. For the moment I am only trying to understand the role of and idea behind the MonitorThread. But of course there is a deeper reason thor my question: If the MonitorThread needs to exist anyway, it could be the thread that cleans up the port (ie calls nativeClose) - this would eliminate (a further) problem I am seeing with some USB drivers on Mac OSX. (Close blocks (after releasing the tty, but still) in the USB driver if the device is "not responding"). Greetings, Joachim From tjarvi at qbang.org Fri May 12 07:10:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 12 May 2006 07:10:59 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Fri, 12 May 2006, Joachim Buechse wrote: > Good day, > > I guess that only a selected few (hi Trent) will be able to answer > this question, but the answer might be interesting for anyone trying > to debug or understand the code. > > Apparently the MonitorThread is started and stopped in > RXTXPort.addEventListener and RXTXPort.removeEventListener. This > would indicate that (originally?) the MonitorThread is only required > when there is an EventListener. However the MonitorThread is also > started in the RXTXPort constructor, which could mean that RXTX won't > work at all if it isn't there. > > It seems to me, that if anyone would add an event listener and later > on remove it, he could potentially wreak the port. Because the second > action would kill the MonitorThread. > > > For the moment I am only trying to understand the role of and idea > behind the MonitorThread. But of course there is a deeper reason thor > my question: > > If the MonitorThread needs to exist anyway, it could be the thread > that cleans up the port (ie calls nativeClose) - this would eliminate > (a further) problem I am seeing with some USB drivers on Mac OSX. > (Close blocks (after releasing the tty, but still) in the USB driver > if the device is "not responding"). > Hi Jaochim Before commapi, rxtx did not support events. You could read, write and change port settings. The MonitorThread was added as an afterthought to support commapi events. So the way things are now his historical spaghetti not a well devised plan. It is my opinion that the MonitorThread should exist as long as the port is open. The odd starting of the thread in the constructor and addEventListener was just to get past the obvious problem of people using the port without adding listeners. -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Fri May 12 07:59:50 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 15:59:50 +0200 Subject: [Rxtx] MonitorThread -> ChangeRequest In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: <2B1E508C-8CEE-4AB7-914D-E7BA25C871A2@buechse.de> In this case I suggest removing the starting/stopping of MonitorThread in addEventListener / removeEventListener. This should not affect existing projects. On 12.05.2006, at 15:10, Trent Jarvi wrote: > It is my opinion that the MonitorThread should exist as long as the > port > is open. The odd starting of the thread in the constructor and > addEventListener was just to get past the obvious problem of people > using > the port without adding listeners. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Fri May 12 11:43:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 19:43:21 +0200 Subject: [Rxtx] Spring Cleaning - some suggestions Message-ID: The current implementation of RXTX contains quite a lot of code that will break if it is used from several threads (especially on a multi processor machine). I think it would be nice to clean this up. I suggest the following changes (which keep the current semantics and should not influence existing projects in a negative way): - InterruptedException will never be ignored or reset - read methods will be protected with a Monitor - write methods will be protected with a (separate) Monitor - close() sets the read and write monitors into a "closed" state which will lead to IOExceptions for any following call to RXTXPort.read/write. - close() will wait a finite amount of time (maybe 500ms) for the release of the read and write monitors after that, it will trigger the closing of the file descriptor to abort any pending read or write. - close() will not call close(file_desc). Instead it will "interrupt" (ie set a flag and then, pthread_kill(ABRT)) the MonitorThread, the MonitorThread will call close(file_desc). - the monitors are properly released in a finally block the try of which starts directly after obtaining the monitor. - finally will not call close(file_desc) it will only "interrupt" the MonitorThread (see above) - the native-code (esp read) does not use SA_RESTART but checks Thread.interrupted() when it receives a SIGNAL (ie system call returns with EINTR or other signalling method). The read/write monitors will be allocated from a factory whose mode can be set to fast/normal/advanced. In fast-mode it will create "non thread safe, non synchronized" pseudo-monitors. In default mode, the monitors will store the owning thread. In "advanced" mode setting the monitors into closed state will "interrupt()" threads which are blocked in a native read/write. {Reasoning close behaviour: Calling close on a file descriptor in Windows unblocks any read() or write() on the same file descriptor with an error. On Solaris < 2.7 and MacOS X however the close() will/ can block - until the read or write have finished:-(( Even the JDK people have trouble with this. I dont know how Linux reacts in this case. The best practice for BSD/Solaris is to send a signal to the thread which will usually unblock the read/write with an EINTR - this however is not guarenteed as it also depends on the device driver. So the only resolution that will certainly not block the thread calling RXTXPort.close() (which will often enough be the AWT event dispatcher or the VM finalizer thread) is to call close(fd) from another thread.} {Reasoning read behaviour: It is rather uncommon to receive a signal while reading or writing - it will happen, but checking Thread.interrupted() when it happens will not degrade performance. The checking of Thread.interrupted() can be handled by returning to Java and potententially reentering into the native code if the thread was not interrupted or by calling back into the VM from the native code. On top of this, many functions like read(byte[]) or read(byte [], int, int) are allowed to return less than the requested amount of data. Only int read() is a bit more tricky. } [Trent: From the code I can tell, that you experimented quite a bit with signals. Do you know if the Java Thread.interrupt() triggers a unix signal on Linux/Solaris? If so, which one?? References: - http://java.sun.com/docs/hotspot/VMOptions.html - http://www.hp.com/products1/unix/java/infolibrary/prog_guide/ signals.html ] On OS X (hotspot client jdk-1.4.2) I did not see any signal propagated to the SELECT of the event_loop/MonitorThread (ie no EINTR) when I call monThread.interrupt(). This is a pitty, but thats the way it is. I simply assume this is true for most system calls. How to handle this? Of course it would be possible to install/ deinstall a specific signal handler before/after every native read and to natively send an ABRT signal if RXTXPort.close is called. A more elegant solution might be to have an additional "signaling" socket which is always included in the SELECT. Or the simplest solution: cap the timeout of the select to 500 ms (the loop around it exists already) after every timeout check the Thread.interrupted() flag. From a performance perspective this should be completely invisible... On the other hand, all write() calls need to be preceeded by a SELECT as well, to avoid running into a blocking write. Best regards, Joachim From lyon at docjava.com Sat May 13 05:54:52 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 13 May 2006 07:54:52 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Dmitry suggests that we acquire an implementation of a serial port reference, use it, then release it (i.e., check it back in). Joachim says that making serial ports thread friendly might be a good idea. This is a good idea. The design pattern that is close to this idea is the "Object Pool Design Pattern". # Object Pool Manage the reuse of objects for a type of object that is expensive to create or only a limited number of a kind of object can be created. It has been described at: http://www.developer.com/java/ent/article.php/626171 and in Marks' book, Patterns in Java, Volume 1. However, the Object Pool is intended to pool objects so that each object is just like every other object. The intent of the Parametric Singleton is to enable others to access the same resource at the same time (as long as the same parameters were used in construction). It sounds like we need a NEW Design Pattern (Oh no, Doug is doing it again!). Yes friends, you got me on a role (roll) :) If you like design patterns, you can thank me later. If you don't like design patterns, blame Dmitry, it was his idea ;) And Dave, thanks for the feedback on Singleton abuse. It has led me to change the way I think about application contexts, which we will see, below. We need (drum roll please): The Parametric Object Pool Design Pattern (POP) By Douglas A. Lyon ABSTRACT The goal of the Parametric Singleton design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values, in a given context. In comparison, the goal of the POP design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values and that only one reference to the class is checked out at a time, in a given context. A context is a namespace for holding identifiers during execution. In Java, A context can be changed in any of several ways. For example, creation of a new class loader, the deserialization of an old POP or the creation of a new process all create a new namespace. The POP Design Pattern combines the Parametric Singleton Design Pattern with the check out mechanism of the Object Pool Design Pattern. This enables unique creation of instances of a class. These instances are cached in a table. When a clients asks for an instance with these parameters, the cache is checked. If the instance is not in the cache it is created. If the instance is available, the clients checks out the instance. A reference is left to the clients that checked out the instance. The POP has the role of creating objects uniquely, from parameters. It also has the role of keeping track of which clients has checked out a given object. This is just like a library keeping track of who borrowed a book. If a resource is left unavailable in a system, a deadlock can occur. Deadlock debugging is facilitated by mapping a resource to the clients that have checked it out. We apply our POP Design Pattern to the retrieval of serial ports. The goal of our system is to make sure that serial ports are checked out to only one client at a time, and that they be checked back in when the client is done. The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. Users are discouraged from calling this the Parametric Object Oriented Pool (POOP). Introduction The intent of the POP Design Pattern is to ensure that a class has only one instance for a given set of parameter values. It also provides a point of access that is global to a given context. The POP uses the Singleton Design Pattern to ensure that there is only one POP, in the given context. The POP DP is responsible for checking out a reference to a given instance, and keeping track of that instance. The instance is responsible for sharing that instance. POP requires that users of the DP implement an interface that enables a recall facility. Thus, if there is a contention for a consumed resource, the deadlock can be resolved in an orderly fashion. Motivation A system cannot tolerate multiple instances of some classes with identical parameters used by different instances at the same time. For example, you cannot have two instances use the same serial port, at the same time. You cannot have two instances that are trying to listen to the same socket connection. You cannot have two instances writing to the same file structure at the same time. Further, once a serial port is checked out by a client, it is assigned to the client. This is like the spin-lock service provided by the operating system, only in the application layer. Naturally, deadlock will occur if a resource is not released, therefore the client of the resource is tracked. Recalling a resource is required for the POP DP by virtue of the implementation of an interface. The policy on how to break a deadlock (by honoring the recall) is application specific. As the operating system is often thought of as the arbiter of consumed resources (i.e., tape drives, serial ports, etc.) we frequently leave it to an operating system implementation to resolve these contention issues. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on naming conventions (which are not well standardized). The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. The POP Design Pattern can take on the role of the peer method mapper that homogenizes the API for different operating environments. That is, it can wrapper the different locking mechanisms used in different operating systems. POP that is responsible for keeping track of the instances created and the client that has checked them out. The POP Design Pattern is implemented using the Singleton Design Pattern. In Java, the POP implementation is declared final, so that it cannot be subclassed. The class also has a private constructor, so that other classes cannot instance it. The new design pattern is called the POP design pattern and it provides a way to check out and create instances with given parameters. Applicability Use the POP Design Pattern when: 1. There must be exactly one instance of a class with the given parameters in a given context. 2. The instances must be accessible to clients from a well-known access point. 3. The instances are reusable. 4. Only one client can check out an instance at a time. Structure Insert UML diagram here. Participants The POP Clients that need instances 1. The POP defines an instance upon request from a client, if, and only if, the instance does not already exist. 2. The POP returns the instance to the client. 3. The POP is responsible for creating unique instances from given parameters. 4. The POP is responsible to recalling instances from clients. Collaborations Clients obtain a reference to a POP instance only through the singleton design pattern. If the POP instance is left in an improper state (e.g., the serial port was left open) it is NOT the role of the POP to close the IO port. However, the POP can be requested to get the instance released. Nor is it the role of the POP Design Pattern to open the port. That role is delegate to some other part of the system. Further, it is the role of the POP Design Pattern to check out resources. However, it is still possible to have, multiple threads that have multiple references to the same resource at the same time. Checkout and resource requests are MUTEX locked (i.e., synchronized). Consequences The POP Design Pattern has several benefits: 1. Controlled access to parametrically defined instances. Since the POP encapsulates its instances, there is some limited control over how and when clients access it. 2. Reduced name space. The POP pattern avoids global variables that store instances created from the same parameter. Implementation Here are implementation issues to consider when using the POP pattern: 1. Unique mapping of parameters. The POP pattern requires that there be a mean to isomorphically map the parameter space into the instance space and back again. 2. Ensure unique instances. The POP pattern makes unique instances from parameters, and it does so only once. 3. Cache instances for fast retrieval. The POP must be able to look up instances, given some set of parameters, and do so from some data structure. That is, there must be enough space to hold references to all the instances the program will need. Also, a mechanism is needed to look up and retrieve the instances quickly enough to satisfy the clients. Sample Code To be written....any volunteers? Thanks! - Doug >I don't think I get it > >On Mar 22, 2006, at 9:36 AM, David Garnier wrote: >>Using the singleton pattern in this case is >>just convenient for the programmer. Problems >>arises >>pretty quickly, especially if you attempt to unit-test your classes. > > >so you're saying that something isn't so good >because you can not test it in the convenient >way? >if that's true, I'm totally disagree >change your test, debug whatever, but if >software is efficient at runtime, works fine and >only problem is some unit test >(which is some kind of framework for testing) >then dump that unit test , dump that unit >framework and make something appropriate to the >software >you're testing > >so if Douglas want to use singletons, what's the problem? >and what do you mean by abusing of singleton usage? > >of course singleton doesn't prevent concurrent >access to the resource across the processes >unless >you're using some OS facility to prevent it, besides >singleton as it was introduced is relevant only >and only inside of the same process >otherwise it's not singleton it's something else >(let's say network singleton: so you have remote >invocation facility >and some factory method that return object created by that facility) > >I don't have any problem with using any kind of singletons. > Parametric Singleton idea (if I understand it >right) could be easily implemented in the >following way: >use a map >populate map with instances of some class and key is your parameter >(you can use lazy population too) > >if somebody ask the key check the value if it's null so resource is taken >if somebody returns the resource put it back to the map > >public synchronized static Object getSomeResource(Object parameter); >public synchronized static void returnResource(Object parameter); > >getSomeResource (inside of the same process) could return null in 2 cases >1. if somebody (from other thread for example) already took that resource >2. if OS API said that resource corresponded to >that parameter (serial port with parameter = 1 >(port #)) >is locked and unavailable; >I'm not sure that in case of serial ports we >even need those Parametric Singletons >(unless lock checking is a very expensive operation) >just ask the OS about availability of that >resource and if it's available give it away >and then OS will lock it and therefore in next >time somebody ask it just answer that resource >is locked >and return null > >for example system has 2 serial ports available >so I ask getResource("tty"); >or I ask getResource("Bluetooth-Modem"); > >and if OS is ok you can give tty or Bluetooth-Modem or both > >no need for any additional pattern I think > >back to the problem >mac os x doesn't recognize locking via files, so >it handles locking via some API >an instance of the singleton in each process >should recognize that resource is locked >(by using that API) that's all >we don't have to make things more complicate >then they are just because there is some nice >design pattern or nice unit test framework or whatever >keep things simple, make them work fast, don't introduce middle layers >unless you have really good reason to do so > >of course I could be entirely wrong, so sorry about that in advance > >thanks > > >Dmitry Markman > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx >Good day, > >I guess that only a selected few (hi Trent) will be able to answer? >this question, but the answer might be interesting for anyone trying? >to debug or understand the code. > >Apparently the MonitorThread is started and stopped in? >RXTXPort.addEventListener and RXTXPort.removeEventListener. This? >would indicate that (originally?) the MonitorThread is only required? >when there is an EventListener. However the MonitorThread is also? >started in the RXTXPort constructor, which could mean that RXTX won't? >work at all if it isn't there. > >It seems to me, that if anyone would add an event listener and later? >on remove it, he could potentially wreak the port. Because the second? >action would kill the MonitorThread. > > >For the moment I am only trying to understand the role of and idea? >behind the MonitorThread. But of course there is a deeper reason thor? >my question: > >If the MonitorThread needs to exist anyway, it could be the thread? >that cleans up the port (ie calls nativeClose) - this would eliminate? >(a further) problem I am seeing with some USB drivers on Mac OSX.? >(Close blocks (after releasing the tty, but still) in the USB driver? >if the device is "not responding"). > >Greetings, >Joachim > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Sat May 13 10:07:37 2006 From: joachim at buechse.de (Joachim Buechse) Date: Sat, 13 May 2006 18:07:37 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Douglas, Looking at the current code, leaves me with the feeling, that there is a lot to do. Defining an API that wraps javax.comm to provide what you describe is certainly possible, but I wonder how much benefit it will actually provide. Personally I think the API defined by javax.comm "request/lock" a port with: cp= new CommunicationPort(identifier) "release" a port with: cp.close(); works quite nice for 99% of the applications. In my experience, the most efficient and elegant implementation is to wrap a port/socket/.. into a business object which declares the remote operations that are possible. Ie "uploadFile", "waitForPrompt", "getSerialNumber", "sendContact", "executeCommand", etc Those methods are then either synchronized or guarded by a monitor. I do not see how your design pattern applied to the port resource would help implementing this. [details start, skip if you agree to the above] When I talked about "thread-safe" I didn't mean several independent "sessions" accessing the port concurrently. I think this is a very rare usage. I believe the most common use case for serial ports today is the control of an external device from a PC running a GUI based application. To implement a clean Swing/AWT-GUI one needs to pass any action that can block to a "worker" thread (else the GUI blocks, the application appears dead). While it is possible to use own prespawned thread that will accept Runnables which operate on the port, this is not very elegant. It is more common to spawn a new thread for every action triggered by the user. Additionally the ABORT of a running operation is often implemented via a port.close() delegated to a different thread. - During the lifetime of a port, it will usually be accessed from several different threads. Instance variables need to be set/read in synchronized regions to guarantee a correct operation based on the Java memory model. - Synchronizing the access is usually handled on the application level (synchronizing the reads/writes is usually useless from the applications view because it is not a transaction mechanism). [details end] I am very open to learn about other scenarios where your proposed design pattern applied to the port resource is beneficial to the application implementor. Best regards, Joachim On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > Dmitry suggests that we acquire an implementation of > a serial port reference, use it, then release it (i.e., check it > back in). > > Joachim says that making serial ports thread friendly might be a > good idea. > > This is a good idea. The design pattern that is close to this idea > is the "Object Pool Design Pattern". > # Object Pool From jredman at ergotech.com Sun May 14 14:28:24 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 14:28:24 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers Message-ID: <446792E8.4000506@ergotech.com> Does anyone know of any work to make RXTX work with Ethernet (telent) Terminal Servers? If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? We've used RXTX with upwards of 100 virtual COM ports on Windows and it works well. Linux is more problematic. It would be good to have an OS independent solution to accesses remote Ethernet serial ports. Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From legolas.w at gmail.com Sun May 14 14:26:34 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:56:34 +0430 Subject: [Rxtx] does any one have a working sample of RXTX and LPT port Message-ID: <4467927A.4000008@gmail.com> Hi Thank you for reading my post does any one has a working sample for RXTX and LPT port ? Thanks From legolas.w at gmail.com Sun May 14 14:27:29 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:57:29 +0430 Subject: [Rxtx] does RXTX support Trigerr on parallel port? Message-ID: <446792B1.4040905@gmail.com> Hi does RXTX support trigger on LPT port ? if so , how i can use it ? Thanks From tjarvi at qbang.org Sun May 14 17:40:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 17:40:59 -0600 (MDT) Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: <446792E8.4000506@ergotech.com> References: <446792E8.4000506@ergotech.com> Message-ID: On Sun, 14 May 2006, Jim Redman wrote: > Does anyone know of any work to make RXTX work with Ethernet (telent) > Terminal Servers? > > If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 > Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? > Hi Jim It appears the author of NVTCom has decided to release the library into the public domain. Integration with rxtx is possible but it would be best to contact the author and find out what his intent is. I would suggest contacting the author with a proposal of what you would like to do and take it from there. We could 'take' public domain software but its better to show respect to the authors and respect their wishes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:10:23 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:10:23 -0600 (MDT) Subject: [Rxtx] does any one have a working sample of RXTX and LPT port In-Reply-To: <4467927A.4000008@gmail.com> References: <4467927A.4000008@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > Thank you for reading my post > does any one has a working sample for RXTX and LPT port ? > Thanks Hi Legolas LPT port support in rxtx is spotty. That means some people have sent in patches for what they do and it works well for them. The original code was not very good. It may have been 3 hours work :/ To get started, Sun has some demo programs with their commapi. With rxtx 2.1 you can change their code from using javax.com to gnu.io and it -should- work. But if it does not you can post here and on bugzilla. There has been more interest lately off the list and maybe there will be enough community resources to get what you need going. If you do get a sample program together, we would gladly put it in the contrib directory so the next person can get things going faster. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:12:12 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:12:12 -0600 (MDT) Subject: [Rxtx] does RXTX support Trigerr on parallel port? In-Reply-To: <446792B1.4040905@gmail.com> References: <446792B1.4040905@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > does RXTX support trigger on LPT port ? > if so , how i can use it ? > Hi Legolas As mentioned in the previous post, rxtx parallel support is not very mature. But if you can point to something that describes the trigger feature, we can probably make sure its there and give a quick code example. -- Trent Jarvi tjarvi at qbang.org From jredman at ergotech.com Sun May 14 22:22:48 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 22:22:48 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: References: <446792E8.4000506@ergotech.com> Message-ID: <44680218.4080008@ergotech.com> Trent, Trent Jarvi wrote: > On Sun, 14 May 2006, Jim Redman wrote: > >> Does anyone know of any work to make RXTX work with Ethernet (telent) >> Terminal Servers? >> >> If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 >> Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? >> > > Hi Jim > > It appears the author of NVTCom has decided to release the library into > the public domain. Integration with rxtx is possible but it would be best > to contact the author and find out what his intent is. > > I would suggest contacting the author with a proposal of what you would > like to do and take it from there. We could 'take' public domain software > but its better to show respect to the authors and respect their wishes. > I sent Marco(?), the author of the library, a note before asking the list - I'll let you know the response. If anyone is already working on it, or has an interest and more time and energy than me, I'd hate to duplicate the efforts. If no one is, and no one objects, maybe I'll see what I can do. Jim > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From Christian.Klemke at t-online.de Mon May 15 02:23:06 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Mon, 15 May 2006 10:23:06 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu><004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: <008a01c677f8$cae18590$02fea8c0@NB600> Hi Trent, Hi Paul, I finally found some time to create a simple patch to enable the optional suppression of version output to the console. It is based on a new system property called "gnu.io.rxtx.NoVersionOutput" which can by set to "true" if necessary. I had some problems accessing CVS, therefore I downloaded the rxtx-2.1-7r2 source archive from ftp.qbang.org (which is linked on the rxtx.org download page) and worked with that release. Please find my proposed patch in the attachment ! Regards, Christian ----- Original Message ----- From: "Trent Jarvi" To: "RXTX Developers and Users" Cc: ""Paul Gettings"" Sent: Friday, May 05, 2006 2:09 PM Subject: Re: [Rxtx] RXTX causing stdout messages > On Fri, 5 May 2006, Christian Klemke wrote: > >> Hi Paul, >> >> I was wondering about the same question some days ago and took a look at >> the >> source files. Unfortunately, I found that you can only get rid of that >> messages by altering and recompiling the Java code. There is a final >> static >> boolean variable called "devel" in the file "RXTXCommDriver.java" which >> is >> set to "true". This constellation causes the output after the native >> libraries have been loaded. No mechanism exists to suppress them >> otherwise >> :-(. >> >> Trent, does that mean that 2.1.7 is still officially a "development" >> version >> ? When will this value be changed to "false" by default ? With 2.1.8 ? It >> would be nice to provide a means to suppress such messages besides that >> static flag (maybe by setting a property called >> "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The >> output can indeed by annoying, especially when used with console >> applications, where the message potentially appears "in the middle" of >> your >> own output. Another possibility would be not to use System.out directly, >> but >> instead some PrintStream field which is initially set to System.out but >> can >> programatically be changed. That would allow for any kind of redirection >> or >> suppression by implementing appropriate user-defined PrintStream >> subclasses >> and making RXTX use that stream. What do you think ? >> > > A patch for using properties would be accepted I'm sure. > > The reason the default is to display the message is not related to the > development state of rxtx anymore. The problem is that people first using > rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. > The message prevents a great deal of email thats easily explained by the > message. > > I question if we should support rxtx 2.0 at all anymore. > > If you post a patch in bugzilla, we'll put it into CVS this weekend. > we'll be going through and doing such things anyhow. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_version_output_patch.diff Type: application/octet-stream Size: 991 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060515/3173c2b6/rxtx_version_output_patch-0395.obj From lyon at docjava.com Mon May 15 06:06:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 May 2006 08:06:21 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Joachim makes several good points. Let me see if I can address some of them below: >Hello Douglas, > >Looking at the current code, leaves me with the feeling, that there? >is a lot to do. Yes! >Defining an API that wraps javax.comm to provide what? >you describe is certainly possible, but I wonder how much benefit it? >will actually provide. > >Personally I think the API defined by javax.comm > >"request/lock" a port with: > cp= new CommunicationPort(identifier) >"release" a port with: > cp.close(); > >works quite nice for 99% of the applications. I don't know what percentage of applications turn off locking, the way that I do in my version of the RXTX lib. I do know that this is not safe practice. I also know that it was motivated by the multi-platform nature of my code and that this was the only way I could make things work, at the time. Java does not appear to have a cross-platform standard for locking resources on various platforms. Each OS appears to have its own standard. The question of who breaks deadlocks and how this is done remains open, as this is not an easy question to resolve. Let me continue, below: > >In my experience, the most efficient and elegant implementation is to? >wrap a port/socket/.. into a business object which declares the? >remote operations that are possible. Ie "uploadFile",? >"waitForPrompt", "getSerialNumber", "sendContact", "executeCommand",? >etc Those methods are then either synchronized or guarded by a? >monitor. I do not see how your design pattern applied to the port? >resource would help implementing this. I have no problem with high-level wrappers that are application specific. That is a very good idea, but orthogonal with respect to the issue of deadlocks. More below: > >[details start, skip if you agree to the above] >When I talked about "thread-safe" I didn't mean several independent? >"sessions" accessing the port concurrently. I think this is a very? >rare usage. That is probably why turning locking off works so well! On the other hand, it is not safe and I shouldn't do it. >I believe the most common use case for serial ports today? >is the control of an external device from a PC running a GUI based? >application. To implement a clean Swing/AWT-GUI one needs to pass any? >action that can block to a "worker" thread (else the GUI blocks, the? >application appears dead). While it is possible to use own prespawned? >thread that will accept Runnables which operate on the port, this is? >not very elegant. It is more common to spawn a new thread for every? >action triggered by the user. Additionally the ABORT of a running? >operation is often implemented via a port.close() delegated to a? >different thread. Here lies the heart of serial port concern. An application opens a serial port and then dies. The application is restarted and finds the port locked. How do we clear the lock? Must the application's user reside in the UUCP group? Must installers of the serial port add users to the UUCP group? Should locking be handled at a high-level of abstraction in an operating system independent way? Should the implementation of the locking mechanism be translated into an API that is dependent on the OS convention? Suppose that we restrict the discussion to serial ports. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on inconsistent naming conventions. Hence my feeling that we need to mirror what is done in other API's; we need a locking toolkit that references peer methods, IMHO. >From the Java programming point of view, the locking API is portable across different platforms, but has, as its implementation, a native peer method that uses the conventions of the underlying OS. This enables portable resource locking (in theory!). Consider, for example: org.apache.commons.transaction.locking with: Interface LockManager at: http://jakarta.apache.org/commons/transaction/apidocs/org/apache/commons/transaction/locking/LockManager.html Or, more recently: java.util.concurrent.locks Interface Lock based on Doug Lea's code: http://kickjava.com/src/EDU/oswego/cs/dl/util/concurrent/ReadWriteLock.java.htm Should we incorporate a clean, portable design into serial port use, one that is consistent with current locking APIs? Basically, a comm port is a resource and resources are typically controlled by managers. Thus, I suggest that we make use of a CommPortManager to help control and centralize serial port usage. The question of how this is done remains open, IMHO, but using core API's like: java.util.concurrent.locks might not be amiss. High-level methods (getAllPorts, getAllSerialPorts, getAllParallelPorts, etc...) might be welcome additions. Basic questions like, "what if a port is in use?" remain open, hence my proposal for the new design pattern. Isn't it the CommPortManager's role to break the deadlock? Cheers! - Doug > >- During the lifetime of a port, it will usually be accessed from? >several different threads. Instance variables need to be set/read in? >synchronized regions to guarantee a correct operation based on the? >Java memory model. >- Synchronizing the access is usually handled on the application? >level (synchronizing the reads/writes is usually useless from the? >applications view because it is not a transaction mechanism). >[details end] > >I am very open to learn about other scenarios where your proposed? >design pattern applied to the port resource is beneficial to the? >application implementor. > >Best regards, >Joachim > >On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > >> Dmitry suggests that we acquire an implementation of >> a serial port reference, use it, then release it (i.e., check it? >> back in). >> > > Joachim says that making serial ports thread friendly might be a? >> good idea. >> >> This is a good idea. The design pattern that is close to this idea >> is the "Object Pool Design Pattern". >> # Object Pool > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Mon May 15 06:58:19 2006 From: joachim at buechse.de (Joachim Buechse) Date: Mon, 15 May 2006 14:58:19 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Doug, I agree fully, that locking of the system resource should be abstracted from the user (programmer). Currently this is already the case, but I agree it might be nice to extract the code into a separate class, which uses platform dependent providers to do its job. What I described in my email was not targeted at allocating the system resource, but at handling an already allocated system resource inside the framework. I agree that it may be possible to combine the two - however, I would suggest to do this in phase2. I can contribute a work over of RXTXPort.java which implements clean internal locking and proper close behavior (which I would call phase 1). I could do this this week. However I strongly believe that there is little sense in trying to do this as a series of patches. It will be closer to a rewrite than to a patch. I have already provided a number of suggested patches via Bugzilla, but this is quite inconvenient (for me). My working copy diverges more and more from the master and hence it gets more and more annoying to provide self contained patches. Best regards, Joachim From tjarvi at qbang.org Mon May 15 08:27:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 May 2006 08:27:51 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Mon, 15 May 2006, Joachim Buechse wrote: > Hello Doug, > > I agree fully, that locking of the system resource should be > abstracted from the user (programmer). Currently this is already the > case, but I agree it might be nice to extract the code into a > separate class, which uses platform dependent providers to do its job. > > What I described in my email was not targeted at allocating the > system resource, but at handling an already allocated system resource > inside the framework. I agree that it may be possible to combine the > two - however, I would suggest to do this in phase2. > > I can contribute a work over of RXTXPort.java which implements clean > internal locking and proper close behavior (which I would call phase > 1). I could do this this week. > > However I strongly believe that there is little sense in trying to do > this as a series of patches. It will be closer to a rewrite than to a > patch. I have already provided a number of suggested patches via > Bugzilla, but this is quite inconvenient (for me). My working copy > diverges more and more from the master and hence it gets more and > more annoying to provide self contained patches. > For methodical testing purposes (which does go on) the incremental patches are better. I'm lagging behind in bugzilla but thats soon to change (this week). It has just been rather chaotic up until now. I moved, purchased a house, and jumped into the fire of a feature freeze timeframe at a new job. btw, we see the Solaris close issues on 2.8 also. 9 and 10 are fine. I'll work towards making those test results public and allow others to run new rxtx code through them. We had the OK at one point but setting up the environment is involved. It isn't just a collection of java classes. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Tue May 16 02:01:47 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:01:47 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] Message-ID: <446986EB.209@willicon.de> Hi, any ideas for my problem? Hans -------- Original-Nachricht -------- Betreff: [Rxtx] Problem under Mac OSX 10.3.9 Datum: Mon, 08 May 2006 18:47:20 +0200 Von: WILLICon Antwort an: RXTX Developers and Users An: RXTX Developers and Users Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/b0741c2b/attachment-0395.html From joachim at buechse.de Tue May 16 02:15:08 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 10:15:08 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: Hello Hans, I am using RXTX on OS X for my own project. I do not see the problem you describe. I had some troubles installing it because the current version uses lock files which is non-standard on OS X. I have created a patched version which I currently use. This version does not need to modify user groups and hence does not need an installer. I just pop it in the application directory. If you send me a link where I can download your OSX installer, I will have a quick look. Regards, Joachim On 16.05.2006, at 10:01, WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we > have some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + > spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + > spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always > the value "false". > I can only get the status, while I open the port and catch the > exception. > > Any ideas? > > Hans > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail at willicon.de Tue May 16 02:26:53 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:26:53 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: References: <446986EB.209@willicon.de> Message-ID: <44698CCD.7050709@willicon.de> Joachim, tanks for the answer. I'll send You a mail. Hans Joachim Buechse schrieb: > Hello Hans, > > I am using RXTX on OS X for my own project. I do not see the problem > you describe. > > I had some troubles installing it because the current version uses > lock files which is non-standard on OS X. I have created a patched > version which I currently use. This version does not need to modify > user groups and hence does not need an installer. I just pop it in > the application directory. If you send me a link where I can download > your OSX installer, I will have a quick look. > > Regards, > Joachim > > On 16.05.2006, at 10:01, WILLICon wrote: > > >> Hi, >> >> any ideas for my problem? >> >> Hans >> >> -------- Original-Nachricht -------- >> Betreff: [Rxtx] Problem under Mac OSX 10.3.9 >> Datum: Mon, 08 May 2006 18:47:20 +0200 >> Von: WILLICon >> Antwort an: RXTX Developers and Users >> An: RXTX Developers and Users >> >> >> Hi, >> >> I use for RXTX for communicate with CyclingComputers. >> >> It works good under Win32, Sloaris and Linux but with Mac OSX we >> have some problems. >> >> My users install the Mac OSX serial lib from the actual binary. >> >> After starting the program, they get this error message: >> >> java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while >> loading gnu.io.RXTXCommDriver >> >> Remember, this error comes only under Mac OSX. >> >> That is the code for the error: >> >> Enumeration portList = CommPortIdentifier.getPortIdentifiers(); >> spInUse = getBundleStr("serialPortInUse"); >> spFree = getBundleStr("serialPortFree"); >> while (portList.hasMoreElements()) { >> CommPortIdentifier portId = (CommPortIdentifier) >> portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (osName != null && osName.startsWith("mac")) { >> if (!portId.getName().startsWith("dev/cu.")) { >> continue; >> } >> } >> if (portId.isCurrentlyOwned()) { >> serialPortNames.add(portId.getName() + " - " + >> spInUse); >> } >> else { >> serialPortNames.add(portId.getName() + " - " + >> spFree); >> } >> } >> } >> if (serialPortNames.size() == 0) { >> serialPortNames.add(getBundleStr("serialPortNotFound")); >> } >> >> BTW: The methode isCurrentlyOwned() is not working. I get always >> the value "false". >> I can only get the status, while I open the port and catch the >> exception. >> >> Any ideas? >> >> Hans >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/948333be/attachment-0395.html From jredman at ergotech.com Tue May 16 07:35:52 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 16 May 2006 07:35:52 -0600 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: <4469D538.6070408@ergotech.com> Hans, I have no direct insight, but would note that what you have is a "NoClassDefFoundError" not a "ClassNotFoundException". So the class javax/comm/CommDriver is found, but one of its dependencies is missing. NoClassDefFoundError are a bigger problem to resolve because you get no indication of the real problem. Jim WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we have > some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > * spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always the > value "false". > I can only get the status, while I open the port and catch the exception. > > Any ideas? > > Hans > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.de Tue May 16 08:01:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 16:01:21 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 In-Reply-To: <4469AFC3.6000002@willicon.de> References: <44698EBC.8000008@willicon.de> <8C5680C4-E2BA-42FF-B221-36E1124FA6A4@buechse.de> <4469AFC3.6000002@willicon.de> Message-ID: <9825A602-D6ED-4C28-BF33-9A7C984FACD5@buechse.de> Hallo Hans, you include RXTX 2.17 in your "bikeXexperience.jar" (2.17 uses Interfaces from gnu.io.* not javax.comm.*). Now inspect your error log closely: The class gnu.io.RXTXCommDriver tries to load javax.comm.CommDriver: this is only the case for RXTX 2.07. I assume, that the user has installed Version 2.07 into one of the java.ext.dirs . The VM always tries to load classes from the "system" path first. The current Mac installer distributed with RXTX in fact installs RXTXcomm.jar and librxtxSerial.jnilib into /Library/Java/Extensions. (I wrote some time ago that I consider this as a bad idea because of potential version conflicts-> thanks for delivering the example). For 2.07 it does so without installing the javax.comm classes it seems. I would recommend that you instruct your users to install version 2.17 only. Until RXTX is changed to use TIOCEXCL instead of lock files, you can hardly avoid the installer, as the user needs to be added to a special group and a lockfile directory needs be created. More precisely you are waiting for: http://bugzilla.qbang.org/show_bug.cgi?id=50 [RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL)] Regards, Joachim -------------- next part -------------- A non-text attachment was scrubbed... Name: log.tiff Type: image/tiff Size: 38394 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/e3e52128/log-0395.tiff -------------- next part -------------- > > Ich verwende RXTX 2.17. Das orginal RXTXcomm.jar ist in > CyclingDataManager.jar enthalten. > From tjarvi at qbang.org Wed May 17 23:18:15 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 May 2006 23:18:15 -0600 (MDT) Subject: [Rxtx] update Message-ID: So we have several patches and these have stacked up. I'd like to thank everyone for being patient. Tests for the most intrusive patches look good so far. I still have to get some bits together on my end but it looks like we can catch everything up in CVS this week. I'll try to post a normal list of what went in by whom with links Saturday. But I'm not seeing anything that raises flags yet. I also think I'll be able to submit a patch for nonstandard baud rates. I have to confirm w32 but I think its going to be a one line fix. I don't know if its bugzilla or people tinkering with patch files before submitting but patches are not applying cleanly. So the patches have to be done by hand. This may make things difficult for people hoping to add other patches on top. I'm trying to make that go well but ... -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Thu May 18 02:23:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 May 2006 10:23:47 +0200 Subject: [Rxtx] update In-Reply-To: References: Message-ID: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Hello Trent, in fact I tinkered with the patches (never used this mechanism before, usually I "communicate" via cvs) ... so sorry for any trouble you had applying them. Basicly I edited the patches to make them self contained. Having the tests run with different speeds on different platforms, may well be an effect of caching. I have seen quite interesting propagation delays for the closing flag on my PowerPC system, which makes me doubt, that the propagation of output_buffer_empty_flag works as it should. Maybe the communication mechanism between the two threads should be replaced by something like pthread_cond_*. Could you describe which problems you see on Solaris/SPARC? I'd be interested to see if they exist on OS X (PowerPC) as well... As you seem to work on the stuff at the moment I would like to suggest the following additions (it looks more than it is, I posted some context to make clear where to apply the change). See the comments in braces for what was changed Greetings, Joachim (1) The end of the drain loop could be: --- report("drain_loop: received EINTR in tcdrain\n"); --- (added "in tcdrain" to make debug output clearer) (2) The start of the drain loop should be: --- for(i=0;;i++) { report_verbose("drain_loop: looping\n"); #if defined(__sun__) /* FIXME: No time to test on all OS's for production */ if( eis->eventloop_interrupted ) { goto end; } if (usleep(5000)) { report("drain_loop: received EINTR"); } #else if (usleep(1000000)) { report("drain_loop: received EINTR"); } #endif /* __sun__ */ --- (added a check for "eis->eventloop_interrupted" before the sleep) (3) The end of interrupt_event_loop could (and maybe should) be: --- #if !defined(TIOCSERGETLSR) && !defined(WIN32) /* make sure that the drainloop unblocks from tcdrain */ pthread_kill(index->drain_tid, SIGABRT); /* TODO use wait/join/SIGCHLD/?? instead of sleep? */ usleep(50 * 1000); /* Under normal conditions, SIGABRT will unblock tcdrain. However a non-responding USB device combined with an unclean driver may still block. This is very ugly because it may block the call to close indefinetly. */ if (index->closing != 1) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); index->closing = 1; } #endif report("interruptEventLoop: interrupted\n"); --- (added some comments and pthread_cancel for resisting drain thread) On 18.05.2006, at 07:18, Trent Jarvi wrote: > > So we have several patches and these have stacked up. I'd like to > thank > everyone for being patient. > > Tests for the most intrusive patches look good so far. I still > have to > get some bits together on my end but it looks like we can catch > everything > up in CVS this week. > > I'll try to post a normal list of what went in by whom with links > Saturday. But I'm not seeing anything that raises flags yet. I also > think I'll be able to submit a patch for nonstandard baud rates. > I have > to confirm w32 but I think its going to be a one line fix. > > I don't know if its bugzilla or people tinkering with patch files > before > submitting but patches are not applying cleanly. So the patches > have to > be done by hand. This may make things difficult for people hoping > to add > other patches on top. I'm trying to make that go well but ... > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu May 18 22:28:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 18 May 2006 22:28:00 -0600 (MDT) Subject: [Rxtx] update In-Reply-To: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> References: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Message-ID: On Thu, 18 May 2006, Joachim Buechse wrote: > Hello Trent, > > in fact I tinkered with the patches (never used this mechanism > before, usually I "communicate" via cvs) ... so sorry for any trouble > you had applying them. Basicly I edited the patches to make them self > contained. I think we are close to moving towards that. > > Having the tests run with different speeds on different platforms, > may well be an effect of caching. I have seen quite interesting > propagation delays for the closing flag on my PowerPC system, which > makes me doubt, that the propagation of output_buffer_empty_flag > works as it should. Maybe the communication mechanism between the two > threads should be replaced by something like pthread_cond_*. Could > you describe which problems you see on Solaris/SPARC? I'd be > interested to see if they exist on OS X (PowerPC) as well... This is interesting. I have seen problems with output buffer empty in applications that require it. I'm trying to get a bug list and or test results open for everyone to see but that may take time. But missed output buffer events ... yep. With Sparc, we have seen a few things. One was a kernel race condition that went away when we reimaged and updated 2.8. RXTX was hanging on close, top showed no cpu use but there was 2 second delays just typing on console. The other is our tests now take ~4 times longer on Solaris. Someone is looking at timing just open, close, read, write, ... to see if they can find where the slowdown is. This happened after solaris 2.8. I'll try to share more when/if there is something interesting. This may well not be solvable in userland. > > As you seem to work on the stuff at the moment I would like to > suggest the following additions (it looks more than it is, I posted > some context to make clear where to apply the change). See the > comments in braces for what was changed I'll take a look. This could all come together Saturday but I also have an event to attend that day. I may not wrap this up until Sunday. -- Trent Jarvi tjarvi at qbang.org From andrewlord at internode.on.net Sun May 21 20:10:02 2006 From: andrewlord at internode.on.net (Andrew Lord) Date: Mon, 22 May 2006 11:40:02 +0930 Subject: [Rxtx] Kernel include files do not match kernel Message-ID: <200605221140.03271.andrewlord@internode.on.net> Hi, I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel 2.6.12-18 with the command: ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include However I get the message: ## checking java.version 1.5.0_06 ## checking os.version 2.6.12-18mdk ## ## WARNING: Kernel include files do not match the current kernel ## ## configure: creating ./config.status etc. Is there a problem with the way I'm specifying the 'include' directory ? If not, how else can I specify the correct directory for the include files please ? Cheers, Andrew From tjarvi at qbang.org Sun May 21 20:31:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 May 2006 20:31:31 -0600 (MDT) Subject: [Rxtx] Kernel include files do not match kernel In-Reply-To: <200605221140.03271.andrewlord@internode.on.net> References: <200605221140.03271.andrewlord@internode.on.net> Message-ID: On Mon, 22 May 2006, Andrew Lord wrote: > Hi, > > I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel > 2.6.12-18 with the command: > > ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk > CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include > > However I get the message: > > ## checking java.version 1.5.0_06 > ## checking os.version 2.6.12-18mdk > ## > ## WARNING: Kernel include files do not match the current kernel > ## > ## configure: creating ./config.status > etc. > > Is there a problem with the way I'm specifying the 'include' directory ? If > not, how else can I specify the correct directory for the include files > please ? > Hi Andrew I'm fairly sure your --with-kernel option does nothing. The CPPFLAGS should do what you want. Maybe put an #error message in /usr/src/linux.../incude/linux/version.h But I don't recall a recent problem with version missmatches. It should work. Distros will even ship include files that don't match versions exactly. In theory it should never matter for users. I used to compile new kernels by hand and really didnt have a distro. I didnt have a seperate package of kernel headers for users (myself). When changing a gateway from linux 1.2.12 to 2.1.77, I would worry about such messages. So if you are doing something that weird, the message may be of use to you. If you just see the message on a distro you installed, it is more than likely harmless. -- Trent Jarvi tjarvi at qbang.org From mrogers at spro.net Mon May 22 14:45:39 2006 From: mrogers at spro.net (Mike Rogers) Date: Mon, 22 May 2006 14:45:39 -0600 Subject: [Rxtx] Sun's CommAPI -- think May? Message-ID: <447222F3.9040302@spro.net> Hi, Any word from Sun about progress towards fixing the Java CommAPI v3 "incompatibilities" so RXTX 2.0 can operate within the framework's namespace (javax.comm)? I recall mention of a May time frame. Thanks, Mike From paul.klissner at sun.com Mon May 22 15:09:27 2006 From: paul.klissner at sun.com (Paul Klissner) Date: Mon, 22 May 2006 14:09:27 -0700 Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <447222F3.9040302@spro.net> References: <447222F3.9040302@spro.net> Message-ID: <44722887.8080308@sun.com> Mike Rogers wrote: > Hi, > > Any word from Sun about progress towards fixing the Java CommAPI v3 > "incompatibilities" so RXTX 2.0 can operate within the framework's > namespace (javax.comm)? I recall mention of a May time frame. > > Thanks, > > Mike > We've had a lot of work come in. This hasn't been the only priority. I'm running behind the plan in addressing this, but will be looking at it again soon. Rather than state a new, I'll just say it is in progress, and not off the table. I'll get this fixed as soon as I can. Good timing for asking as we just started discussing javax.comm plans today, and I'll have some cycles to work on it soon. Paul From yhua537 at cse.unsw.edu.au Mon May 22 16:03:05 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Tue, 23 May 2006 08:03:05 +1000 (EST) Subject: [Rxtx] install rxtx in XP Message-ID: Hi Guys, I am new to serial port programming, and have no experience on programming java in xp, but my project require me to builld a communication link between xp and a UART device. Most of the information in the web site seems for linux only. including the commands such as export and chmod. How do I install rxtx in xp? cheers YiQi Huang From mark at mdsh.com Tue May 23 01:24:20 2006 From: mark at mdsh.com (Mark Himsley) Date: Tue, 23 May 2006 08:24:20 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off , it includes DLLs for Windows and the JAR for Java. Follow the Windows instructions in the INSTALL. ie RXTXcomm.jar goes in \jre\lib\ext (under java) rxtxSerial.dll goes in \jre\bin So, assuming a fairly standard Java install, copy RXTXcomm.jar into C:\Program Files\Java\jre1.5.0_06\lib\ext and copy rxtxSerial.dll into C:\Program Files\Java\jre1.5.0_06\bin Yes, it really is that simple. On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > I am new to serial port programming, and have no experience on > programming java in xp, but my project require me to builld a > communication link between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang -- Mark Himsley From joachim at buechse.de Tue May 23 02:51:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 23 May 2006 10:51:47 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) Unless it is absolutely required you should NOT install RXTX in your global Java Runtime Environment. This will for sure create versioning conflicts - if not now, than in the future, if not on your system than at your clients. Instead put the dll in your application directory and include the RXTXcomm.jar in your classpath. This is much safer and not a bit more complicated. Regards, Joachim On 23.05.2006, at 09:24, Mark Himsley wrote: > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR > for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > >> I am new to serial port programming, and have no experience on >> programming java in xp, but my project require me to builld a >> communication link between xp and a UART device. >> >> Most of the information in the web site seems for linux only. >> including >> the commands such as export and chmod. How do I install rxtx in xp? >> >> cheers >> YiQi Huang > > > > -- > Mark Himsley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tod at todbot.com Tue May 23 03:12:22 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 02:12:22 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I totally agree: do not contaminate the Java installation. I put all the RXTX files in a directory and then change my java invocation to be: % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* Alternatively, use Launch4J to create a double-clickable application and keep the RXTX libraries in the directory of the application. -=tod On May 23, 2006, at 1:51 AM, Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > >> Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off >> , it includes DLLs for Windows and the JAR >> for Java. >> >> Follow the Windows instructions in the INSTALL. >> >> ie >> >> RXTXcomm.jar goes in \jre\lib\ext (under java) >> rxtxSerial.dll goes in \jre\bin >> >> So, assuming a fairly standard Java install, copy RXTXcomm.jar into >> C:\Program Files\Java\jre1.5.0_06\lib\ext >> and copy rxtxSerial.dll into >> C:\Program Files\Java\jre1.5.0_06\bin >> >> Yes, it really is that simple. >> >> >> >> On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: >> >>> I am new to serial port programming, and have no experience on >>> programming java in xp, but my project require me to builld a >>> communication link between xp and a UART device. >>> >>> Most of the information in the web site seems for linux only. >>> including >>> the commands such as export and chmod. How do I install rxtx in xp? >>> >>> cheers >>> YiQi Huang >> >> >> >> -- >> Mark Himsley >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From smontgomery at mediaspansoftware.com Tue May 23 08:46:53 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Tue, 23 May 2006 10:46:53 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: Message-ID: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Joachim and Tod mentioned how to keep the files RXTX requires on Windows XP out of the Java installations - thanks gentlemen! Are there similar suggestions for an RXTX install on OS X? The current "canonical" OS X installation instructions "contaminate the Java installation", to use Tod's words. Our app will run fine under 1.4.2 and 5.0 on OS X, and a lot of users will have both. We've already been burned by the recent switch from 1.4.2 to 5.0 as the platform default. Any suggestions welcomed. From tod at todbot.com Tue May 23 13:27:55 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 12:27:55 -0700 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <9BA0F670-A862-42E7-BB2C-130D775ABDF9@todbot.com> Hi Sean, It depends on how you build and deploy your code. If you're using shell scripts, you can do something like this: #!/bin/sh # pick one JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/ Commands/java #JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/ Commands/java $JAVA -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* That both picks which VM to use and uses the RXTX in the directory called 'rxtxlib'. If you want your shell script to be clever, you could test for the existence of the different 'java' executables and go from there (maybe even use different jar files). I am almost positive all OS X systems with Java 1.5 are guaranteed to also have Java 1.4.2. If you're using Jar Builder or XCode, you can specify which JVM to use and add the extra args in the Info.plist file. The paths specified in the 'java' invocation then are based off of the $JAVAROOT variable that the JavaApplicationStub sets for you. For my app, I've have been compiling two sets of jars, one compiled with 1.4.2 and one with 1.5, but they both run under 1.5. So I have a similar shell script that chooses a different 'javac' depending on the need. -=tod On May 23, 2006, at 7:46 AM, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From yhua537 at cse.unsw.edu.au Tue May 23 11:09:37 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 03:09:37 +1000 (EST) Subject: [Rxtx] install rxtx in XP (Mark Himsley, Joachim Buechse, Tod E. Kurt> In-Reply-To: References: Message-ID: > Message: 8 > Date: Tue, 23 May 2006 08:03:05 +1000 (EST) > From: YiQi Huang > Subject: [Rxtx] install rxtx in XP > To: rxtx at qbang.org > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > Hi Guys, > > I am new to serial port programming, and have no experience on programming > java in xp, but my project require me to builld a communication link > between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang > > > ------------------------------ > > Message: 9 > Date: Tue, 23 May 2006 08:24:20 +0100 > From: Mark Himsley > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=us-ascii; format=flowed > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > ------------------------------ > > Message: 10 > Date: Tue, 23 May 2006 10:51:47 +0200 > From: Joachim Buechse > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > > ------------------------------ > > Message: 11 > Date: Tue, 23 May 2006 02:12:22 -0700 > From: "Tod E. Kurt" > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I totally agree: do not contaminate the Java installation. > > I put all the RXTX files in a directory and then change my java > invocation to be: > > % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* > > Alternatively, use Launch4J to create a double-clickable application > and keep the RXTX libraries in the directory of the application. > > -=tod > > Hi, Thanks guys, I don't know if this is the correct way to reply your mecessage, if wrong, please point out. Thank you for Mark to give the detail instructions and Joachim to point out the cons ot installing in the java directory, and specially thanks for Tod to give the instrection in detail. Sorry to ask another stupid question: I have followed Tod's instruction. Now I think i am ready to start hacking. But where is the RXTX API documentation? Is it the same as using normal java comm API? btw, where could i find some examples to start with? Thanks very much cheers YiQi Huang From tjarvi at qbang.org Tue May 23 16:09:32 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 May 2006 16:09:32 -0600 (MDT) Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <44722887.8080308@sun.com> References: <447222F3.9040302@spro.net> <44722887.8080308@sun.com> Message-ID: > Good timing for asking as we just started discussing javax.comm plans > today, and I'll have some cycles to work on it soon. Hi Paul I assume you mean Sun is discussing plans concerning its own internal actions and there is no community involvment at this point. -- Trent Jarvi tjarvi at qbang.org From yhua537 at cse.unsw.edu.au Tue May 23 22:50:01 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 14:50:01 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } From mmester at sps.edu Tue May 23 22:58:21 2006 From: mmester at sps.edu (Michael Mester) Date: Wed, 24 May 2006 00:58:21 -0400 Subject: [Rxtx] install rxtx in XP References: Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below -----Original Message----- From: rxtx-bounces at qbang.org on behalf of YiQi Huang Sent: Wed 5/24/2006 12:50 AM To: RXTX Developers and Users Subject: Re: [Rxtx] install rxtx in XP Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3950 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060523/b36d0c63/attachment-0395.bin From yhua537 at cse.unsw.edu.au Tue May 23 23:05:50 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 15:05:50 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: Yes, Michael you are right, it should be semicolons, But it still can't find the correct library. On Wed, 24 May 2006, Michael Mester wrote: > I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below > > > -----Original Message----- > From: rxtx-bounces at qbang.org on behalf of YiQi Huang > Sent: Wed 5/24/2006 12:50 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] install rxtx in XP > > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > cheers YiQi Huang From tod at todbot.com Wed May 24 00:01:57 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 23:01:57 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Yes, sorry, classpath entries are semicolon-separated on Windows and colon-separated on everything else. Your example code below is importing the wrong set of classes. It should not "import javax.comm.*", instead it should "import gnu.io.*". When I make that change, your example program compiles. The "javax.comm" package is the one released by Sun, the "gnu.io" package is the RXTX one. You might've seen some discussion that the two will be merged or become compatible, but that hasn't happened yet. -=tod On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > > Yes, Michael you are right, it should be semicolons, But it still > can't > find the correct library. > > On Wed, 24 May 2006, Michael Mester wrote: > >> I believe the entries in the classpath need to be seperated with >> semicolons, not a colon as you have in your command below >> >> >> -----Original Message----- >> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >> Sent: Wed 5/24/2006 12:50 AM >> To: RXTX Developers and Users >> Subject: Re: [Rxtx] install rxtx in XP >> >> Hi, >> >> Sorry guys.I follow Tod's instruction, and here is what i did: >> >> put >> RXTXcomm.jar, >> rxtxParallel.dll, >> rxtxSerial.dll >> in >> C:\RXTX_files >> >> and I got a SimpleRead class attached below, compile it with : >> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >> it still saying "cannot find symbol". >> >> Is there anything I did wrong? Do I need the comm.jar from Sun? >> >> Thanks & regards >> YiQi Huang >> >> >> //////////////////////////////////////////////////////// >> // SimpleRead.java >> //////////////////////////////////////////////////////// >> >> import java.io.*; >> import java.util.*; >> import javax.comm.*; >> >> public class SimpleRead >> implements Runnable, SerialPortEventListener { >> static CommPortIdentifier portId; >> static Enumeration portList; >> InputStream inputStream; >> SerialPort serialPort; >> Thread readThread; >> public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == >> CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals("COM1")) { >> //if (portId.getName().equals("/dev/term/a")) { >> SimpleRead reader = new SimpleRead(); >> } >> } >> } >> } >> public SimpleRead() { >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", >> 2000); >> } catch (PortInUseException e) {} >> try { >> inputStream = serialPort.getInputStream(); >> } catch (IOException e) {} >> try { >> serialPort.addEventListener(this); >> } catch (TooManyListenersException e) {} >> serialPort.notifyOnDataAvailable(true); >> try { >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } catch (UnsupportedCommOperationException e) {} >> readThread = new Thread(this); >> readThread.start(); >> } >> public void run() { >> try { >> Thread.sleep(20000); >> } catch (InterruptedException e) {} >> } >> public void serialEvent(SerialPortEvent event) { >> switch(event.getEventType()) { >> case SerialPortEvent.BI: >> case SerialPortEvent.OE: >> case SerialPortEvent.FE: >> case SerialPortEvent.PE: >> case SerialPortEvent.CD: >> case SerialPortEvent.CTS: >> case SerialPortEvent.DSR: >> case SerialPortEvent.RI: >> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >> break; >> case SerialPortEvent.DATA_AVAILABLE: >> byte[] readBuffer = new byte[20]; >> try { >> while (inputStream.available() > 0) { >> int numBytes = inputStream.read(readBuffer); >> } >> System.out.print(new String(readBuffer)); >> } catch (IOException e) {} >> break; >> } >> } >> } >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > cheers > YiQi Huang > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From joachim at buechse.de Wed May 24 00:10:06 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:10:06 +0200 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Hi Sean, my preferred way of dealing with RXTX on OS X is to include the RXTX classes into my application jar and to put the RXTX lib in the same directory as this jar. To make it even more comfortable, you can include the lib in the jar and have some startup code extract it and write it to a temporary file from which you load it with System.load(). Unfortunately the current version of RXTX for OS X requires tinkering with user groups as it is based on lockfiles - and hence it needs the RXTX OS X installer or you need to duplicated this functionality in your own installer. I have created my own native version which is not based on lockfiles but tty locking (the standard way to do it on OSX). I hope that these patches will be integrated soon into the distribution. Regards, Joachim On 23.05.2006, at 16:46, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Wed May 24 00:16:12 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:16:12 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <7017ECFC-B13E-4806-B321-9FFCAC5830F0@buechse.de> I assume you downloaded rxtx-217 (not 207). Instead of importing javax.comm.* you must import gnu.io.* The classes have the same name, but they are not in the same package. On 24.05.2006, at 06:50, YiQi Huang wrote: > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From yhua537 at cse.unsw.edu.au Wed May 24 00:17:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 16:17:45 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Message-ID: Thanks Tod again, i kept reading "gnu.io.*" as "gun.io.*" last few hours after i read some commons from web. Thanks very much Tod. thanks YiQi Huang On Tue, 23 May 2006, Tod E. Kurt wrote: > Yes, sorry, classpath entries are semicolon-separated on Windows and > colon-separated on everything else. > > Your example code below is importing the wrong set of classes. It > should not "import javax.comm.*", instead it should "import > gnu.io.*". When I make that change, your example program compiles. > The "javax.comm" package is the one released by Sun, the "gnu.io" > package is the RXTX one. You might've seen some discussion that the > two will be merged or become compatible, but that hasn't happened yet. > > -=tod > > > On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > >> >> Yes, Michael you are right, it should be semicolons, But it still >> can't >> find the correct library. >> >> On Wed, 24 May 2006, Michael Mester wrote: >> >>> I believe the entries in the classpath need to be seperated with >>> semicolons, not a colon as you have in your command below >>> >>> >>> -----Original Message----- >>> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >>> Sent: Wed 5/24/2006 12:50 AM >>> To: RXTX Developers and Users >>> Subject: Re: [Rxtx] install rxtx in XP >>> >>> Hi, >>> >>> Sorry guys.I follow Tod's instruction, and here is what i did: >>> >>> put >>> RXTXcomm.jar, >>> rxtxParallel.dll, >>> rxtxSerial.dll >>> in >>> C:\RXTX_files >>> >>> and I got a SimpleRead class attached below, compile it with : >>> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >>> it still saying "cannot find symbol". >>> >>> Is there anything I did wrong? Do I need the comm.jar from Sun? >>> >>> Thanks & regards >>> YiQi Huang >>> >>> >>> //////////////////////////////////////////////////////// >>> // SimpleRead.java >>> //////////////////////////////////////////////////////// >>> >>> import java.io.*; >>> import java.util.*; >>> import javax.comm.*; >>> >>> public class SimpleRead >>> implements Runnable, SerialPortEventListener { >>> static CommPortIdentifier portId; >>> static Enumeration portList; >>> InputStream inputStream; >>> SerialPort serialPort; >>> Thread readThread; >>> public static void main(String[] args) { >>> portList = CommPortIdentifier.getPortIdentifiers(); >>> while (portList.hasMoreElements()) { >>> portId = (CommPortIdentifier) portList.nextElement(); >>> if (portId.getPortType() == >>> CommPortIdentifier.PORT_SERIAL) { >>> if (portId.getName().equals("COM1")) { >>> //if (portId.getName().equals("/dev/term/a")) { >>> SimpleRead reader = new SimpleRead(); >>> } >>> } >>> } >>> } >>> public SimpleRead() { >>> try { >>> serialPort = (SerialPort) portId.open("SimpleReadApp", >>> 2000); >>> } catch (PortInUseException e) {} >>> try { >>> inputStream = serialPort.getInputStream(); >>> } catch (IOException e) {} >>> try { >>> serialPort.addEventListener(this); >>> } catch (TooManyListenersException e) {} >>> serialPort.notifyOnDataAvailable(true); >>> try { >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, >>> SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> } catch (UnsupportedCommOperationException e) {} >>> readThread = new Thread(this); >>> readThread.start(); >>> } >>> public void run() { >>> try { >>> Thread.sleep(20000); >>> } catch (InterruptedException e) {} >>> } >>> public void serialEvent(SerialPortEvent event) { >>> switch(event.getEventType()) { >>> case SerialPortEvent.BI: >>> case SerialPortEvent.OE: >>> case SerialPortEvent.FE: >>> case SerialPortEvent.PE: >>> case SerialPortEvent.CD: >>> case SerialPortEvent.CTS: >>> case SerialPortEvent.DSR: >>> case SerialPortEvent.RI: >>> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >>> break; >>> case SerialPortEvent.DATA_AVAILABLE: >>> byte[] readBuffer = new byte[20]; >>> try { >>> while (inputStream.available() > 0) { >>> int numBytes = inputStream.read(readBuffer); >>> } >>> System.out.print(new String(readBuffer)); >>> } catch (IOException e) {} >>> break; >>> } >>> } >>> } >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> >> cheers >> YiQi Huang >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From smontgomery at mediaspansoftware.com Wed May 24 10:24:13 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 12:24:13 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: Tod & Joachim, Thanks for the info, that's very helpful. I'll give that a whirl when I move to rxtx 2.1. I'm still using the older 2.0.7 version for now (don't ask), which probably requires the Sun comm.jar, javax.comm.properties and librxtxSerial.jnilib to be in very specific places in each jvm's file hierarchy. From tjarvi at qbang.org Wed May 24 11:59:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 11:59:16 -0600 (MDT) Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: On Wed, 24 May 2006, Sean Montgomery wrote: > Tod & Joachim, > > Thanks for the info, that's very helpful. I'll give that a whirl > when I move to rxtx 2.1. I'm still using the older 2.0.7 version for > now (don't ask), which probably requires the Sun comm.jar, > javax.comm.properties and librxtxSerial.jnilib to be in very specific > places in each jvm's file hierarchy. > You will need comm.jar from Sun then. It must be Sun's version 2.* or older for Linux or Solaris. I assume they have this in download archives. The default offering from Sun is version 3.0. This version currently does not support rxtx. The older version will probably be fine for your needs. -- Trent Jarvi tjarvi at qbang.org From smontgomery at mediaspansoftware.com Wed May 24 12:19:06 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 14:19:06 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: <3939EFB8-11E1-4E3E-A684-5B3C525577CD@mediaspansoftware.com> Yup, that's right, thanks Trent. I've been using these files for quite a while now. Thanks for bringing it up. I almost didn't mention using 2.0.7 because I didn't want to give any new members of the list the wrong idea! :-) On May 24, 2006, at 1:59 PM, Trent Jarvi wrote: > On Wed, 24 May 2006, Sean Montgomery wrote: > >> Tod & Joachim, >> >> Thanks for the info, that's very helpful. I'll give that a whirl >> when I move to rxtx 2.1. I'm still using the older 2.0.7 version for >> now (don't ask), which probably requires the Sun comm.jar, >> javax.comm.properties and librxtxSerial.jnilib to be in very specific >> places in each jvm's file hierarchy. >> > > You will need comm.jar from Sun then. It must be Sun's version 2.* or > older for Linux or Solaris. I assume they have this in download > archives. > > The default offering from Sun is version 3.0. This version > currently does > not support rxtx. > > The older version will probably be fine for your needs. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mark at mdsh.com Wed May 24 15:55:46 2006 From: mark at mdsh.com (Mark Himsley) Date: Wed, 24 May 2006 22:55:46 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <37B0FC4B1F3237321F093ABE@MacMini.local> On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) That's no problem. BUT, do note that the instructions I elaborated on are in the INSTALL file within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone please update the INSTALL file? > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > > , it includes DLLs for Windows and the JAR > > for Java. > > > > Follow the Windows instructions in the INSTALL. > > > > ie > > > > RXTXcomm.jar goes in \jre\lib\ext (under java) > > rxtxSerial.dll goes in \jre\bin > > > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > > C:\Program Files\Java\jre1.5.0_06\lib\ext > > and copy rxtxSerial.dll into > > C:\Program Files\Java\jre1.5.0_06\bin > > > > Yes, it really is that simple. > > > > > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > > > >> I am new to serial port programming, and have no experience on > >> programming java in xp, but my project require me to builld a > >> communication link between xp and a UART device. > >> > >> Most of the information in the web site seems for linux only. > >> including > >> the commands such as export and chmod. How do I install rxtx in xp? > >> > >> cheers > >> YiQi Huang > > > > > > > > -- > > Mark Himsley > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Mark Himsley From tjarvi at qbang.org Wed May 24 16:41:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 16:41:46 -0600 (MDT) Subject: [Rxtx] install rxtx in XP In-Reply-To: <37B0FC4B1F3237321F093ABE@MacMini.local> References: <37B0FC4B1F3237321F093ABE@MacMini.local> Message-ID: On Wed, 24 May 2006, Mark Himsley wrote: > > > On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > >> I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > That's no problem. > > BUT, do note that the instructions I elaborated on are in the INSTALL file > within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone > please update the INSTALL file? > > The INSTALL file may be updated by anyone at anytime. http://rxtx.qbang.org/wiki/index.php/Installation We are moving it to the wiki so end users may put the type of answers they would like to see in. Sometimes it's best if developers don't give what appears to be cryptic answers. You can even put in that jre/lib/ext is not the right place but you don't understand the classpath solution mentioned on the mail-list and then we know what to add. -- Trent Jarvi tjarvi at qbang.org From stramit at gmail.com Wed May 24 21:45:31 2006 From: stramit at gmail.com (Tim Cooper) Date: Thu, 25 May 2006 13:45:31 +1000 Subject: [Rxtx] Accessing Virtual Com Port Message-ID: Hi, I have to develop an application that talks to a virtual com port (in this case com3) which translates any messages sent across a USB cable to a micro. Using C++ I can talk to this com port and I know that it is configured, present, and working. For the application that I am trying to write I want to use RXTX for the communication. My problem is that the configured virtual port (in windows) is not showing up when I do an enumeration over the available ports. The output I get is (com 3 is not present) : Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 PORT FOUND: COM1 PORT FOUND: LPT1 Is there anything that I need to do to make com3 available to RXTX and my application? Timothy Cooper -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060524/c5591648/attachment-0395.html From antonio.luis at iscte.pt Thu May 25 01:39:13 2006 From: antonio.luis at iscte.pt (=?ISO-8859-1?Q?Ant=F3nio_Lopes?=) Date: Thu, 25 May 2006 08:39:13 +0100 Subject: [Rxtx] RXTX on Pocket PC Message-ID: <44755F21.8060103@iscte.pt> Hello everyone, I've been using RXTX to communicate with serial ports in Windows and it's been quite successful. However, I'm now considering porting my application from Windows to Pocket PC but I can't seem to find the RXTX binaries (*.jar and *.dll) to use in Pocket PC. I've been "digging" on the mailing list's archives and also on the web and I can't find these anywhere. Can anyone in this mailing list give me some pointers on this? Where can I find the necessary files and basic installation instructions? Thanks very much for your help. I very much appreciate any help that you can provide me. Regards, -- Ant?nio Lopes @contact: antonio.luis at iscte.pt @work: ADETTI - ISCTE @web: http://antonio.lopes.googlepages.com/home From doug at dupreeinc.com Fri May 26 15:45:50 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Fri, 26 May 2006 14:45:50 -0700 Subject: [Rxtx] rxtx slow startup Message-ID: <4477770E.9010400@dupreeinc.com> Hello, I hope there are people still reading this mailing list. The archive appeared to not have anything new after 4/2005. I was using the commapi from sun for a project where a java application reads data from test equipment connected to the serial port. I had to upgrade the ftdi vcp driver on my pc and the old sun commapi no longer works with hardware flow control. as an experiment I replaced the javax.com with gnu.io in the SerialDemo.java project that was included with the commapi. This compiled fine using JBuilder 2006 and JRE 1.5.0_05. RXTX also works with the latest ftdi drivers so life is wonderful again... almost... When using the commapi jar the SerialDemo program starts in about 1 second on my system. Using the RXTX jar it takes over 56 seconds to start. Has anyone else seen this problem? Is there a workaround to get the startup performance close to the old commapi? The last thing printed to the console before this delay is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks for your time! Doug From yhua537 at cse.unsw.edu.au Sat May 27 05:46:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 21:46:45 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <4477770E.9010400@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> Message-ID: hi Doug The archive hasn't been update for a long time, But people certainly still reading the list. I don't have enough experience to help on your problem, but without any detail about what your problem doing during that 56 seconds, it is hard to target the your question, I think. cheers YiQi On Fri, 26 May 2006, Doug Thistlethwaite wrote: > Hello, > > I hope there are people still reading this mailing list. The archive > appeared to not have anything new after 4/2005. > > I was using the commapi from sun for a project where a java application > reads data from test equipment connected to the serial port. I had to > upgrade the ftdi vcp driver on my pc and the old sun commapi no longer > works with hardware flow control. as an experiment I replaced the > javax.com with gnu.io in the SerialDemo.java project that was included > with the commapi. This compiled fine using JBuilder 2006 and JRE > 1.5.0_05. RXTX also works with the latest ftdi drivers so life is > wonderful again... almost... > > When using the commapi jar the SerialDemo program starts in about 1 > second on my system. Using the RXTX jar it takes over 56 seconds to > start. Has anyone else seen this problem? Is there a workaround to get > the startup performance close to the old commapi? > > The last thing printed to the console before this delay is: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Thanks for your time! > > Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------- Just a student, Still a student ------------------------------- From yhua537 at cse.unsw.edu.au Sat May 27 06:04:26 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 22:04:26 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: Sorry, I don't think you could understand what I mean .I mean this: Without any detail about what your program is doing during that 56 seconds, it is hard for anyone to target the problem. On Sat, 27 May 2006, YiQi Huang wrote: > hi Doug > > The archive hasn't been update for a long time, But people certainly still > reading the list. > > I don't have enough experience to help on your problem, but without any > detail about what your problem doing during that 56 seconds, it is hard to > target the your question, I think. > > cheers > YiQi > > On Fri, 26 May 2006, Doug Thistlethwaite wrote: > >> Hello, >> >> I hope there are people still reading this mailing list. The archive >> appeared to not have anything new after 4/2005. >> >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From jredman at ergotech.com Sat May 27 08:32:02 2006 From: jredman at ergotech.com (Jim Redman) Date: Sat, 27 May 2006 08:32:02 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: <447862E2.4080506@ergotech.com> Doug, Since you mentioned it, we have a system that is also seems slow. From memory (I don't have one of the slow systems around), I'm not sure that it's consistent, it seems that sometimes it may take longer than others. Since it's part of the bootup it hasn't raised a flag and I haven't researched it. The same code runs much faster on other systems, so now you've got me wondering what's different. The slow system boots DSL (http://www.damnsmalllinux.org/) from a compact flash. FC4 is on my desktop where I haven't noticed a slow down. I think that the rxtx code is the same in both cases with lock files disabled. The slow system has a bunch of serial ports defined, including 4 USB serial ports that do not exist - they are not plugged in. Any clues in there? Jim > On Fri, 26 May 2006, Doug Thistlethwaite wrote: >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Sat May 27 10:41:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 May 2006 10:41:54 -0600 (MDT) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447862E2.4080506@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: On Sat, 27 May 2006, Jim Redman wrote: > Doug, > > Since you mentioned it, we have a system that is also seems slow. From > memory (I don't have one of the slow systems around), I'm not sure that > it's consistent, it seems that sometimes it may take longer than others. > Since it's part of the bootup it hasn't raised a flag and I haven't > researched it. > > The same code runs much faster on other systems, so now you've got me > wondering what's different. > > The slow system boots DSL (http://www.damnsmalllinux.org/) from a > compact flash. FC4 is on my desktop where I haven't noticed a slow > down. I think that the rxtx code is the same in both cases with lock > files disabled. > > The slow system has a bunch of serial ports defined, including 4 USB > serial ports that do not exist - they are not plugged in. > > Any clues in there? > rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. When it does this, it will try to open each port and do a timed out read. most systems will not have entries in device if the port is not there. But some minimal systems will just put all the device files there in case hardware is added. The list of devices scanned used to be ~10-20 times longer than it is today. That was getting very slow. I suspect moving the device files not used to a backup directory would increase the enumeration. I'll look into why the mail-list archive is not updating. The last update was about when I thought I 'fixed' the cron jobs. I probably didn't actually fix it but rather moved the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon May 29 19:46:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 May 2006 19:46:47 -0600 (MDT) Subject: [Rxtx] Mail-List Archives are updating. Message-ID: It was pointed out earlier that the archive is dated. This was a missing crontab entry. The list is currently archived by the week on the web page. It is updated once a day. So every 7 days it starts a new link and updates it daily. I've been limited in what I could do while my cable modem was disconnected this last week. rxtx.org is something I do on my own time. The patches and credits will be comming next. Many of these can be seen in bugzilla right now. -- Trent Jarvi tjarvi at qbang.org From doug at dupreeinc.com Tue May 30 11:18:41 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 10:18:41 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: <447C7E71.4080204@dupreeinc.com> Trent, YiQi, and Jim: Thanks to all for the replies and information! I am just back from a long weekend and I am now trying to figure out what I was doing! :) As for more information. First off, this example is being run under windows XP. I am developing test equipment that communicates with a java application via a serial port. I have been using the commapi for several years and have not had a problem. Recently, I have started a design modification that will replace the RS232 connection with a USB port. I am using the ftdi module for prototyping and I discovered that their virtual com port driver was not compatible with the commapi that Sun released. It turns out that it has problems with hardware flow control ( it works on incoming but not outgoing communications). The way I figured this out was by experimenting with the SerialDemo that was included with the Sum commapi. One nice thing about this example is it has the ability to set incoming and outgoing flow control independently. After I installed RXTX into my JBuilder 2006 IDE, I just replaced all all instances of javax.comm with gnu.io and it compiled and runs without a hitch (except for the slow startup). I Paused the JBuilder IDE during this long pause and the last few entries in the stack trace are: testRead() : -1, gnu.io.RXTXCommDriver registerValidPorts() : 255, gnu.io.RXTXCommDriver registerScannedPorts() : 777, gnu.io.RXTXCommDriver This was all initiated by the following call in the programs init routine: Enumeration en = CommPortIdentifier.getPortIdentifiers(); After looking at this, My guess is that Trent is correct in that the delay is in scanning for ports. I guess one solution would be to not scan for ports, though it would be nice to detect what is available on the system. Is there any way to reduce the number of ports scanned by this function in windows XP? Thanks again for your time, Doug Trent Jarvi wrote: >On Sat, 27 May 2006, Jim Redman wrote: > > > >>Doug, >> >>Since you mentioned it, we have a system that is also seems slow. From >>memory (I don't have one of the slow systems around), I'm not sure that >>it's consistent, it seems that sometimes it may take longer than others. >>Since it's part of the bootup it hasn't raised a flag and I haven't >>researched it. >> >>The same code runs much faster on other systems, so now you've got me >>wondering what's different. >> >>The slow system boots DSL (http://www.damnsmalllinux.org/) from a >>compact flash. FC4 is on my desktop where I haven't noticed a slow >>down. I think that the rxtx code is the same in both cases with lock >>files disabled. >> >>The slow system has a bunch of serial ports defined, including 4 USB >>serial ports that do not exist - they are not plugged in. >> >>Any clues in there? >> >> >> > >rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. > >When it does this, it will try to open each port and do a timed out read. >most systems will not have entries in device if the port is not there. >But some minimal systems will just put all the device files there in case >hardware is added. > >The list of devices scanned used to be ~10-20 times longer than it is >today. That was getting very slow. > >I suspect moving the device files not used to a backup directory would >increase the enumeration. > >I'll look into why the mail-list archive is not updating. The last update >was about when I thought I 'fixed' the cron jobs. I probably didn't >actually fix it but rather moved the problem. > >-- >Trent Jarvi >tjarvi at qbang.org > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/86796453/attachment-0392.html From doug at dupreeinc.com Tue May 30 14:36:09 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 13:36:09 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447C7E71.4080204@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com> Message-ID: <447CACB9.1000801@dupreeinc.com> Hello all, I also notice this pause (not as long however) when I call: CommPortIdentifier.getPortIdentifier(PortName); I would think that if I supply the name of the port, it would not have to go through the same discovery process. If you have any ideas of how to get rid of this startup delay, I would really appreciate it. Thanks, Doug Doug Thistlethwaite wrote: > Trent, YiQi, and Jim: > > Thanks to all for the replies and information! I am just back from a > long weekend and I am now trying to figure out what I was doing! :) > > As for more information. First off, this example is being run under > windows XP. I am developing test equipment that communicates with a > java application via a serial port. I have been using the commapi for > several years and have not had a problem. Recently, I have started a > design modification that will replace the RS232 connection with a USB > port. I am using the ftdi module for prototyping and I discovered > that their virtual com port driver was not compatible with the commapi > that Sun released. It turns out that it has problems with hardware > flow control ( it works on incoming but not outgoing communications). > The way I figured this out was by experimenting with the SerialDemo > that was included with the Sum commapi. One nice thing about this > example is it has the ability to set incoming and outgoing flow > control independently. > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup). > > I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are: > > testRead() : -1, gnu.io.RXTXCommDriver > registerValidPorts() : 255, gnu.io.RXTXCommDriver > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > This was all initiated by the following call in the programs init routine: > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > After looking at this, My guess is that Trent is correct in that the > delay is in scanning for ports. I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system. Is there any way to reduce the number of ports scanned by > this function in windows XP? > > Thanks again for your time, > > Doug > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/edaa5c3c/attachment-0392.html From lynn at swcp.com Tue May 30 15:07:18 2006 From: lynn at swcp.com (lynn@swcp.com) Date: Tue, 30 May 2006 21:07:18 -0000 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CACB9.1000801@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: *IF* the name of the port is supplied, we might want to use the preferences mechanism (java.util.prefs) where we could have previously saved the info for the port. We could do a quick check to see that things have not changed before using it. If things have changed (or never been defined) we would do a full port scan and save detected ports in the preferences. This way if the hardware is not changed, you only pay the time penalty one time. just an idea... Lynn Doug Thistlethwaite said: > This is a multi-part message in MIME format. > --------------070808020900080005070500 > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > Content-Transfer-Encoding: 7bit > > Hello all, > > I also notice this pause (not as long however) when I call: > > CommPortIdentifier.getPortIdentifier(PortName); > > I would think that if I supply the name of the port, it would not have > to go through the same discovery process. If you have any ideas of how > to get rid of this startup delay, I would really appreciate it. > > Thanks, > > Doug > > Doug Thistlethwaite wrote: > > > Trent, YiQi, and Jim: > > > > Thanks to all for the replies and information! I am just back from a > > long weekend and I am now trying to figure out what I was doing! :) > > > > As for more information. First off, this example is being run under > > windows XP. I am developing test equipment that communicates with a > > java application via a serial port. I have been using the commapi for > > several years and have not had a problem. Recently, I have started a > > design modification that will replace the RS232 connection with a USB > > port. I am using the ftdi module for prototyping and I discovered > > that their virtual com port driver was not compatible with the commapi > > that Sun released. It turns out that it has problems with hardware > > flow control ( it works on incoming but not outgoing communications). > > The way I figured this out was by experimenting with the SerialDemo > > that was included with the Sum commapi. One nice thing about this > > example is it has the ability to set incoming and outgoing flow > > control independently. > > > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > > all instances of javax.comm with gnu.io and it compiled and runs > > without a hitch (except for the slow startup). > > > > I Paused the JBuilder IDE during this long pause and the last few > > entries in the stack trace are: > > > > testRead() : -1, gnu.io.RXTXCommDriver > > registerValidPorts() : 255, gnu.io.RXTXCommDriver > > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > > > This was all initiated by the following call in the programs init routine: > > > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > > > After looking at this, My guess is that Trent is correct in that the > > delay is in scanning for ports. I guess one solution would be to not > > scan for ports, though it would be nice to detect what is available on > > the system. Is there any way to reduce the number of ports scanned by > > this function in windows XP? > > > > Thanks again for your time, > > > > Doug > > > > --------------070808020900080005070500 > Content-Type: text/html; charset=ISO-8859-1 > Content-Transfer-Encoding: 7bit > > > > > > > > > Hello all,
>
> I also notice this pause (not as long however) when I call:
>
>          CommPortIdentifier.getPortIdentifier(PortName);
>
> I would think that if I supply the name of the port, it would not have > to go through the same discovery process.  If you have any ideas of how > to get rid of this startup delay, I would really appreciate it.
>
> Thanks,
>
> Doug
>
> Doug Thistlethwaite wrote: >
> > Trent, YiQi, and Jim:
>
> Thanks to all for the replies and information!  I am just back from a > long weekend and I am now trying to figure out what I was doing! :)
>
> As for more information.  First off, this example is being run under > windows XP.  I am developing test equipment that communicates with a > java application via a serial port.  I have been using the commapi for > several years and have not had a problem.  Recently, I have started a > design modification that will replace the RS232 connection with a USB > port.  I am using the ftdi module for prototyping and I discovered that > their virtual com port driver was not compatible with the commapi that > Sun released.  It turns out that it has problems with hardware flow > control ( it works on incoming but not outgoing communications).  The > way I figured this out was by experimenting with the SerialDemo that > was included with the Sum commapi.  One nice thing about this example > is it has the ability to set incoming and outgoing flow control > independently.
>
> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup).
>
> I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are:
>
> testRead() : -1, gnu.io.RXTXCommDriver
> registerValidPorts() : 255, gnu.io.RXTXCommDriver
> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>
> This was all initiated by the following call in the programs init > routine:
>
> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>
> After looking at this,  My guess is that Trent is correct in that the > delay is in scanning for ports.  I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system.  Is there any way to reduce the number of ports scanned by > this function in windows XP? 
>
> Thanks again for your time,
>
> Doug
>
>
> > > > --------------070808020900080005070500-- > -- From jredman at ergotech.com Tue May 30 15:42:35 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 30 May 2006 15:42:35 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: <447CBC4B.2080206@ergotech.com> Lynn, If I understand your idea correctly, I don't think that this would work well for, say, USB ports since these can be easily added/removed by the end user. Jim lynn at swcp.com wrote: > *IF* the name of the port is supplied, we might want to use the preferences > mechanism (java.util.prefs) where we could have previously saved the info for > the port. We could do a quick check to see that things have not changed > before using it. If things have changed (or never been defined) we would do a > full port scan and save detected ports in the preferences. > > This way if the hardware is not changed, you only pay the time penalty one time. > > just an idea... > Lynn > > > Doug Thistlethwaite said: > >> This is a multi-part message in MIME format. >> --------------070808020900080005070500 >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >> Content-Transfer-Encoding: 7bit >> >> Hello all, >> >> I also notice this pause (not as long however) when I call: >> >> CommPortIdentifier.getPortIdentifier(PortName); >> >> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process. If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it. >> >> Thanks, >> >> Doug >> >> Doug Thistlethwaite wrote: >> >>> Trent, YiQi, and Jim: >>> >>> Thanks to all for the replies and information! I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :) >>> >>> As for more information. First off, this example is being run under >>> windows XP. I am developing test equipment that communicates with a >>> java application via a serial port. I have been using the commapi for >>> several years and have not had a problem. Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port. I am using the ftdi module for prototyping and I discovered >>> that their virtual com port driver was not compatible with the commapi >>> that Sun released. It turns out that it has problems with hardware >>> flow control ( it works on incoming but not outgoing communications). >>> The way I figured this out was by experimenting with the SerialDemo >>> that was included with the Sum commapi. One nice thing about this >>> example is it has the ability to set incoming and outgoing flow >>> control independently. >>> >>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup). >>> >>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are: >>> >>> testRead() : -1, gnu.io.RXTXCommDriver >>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>> >>> This was all initiated by the following call in the programs init routine: >>> >>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>> >>> After looking at this, My guess is that Trent is correct in that the >>> delay is in scanning for ports. I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system. Is there any way to reduce the number of ports scanned by >>> this function in windows XP? >>> >>> Thanks again for your time, >>> >>> Doug >>> >> --------------070808020900080005070500 >> Content-Type: text/html; charset=ISO-8859-1 >> Content-Transfer-Encoding: 7bit >> >> >> >> >> >> >> >> >> Hello all,
>>
>> I also notice this pause (not as long however) when I call:
>>
>>         >  CommPortIdentifier.getPortIdentifier(PortName);
>>
>> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process.  If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it.
>>
>> Thanks,
>>
>> Doug
>>
>> Doug Thistlethwaite wrote: >>
>> >> Trent, YiQi, and Jim:
>>
>> Thanks to all for the replies and information!  I am just back from a >> long weekend and I am now trying to figure out what I was doing! :)
>>
>> As for more information.  First off, this example is being run under >> windows XP.  I am developing test equipment that communicates with a >> java application via a serial port.  I have been using the commapi for >> several years and have not had a problem.  Recently, I have started a >> design modification that will replace the RS232 connection with a USB >> port.  I am using the ftdi module for prototyping and I discovered that >> their virtual com port driver was not compatible with the commapi that >> Sun released.  It turns out that it has problems with hardware flow >> control ( it works on incoming but not outgoing communications).  The >> way I figured this out was by experimenting with the SerialDemo that >> was included with the Sum commapi.  One nice thing about this example >> is it has the ability to set incoming and outgoing flow control >> independently.
>>
>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >> all instances of javax.comm with gnu.io and it compiled and runs >> without a hitch (except for the slow startup).
>>
>> I Paused the JBuilder IDE during this long pause and the last few >> entries in the stack trace are:
>>
>> testRead() : -1, gnu.io.RXTXCommDriver
>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>
>> This was all initiated by the following call in the programs init >> routine:
>>
>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>
>> After looking at this,  My guess is that Trent is correct in that the >> delay is in scanning for ports.  I guess one solution would be to not >> scan for ports, though it would be nice to detect what is available on >> the system.  Is there any way to reduce the number of ports scanned by >> this function in windows XP? 
>>
>> Thanks again for your time,
>>
>> Doug
>>
>>
>> >> >> >> --------------070808020900080005070500-- >> > > > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From yhua537 at cse.unsw.edu.au Tue May 30 18:10:23 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 31 May 2006 10:10:23 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CBC4B.2080206@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: Doug, In the SerialDemo, it allow us to save the parameters into a file, and use it when your program start up. Would this help? YiQi On Tue, 30 May 2006, Jim Redman wrote: > Lynn, > > If I understand your idea correctly, I don't think that this would work > well for, say, USB ports since these can be easily added/removed by the > end user. > > Jim > > lynn at swcp.com wrote: >> *IF* the name of the port is supplied, we might want to use the preferences >> mechanism (java.util.prefs) where we could have previously saved the info for >> the port. We could do a quick check to see that things have not changed >> before using it. If things have changed (or never been defined) we would do a >> full port scan and save detected ports in the preferences. >> >> This way if the hardware is not changed, you only pay the time penalty one time. >> >> just an idea... >> Lynn >> >> >> Doug Thistlethwaite said: >> >>> This is a multi-part message in MIME format. >>> --------------070808020900080005070500 >>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>> Content-Transfer-Encoding: 7bit >>> >>> Hello all, >>> >>> I also notice this pause (not as long however) when I call: >>> >>> CommPortIdentifier.getPortIdentifier(PortName); >>> >>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process. If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it. >>> >>> Thanks, >>> >>> Doug >>> >>> Doug Thistlethwaite wrote: >>> >>>> Trent, YiQi, and Jim: >>>> >>>> Thanks to all for the replies and information! I am just back from a >>>> long weekend and I am now trying to figure out what I was doing! :) >>>> >>>> As for more information. First off, this example is being run under >>>> windows XP. I am developing test equipment that communicates with a >>>> java application via a serial port. I have been using the commapi for >>>> several years and have not had a problem. Recently, I have started a >>>> design modification that will replace the RS232 connection with a USB >>>> port. I am using the ftdi module for prototyping and I discovered >>>> that their virtual com port driver was not compatible with the commapi >>>> that Sun released. It turns out that it has problems with hardware >>>> flow control ( it works on incoming but not outgoing communications). >>>> The way I figured this out was by experimenting with the SerialDemo >>>> that was included with the Sum commapi. One nice thing about this >>>> example is it has the ability to set incoming and outgoing flow >>>> control independently. >>>> >>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>> all instances of javax.comm with gnu.io and it compiled and runs >>>> without a hitch (except for the slow startup). >>>> >>>> I Paused the JBuilder IDE during this long pause and the last few >>>> entries in the stack trace are: >>>> >>>> testRead() : -1, gnu.io.RXTXCommDriver >>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>> >>>> This was all initiated by the following call in the programs init routine: >>>> >>>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>> >>>> After looking at this, My guess is that Trent is correct in that the >>>> delay is in scanning for ports. I guess one solution would be to not >>>> scan for ports, though it would be nice to detect what is available on >>>> the system. Is there any way to reduce the number of ports scanned by >>>> this function in windows XP? >>>> >>>> Thanks again for your time, >>>> >>>> Doug >>>> >>> --------------070808020900080005070500 >>> Content-Type: text/html; charset=ISO-8859-1 >>> Content-Transfer-Encoding: 7bit >>> >>> >>> >>> >>> >>> >>> >>> >>> Hello all,
>>>
>>> I also notice this pause (not as long however) when I call:
>>>
>>>         >>  CommPortIdentifier.getPortIdentifier(PortName);
>>>
>>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process.  If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it.
>>>
>>> Thanks,
>>>
>>> Doug
>>>
>>> Doug Thistlethwaite wrote: >>>
>>> >>> Trent, YiQi, and Jim:
>>>
>>> Thanks to all for the replies and information!  I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :)
>>>
>>> As for more information.  First off, this example is being run under >>> windows XP.  I am developing test equipment that communicates with a >>> java application via a serial port.  I have been using the commapi for >>> several years and have not had a problem.  Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port.  I am using the ftdi module for prototyping and I discovered that >>> their virtual com port driver was not compatible with the commapi that >>> Sun released.  It turns out that it has problems with hardware flow >>> control ( it works on incoming but not outgoing communications).  The >>> way I figured this out was by experimenting with the SerialDemo that >>> was included with the Sum commapi.  One nice thing about this example >>> is it has the ability to set incoming and outgoing flow control >>> independently.
>>>
>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup).
>>>
>>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are:
>>>
>>> testRead() : -1, gnu.io.RXTXCommDriver
>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>
>>> This was all initiated by the following call in the programs init >>> routine:
>>>
>>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>
>>> After looking at this,  My guess is that Trent is correct in that the >>> delay is in scanning for ports.  I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system.  Is there any way to reduce the number of ports scanned by >>> this function in windows XP? 
>>>
>>> Thanks again for your time,
>>>
>>> Doug
>>>
>>>
>>> >>> >>> >>> --------------070808020900080005070500-- >>> >> >> >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From halbleib at rechnerbetriebsgruppe.de Wed May 31 02:06:16 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 10:06:16 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp Message-ID: <447D4E78.30302@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, I getting an error while reloading my app in tomcat. At the first start everything runs well, but if i reload mit webapp by tomcat manager i get the following error. java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader Is there a possibility to unload the native library rxtxSerial.dll? thx for all help! regards tom -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 b8FT80HQ1xlbDLnRecDANCc= =heb1 -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 02:52:17 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 10:52:17 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D4E78.30302@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> Message-ID: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Hello Tom, To the best of my knowledge it is impossible to unload native libraries once loaded into the JVM. The exception you see stems from the fact, that Tomcat creates a new classloader when you "reload" the weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar is loaded from the session class loader. Try to add RXTXComm.jar to your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. Regards, Joachim On 31.05.2006, at 10:06, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 > b8FT80HQ1xlbDLnRecDANCc= > =heb1 > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From halbleib at rechnerbetriebsgruppe.de Wed May 31 03:28:35 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 11:28:35 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Message-ID: <447D61C3.1030807@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Joachim, I'm still not getting it. How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml-file? Perhaps web.xml? Regards, Tom Joachim Buechse schrieb: > Hello Tom, > > To the best of my knowledge it is impossible to unload native > libraries once loaded into the JVM. The exception you see stems from > the fact, that Tomcat creates a new classloader when you "reload" the > weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar > is loaded from the session class loader. Try to add RXTXComm.jar to > your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. > > Regards, > Joachim > > On 31.05.2006, at 10:06, Tom Halbleib wrote: > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL tzNy+/0iIUfkYYgt1+UT1ko= =pkpY -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 04:03:42 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 12:03:42 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D61C3.1030807@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> <447D61C3.1030807@rechnerbetriebsgruppe.de> Message-ID: -Xbootclasspath/a: is a start option to the java vm. Google is your friend in finding how to modfiy it and what it means: tomcat modifying bootclasspath Regards, Joachim On 31.05.2006, at 11:28, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Joachim, > > I'm still not getting it. > How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml- > file? > Perhaps web.xml? > > Regards, > Tom > > Joachim Buechse schrieb: >> Hello Tom, >> >> To the best of my knowledge it is impossible to unload native >> libraries once loaded into the JVM. The exception you see stems from >> the fact, that Tomcat creates a new classloader when you "reload" the >> weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar >> is loaded from the session class loader. Try to add RXTXComm.jar to >> your bootlclasspath (-Xbootclasspath/a:) and the problem should go >> away. >> >> Regards, >> Joachim >> >> On 31.05.2006, at 10:06, Tom Halbleib wrote: >> >> Hi all, >> >> I getting an error while reloading my app in tomcat. At the first >> start >> everything runs well, but if i reload mit webapp by tomcat manager >> i get >> the following error. >> >> java.lang.UnsatisfiedLinkError: Native Library >> C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in >> another classloader thrown while loading gnu.io.RXTXCommDriver >> Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: >> Native >> Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already >> loaded >> in another classloader >> >> >> Is there a possibility to unload the native library rxtxSerial.dll? >> >> thx for all help! >> >> regards >> >> tom > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL > tzNy+/0iIUfkYYgt1+UT1ko= > =pkpY > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From impakt01 at optusnet.com.au Wed May 31 06:55:42 2006 From: impakt01 at optusnet.com.au (Daren) Date: Wed, 31 May 2006 22:55:42 +1000 Subject: [Rxtx] (no subject) Message-ID: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/ade7ad37/attachment-0392.html From doug at dupreeinc.com Wed May 31 10:19:19 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 31 May 2006 09:19:19 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: <447DC207.3070702@dupreeinc.com> I am not sure what you are saying. The Save parameters menu option saves the current settings (baud, data bits, etc.). The long pause (~60 seconds) is when the application first starts (before loading the saved parameters). This does bring up a question, though I hate this type of kludge approach to getting this library to work... What exactly is a PortIdentifier? Is it always the same? If I stored the results from "CommPortIdentifier.getPortIdentifier(PortName);" in a file, could I use this the next time the program is executed? In this case I am using a virtual com port driver to connect to the device through a USB port. Doug YiQi Huang wrote: >Doug, > >In the SerialDemo, it allow us to save the parameters into a file, and use >it when your program start up. Would this help? > >YiQi > >On Tue, 30 May 2006, Jim Redman wrote: > > > >>Lynn, >> >>If I understand your idea correctly, I don't think that this would work >>well for, say, USB ports since these can be easily added/removed by the >>end user. >> >>Jim >> >>lynn at swcp.com wrote: >> >> >>>*IF* the name of the port is supplied, we might want to use the preferences >>>mechanism (java.util.prefs) where we could have previously saved the info for >>>the port. We could do a quick check to see that things have not changed >>>before using it. If things have changed (or never been defined) we would do a >>>full port scan and save detected ports in the preferences. >>> >>>This way if the hardware is not changed, you only pay the time penalty one time. >>> >>>just an idea... >>>Lynn >>> >>> >>>Doug Thistlethwaite said: >>> >>> >>> >>>>This is a multi-part message in MIME format. >>>>--------------070808020900080005070500 >>>>Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>>>Content-Transfer-Encoding: 7bit >>>> >>>>Hello all, >>>> >>>>I also notice this pause (not as long however) when I call: >>>> >>>> CommPortIdentifier.getPortIdentifier(PortName); >>>> >>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process. If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it. >>>> >>>>Thanks, >>>> >>>>Doug >>>> >>>>Doug Thistlethwaite wrote: >>>> >>>> >>>> >>>>>Trent, YiQi, and Jim: >>>>> >>>>>Thanks to all for the replies and information! I am just back from a >>>>>long weekend and I am now trying to figure out what I was doing! :) >>>>> >>>>>As for more information. First off, this example is being run under >>>>>windows XP. I am developing test equipment that communicates with a >>>>>java application via a serial port. I have been using the commapi for >>>>>several years and have not had a problem. Recently, I have started a >>>>>design modification that will replace the RS232 connection with a USB >>>>>port. I am using the ftdi module for prototyping and I discovered >>>>>that their virtual com port driver was not compatible with the commapi >>>>>that Sun released. It turns out that it has problems with hardware >>>>>flow control ( it works on incoming but not outgoing communications). >>>>>The way I figured this out was by experimenting with the SerialDemo >>>>>that was included with the Sum commapi. One nice thing about this >>>>>example is it has the ability to set incoming and outgoing flow >>>>>control independently. >>>>> >>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>>without a hitch (except for the slow startup). >>>>> >>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>>entries in the stack trace are: >>>>> >>>>>testRead() : -1, gnu.io.RXTXCommDriver >>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>>> >>>>>This was all initiated by the following call in the programs init routine: >>>>> >>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>>> >>>>>After looking at this, My guess is that Trent is correct in that the >>>>>delay is in scanning for ports. I guess one solution would be to not >>>>>scan for ports, though it would be nice to detect what is available on >>>>>the system. Is there any way to reduce the number of ports scanned by >>>>>this function in windows XP? >>>>> >>>>>Thanks again for your time, >>>>> >>>>>Doug >>>>> >>>>> >>>>> >>>>--------------070808020900080005070500 >>>>Content-Type: text/html; charset=ISO-8859-1 >>>>Content-Transfer-Encoding: 7bit >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>>Hello all,
>>>>
>>>>I also notice this pause (not as long however) when I call:
>>>>
>>>>        >>>> >>>> >>> CommPortIdentifier.getPortIdentifier(PortName);
>>> >>> >>>>
>>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process.  If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it.
>>>>
>>>>Thanks,
>>>>
>>>>Doug
>>>>
>>>>Doug Thistlethwaite wrote: >>>>
>>>> >>>>Trent, YiQi, and Jim:
>>>>
>>>>Thanks to all for the replies and information!  I am just back from a >>>>long weekend and I am now trying to figure out what I was doing! :)
>>>>
>>>>As for more information.  First off, this example is being run under >>>>windows XP.  I am developing test equipment that communicates with a >>>>java application via a serial port.  I have been using the commapi for >>>>several years and have not had a problem.  Recently, I have started a >>>>design modification that will replace the RS232 connection with a USB >>>>port.  I am using the ftdi module for prototyping and I discovered that >>>>their virtual com port driver was not compatible with the commapi that >>>>Sun released.  It turns out that it has problems with hardware flow >>>>control ( it works on incoming but not outgoing communications).  The >>>>way I figured this out was by experimenting with the SerialDemo that >>>>was included with the Sum commapi.  One nice thing about this example >>>>is it has the ability to set incoming and outgoing flow control >>>>independently.
>>>>
>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>without a hitch (except for the slow startup).
>>>>
>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>entries in the stack trace are:
>>>>
>>>>testRead() : -1, gnu.io.RXTXCommDriver
>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>>
>>>>This was all initiated by the following call in the programs init >>>>routine:
>>>>
>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>>
>>>>After looking at this,  My guess is that Trent is correct in that the >>>>delay is in scanning for ports.  I guess one solution would be to not >>>>scan for ports, though it would be nice to detect what is available on >>>>the system.  Is there any way to reduce the number of ports scanned by >>>>this function in windows XP? 
>>>>
>>>>Thanks again for your time,
>>>>
>>>>Doug
>>>>
>>>>
>>>> >>>> >>>> >>>>--------------070808020900080005070500-- >>>> >>>> >>>> >>> >>> >>> >>-- >>Jim Redman >>(505) 662 5156 x85 >>http://www.ergotech.com >>_______________________________________________ >>Rxtx mailing list >>Rxtx at qbang.org >>http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > >cheers >YiQi Huang >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/61d4d4c9/attachment-0391.html From impakt01 at optusnet.com.au Wed May 31 17:02:54 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 09:02:54 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Message-ID: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Hi all, I downloaded 2.1.7-pre16 and managed to build it and get it going. I made the changes as suggested by Peter Smith in an old post, by adding his code to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. Still not working, it opens the port at 9600 according to portmon.exe . Has anyone managed to get this going at a custom rate? Here is the post I'm referring to: http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 Thanks, Daren ________________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Daren Sent: Wednesday, 31 May 2006 10:56 PM To: rxtx at qbang.org Subject: [Rxtx] (no subject) Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren From tjarvi at qbang.org Wed May 31 21:44:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 May 2006 21:44:01 -0600 (MDT) Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> References: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Message-ID: On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org From impakt01 at optusnet.com.au Wed May 31 22:06:04 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 14:06:04 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: Message-ID: <200606010406.k51464X2010447@mail03.syd.optusnet.com.au> Trent, I have managed to successfully open the port at this speed using Realterm (available on sourceforge). From memory this uses DLPortIO. Using portmon.exe with realterm, even there it says that the port has opened at 1953. I changed termios.c:560 to dcb->BaudRate = 1953 ; and it still opens the port at 9600. Daren -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Thursday, 1 June 2006 1:44 PM To: RXTX Developers and Users Subject: Re: [Rxtx] custom baud rate win32 On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From smontgomery at mediaspansoftware.com Mon May 1 09:52:28 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 11:52:28 -0400 Subject: [Rxtx] RXTX, Java COMM and Windows Server 2003 on x64 experiences? Message-ID: Just wondering if anybody here has had to deploy RXTX or the javax.comm on Windows Server 2003 machines running on x64 (i.e. Xeon EM64T) and would like to relate how things went. From Sun's site, the Supported System Configurations pages give the options for that system: Java 5.0: - 32-bit Java 5.0 running on the OS in the 32-bit mode - 64-bit Java 5.0 running on the OS in the 64-bit native mode Java 1.4.2: - no options listed for EM64T processors, but potentially the standard 32-bit Java 1.4.2 could run on the OS in 32-bit mode? I guess the two main points of failure would be 1) the JVM itself and 2) the jni components. Make that three: there's gotta be hardware vendor driver support for the OS in the various modes, too. Guess I better go look at Keyspan's website... Thanks in advance for any info anyone might be able to provide. From smontgomery at mediaspansoftware.com Mon May 1 10:18:33 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 12:18:33 -0400 Subject: [Rxtx] Mailing list archive out of date? Message-ID: The mailing list archive at: http://mailman.qbang.org/pipermail/rxtx/ only shows emails through the end of March. Is there a new archive somewhere else? Didn't see anything mentioned on the wiki. From p.cain at phasefale.com.au Mon May 1 22:33:09 2006 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 02 May 2006 14:33:09 +1000 Subject: [Rxtx] RXTX and the Linux kernel. Message-ID: <4456E105.5080106@phasefale.com.au> Hi, First off the problem I am having isn't caused by RXTX itself but I'm hoping someone out there may have some knowledge that may help me. Background: I have an application monitoring a control system through a standard PC serial port which I talk to with rxtx-2.0.5. The application runs on RedHat7.3 kernel version 2.4.18 using Java 1.4. This configuration has been in use for several years and has proved to be stable. But it has become necessary for me to upgrade the OS but I'm running into problems with the serial communications. Its not that the comms don't work on the new OS (its never that simple) the comms work for a variable period of time (sometimes several hours) and then just stop, nothing on the data lines and control lines all indicate that data could flow. The new OS is Ubuntu 5.10 running kernel version 2.6.12. I have installed the OS and software on a PC and had it perform ok, then install the new OS and same software on the very same hardware and experienced the problems of them comms stopping. In the new OS I'm using Java5 to run the app but since I have experience the problem I reverted back to Java1.4 which didn't fix the problem. I've moved the app to a different system RedHat FC3 running 2.6.14 had experienced the problem. Not wanting to go through all the thing I have tried but I have established that it seems to be the 2.6 versions of the kernel that seem to be the problem and not an individual distribution of Linux. I should point out that I am using the same jar and library files for each java and OS combination. So I'm just wondering if anyone has had or heard of problems similar to these ? Or perhaps might know of what changed in the Linux serial driver (something I'm having a hard time establishing). I'm starting to run low on ideas of what to try so any help would be much appreciated. -- Peter Cain Senior Programmer Phasefale Pty Ltd From tjarvi at qbang.org Wed May 3 07:31:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 May 2006 07:31:00 -0600 (MDT) Subject: [Rxtx] Re: Concering ircomm and RXTX In-Reply-To: References: Message-ID: On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From legolas.w at gmail.com Wed May 3 08:46:23 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 19:16:23 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <4458C23F.2000003@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From legolas.w at gmail.com Wed May 3 13:10:57 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 23:40:57 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <44590041.80706@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From Lars.Hennig at wow-portal.com Thu May 4 00:39:15 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Thu, 4 May 2006 08:39:15 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: Message-ID: Hi, I could not find any solution. I therefore decided to to my own native implementation. Allthough it only supports the functions I need, it works pretty well now for me. I think the main problem there is the use of a wrong Windows API function and not setting an timeout. Regards, Lars Hennig W?rth Online World GmbH Tel. (0049)7181-258183 Mob. (0049)160-3522889 Fax. (0049)7940-153299 Lars.Hennig at wow-portal.com Gesendet von: rxtx-bounces at qbang.org 09.04.2006 10:42 Bitte antworten zu RXTX Developers and Users An d.herwald at dsh-elektronik.de, RXTX Developers and Users Kopie Thema Re: [Rxtx] USB Serialport - disconnection problems WV Proj./Teilpr.: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/7b39f374/attachment-0396.html From Pawan.Kharbanda at dot.state.co.us Thu May 4 11:00:58 2006 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Thu, 4 May 2006 11:00:58 -0600 Subject: [Rxtx] Dangling Lock Files Message-ID: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Hi, I have been using RXTX API's for the Serial Communication for quite some time now and for some of the devices we are opening and closing the connection every 2 minutes. This works great for few days and then suddenly I start seeing some "Port in Use Exception" and I see that the Lock files are still in the /var/lock folder after manually removing the lock files it works good for few hours and I see the same problem again. Can somebody explain me the scenarios why I am seeing the dangling Lock files? I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise Servers. Thanks Pawan Kharbanda -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/ba0e9261/attachment-0396.html From tjarvi at qbang.org Thu May 4 14:10:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:10:30 -0600 (MDT) Subject: [Rxtx] Dangling Lock Files In-Reply-To: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> References: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Message-ID: On Thu, 4 May 2006, Kharbanda, Pawan wrote: > Hi, > I have been using RXTX API's for the Serial Communication for quite > some time now and for some of the devices we are opening and closing the > connection every 2 minutes. This works great for few days and then > suddenly I start seeing some "Port in Use Exception" and I see that the > Lock files are still in the /var/lock folder after manually removing the > lock files it works good for few hours and I see the same problem again. > Can somebody explain me the scenarios why I am seeing the dangling Lock > files? > > I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise > Servers. Hi Pawan The next time it happens, look in the lockfile. There will be a pid. ps aux |grep 'pid' I think you will see that the application is still running for some reason. RXTX does a kill -0 on the pid to see if its alive. If not, it will remove the lockfile. So I suspect the previous program did not exit as you expected. -- Trent Jarvi tjarvi at qbang.org From Scott.Hughes at dalsemi.com Thu May 4 14:23:11 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 4 May 2006 15:23:11 -0500 Subject: [Rxtx] Wiki instructions... Message-ID: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire demo apps, when I stumbled across this tip on the wiki to add yourself to the uucp group: It may be simpler to just run usermod -G uucp jarvi Taken from: http://rxtx.qbang.org/wiki/index.php/Installation This does not work as advertised. I should have read the man page for usermod before I tried that out. If there are any groups which are not listed after the -G switch, the user is removed from those groups. On Ubuntu, this is bad... I removed myself from the Admin group, which removed my sudo priviledges. Ubuntu has no root account, so I've disabled the only account which could fix it. Anyone know of a good workaround? Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor From tjarvi at qbang.org Thu May 4 14:32:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:32:09 -0600 (MDT) Subject: [Rxtx] Wiki instructions... In-Reply-To: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> Message-ID: On Thu, 4 May 2006, Scott Hughes wrote: > I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire > demo apps, when I stumbled across this tip on the wiki to add yourself to > the uucp group: > > It may be simpler to just run > > usermod -G uucp jarvi > > Taken from: > http://rxtx.qbang.org/wiki/index.php/Installation > > This does not work as advertised. I should have read the man page for > usermod before I tried that out. If there are any groups which are not > listed after the -G switch, the user is removed from those groups. On > Ubuntu, this is bad... I removed myself from the Admin group, which removed > my sudo priviledges. Ubuntu has no root account, so I've disabled the only > account which could fix it. > > Anyone know of a good workaround? > Yikes This will get your permissions back: in grub/lilo/.. pass the following option to the kernel init=/bin/sh You are now root. when it boots, mount -o remount,rw / add yourself to the groups, reboot to get normal init going. Thats about all I can think of without sudo/root. -- Trent Jarvi tjarvi at qbang.org From Gettings at earth.utah.edu Thu May 4 14:41:22 2006 From: Gettings at earth.utah.edu (Paul Gettings) Date: Thu, 4 May 2006 14:41:22 -0600 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <20060504204122.GA6534@earth.utah.edu> When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get messages on stdout from the JVM: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 As the only change was the version of RXTX (from 2.1.6), I am unsure why the messages suddenly appeared. Anyone know how to get rid of them? Thanks. -- 101 USES FOR A DEAD MICROPROCESSOR (23) Dead cat brush From mmester at sps.edu Mon May 1 21:22:28 2006 From: mmester at sps.edu (Michael Mester) Date: Mon, 1 May 2006 23:22:28 -0400 Subject: [Rxtx] Windows PortInUseException Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> I'm trying to get simple serial communication going with RxTx under Windows XP. I can enumerate the ports fine, but I always run into problems when I try to open one. I get a PortInUseException, but the owner application is "Unknown" and the port is never open. I've tried this on several different systems and all of them give the same behavior. The only thing I can thiunk of that might be causing the problem is that fact that I had to put the serial .dll file in system32 instead of the reccommended folder, because it didn't work in the folder the documentation gives. The library loads fine, though, so I'm not sure whether that makes sense, and I don't know how to fix it anyway. Any help is greatly appreciated. Below is the output of the program, right up to the PortInUseException and the NullPointerException it causes (because the serial port object is not instantiated). C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI Starting GPSTalkerGUI... Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 gnu.io.PortInUseException: Unknown Application Exception in thread "main" java.lang.NullPointerException at GPSTalkerGUI.(GPSTalkerGUI.java:102) at GPSTalkerGUI.main(GPSTalkerGUI.java:161) Again, thank you very much for any help you can give. From lshellman at qwest.net Wed May 3 01:38:34 2006 From: lshellman at qwest.net (Lucious Shellman) Date: Wed, 03 May 2006 01:38:34 -0600 Subject: [Rxtx] Help needed: Project using parallel port Message-ID: <1146641914.8337.14.camel@localhost.localdomain> I was looking for a way to access the parallel port on a PC using Java. Searching the Internet, I came across this site (rxtx.org). What I am trying to do is detect logic levels from a TTL logic IC on the parallel port. I am not trying to do classic parallel port communication. I just want to detect whether a line(s) is (are) high or low. I am using Windows 98. Can rxtx be used to do this? If yes, is there a tutorial for using rxtx posted on the Internet that someone can direct me to. If you need more information, feel free to e-mail me. Unfortunately for me, I need the information ASAP. Thanks. lshellman at qwest.net From webmaster at egyhelp.com Wed May 3 18:43:39 2006 From: webmaster at egyhelp.com (Mohamed Samy) Date: Thu, 4 May 2006 02:43:39 +0200 Subject: [Rxtx] RE: Concering ircomm and RXTX In-Reply-To: Message-ID: <20060503184362.SM01044@Geek> Hey, I issue the command "modprobe ircomm-tty" yet no ttyircomm appears, while the ircomm appear by "modprobe ircomm" so forgive me but I am bit lost. Even searching google for the keyword "ttyircomm" only returns 3 matches. So any way I can start the ttyircomm???? Thanks a lot. -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Wednesday, May 03, 2006 3:31 PM To: Mohamed Samy; rxtx at qbang.org Cc: taj at www.linux.org.uk Subject: Re: Concering ircomm and RXTX On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 4 15:49:49 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 15:49:49 -0600 (MDT) Subject: [Rxtx] Windows PortInUseException In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> Message-ID: On Mon, 1 May 2006, Michael Mester wrote: > > I'm trying to get simple serial communication going with RxTx under > Windows XP. I can enumerate the ports fine, but I always run into > problems when I try to open one. I get a PortInUseException, but the > owner application is "Unknown" and the port is never open. I've tried > this on several different systems and all of them give the same > behavior. The only thing I can thiunk of that might be causing the > problem is that fact that I had to put the serial .dll file in system32 > instead of the reccommended folder, because it didn't work in the folder > the documentation gives. The library loads fine, though, so I'm not sure > whether that makes sense, and I don't know how to fix it anyway. Any > help is greatly appreciated. Below is the output of the program, right > up to the PortInUseException and the NullPointerException it causes > (because the serial port object is not instantiated). > > C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI > Starting GPSTalkerGUI... > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > gnu.io.PortInUseException: Unknown Application > Exception in thread "main" java.lang.NullPointerException > at GPSTalkerGUI.(GPSTalkerGUI.java:102) > at GPSTalkerGUI.main(GPSTalkerGUI.java:161) > Perhaps you are trying to open the port twice in your code? rxtx does open the ports, do a timed out read and then close the ports during enumeration. I think the port is being opened fine. The Unknown Application is always reported. On linux, there is some code that finds the actual application but on windows, its always unknown. If the port enumeration is returning the ports you expect, rxtx has opened the port and closed it with success. The port should open. There is also example code in the contrib directory that comes with rxtx source that has examples you can modify to work. -- Trent Jarvi tjarvi at qbang.org From Christian.Klemke at t-online.de Thu May 4 23:37:23 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Fri, 5 May 2006 07:37:23 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu> Message-ID: <004f01c67005$fc72fee0$016a10ac@NB600> Hi Paul, I was wondering about the same question some days ago and took a look at the source files. Unfortunately, I found that you can only get rid of that messages by altering and recompiling the Java code. There is a final static boolean variable called "devel" in the file "RXTXCommDriver.java" which is set to "true". This constellation causes the output after the native libraries have been loaded. No mechanism exists to suppress them otherwise :-(. Trent, does that mean that 2.1.7 is still officially a "development" version ? When will this value be changed to "false" by default ? With 2.1.8 ? It would be nice to provide a means to suppress such messages besides that static flag (maybe by setting a property called "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The output can indeed by annoying, especially when used with console applications, where the message potentially appears "in the middle" of your own output. Another possibility would be not to use System.out directly, but instead some PrintStream field which is initially set to System.out but can programatically be changed. That would allow for any kind of redirection or suppression by implementing appropriate user-defined PrintStream subclasses and making RXTX use that stream. What do you think ? Best regards, Christian ----- Original Message ----- From: "Paul Gettings" To: Sent: Thursday, May 04, 2006 10:41 PM Subject: [Rxtx] RXTX causing stdout messages > When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get > messages on stdout from the JVM: > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > As the only change was the version of RXTX (from 2.1.6), I am unsure > why the messages suddenly appeared. Anyone know how to get rid of > them? > > Thanks. > > -- > 101 USES FOR A DEAD MICROPROCESSOR > (23) Dead cat brush > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri May 5 06:09:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 06:09:46 -0600 (MDT) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <004f01c67005$fc72fee0$016a10ac@NB600> References: <20060504204122.GA6534@earth.utah.edu> <004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: On Fri, 5 May 2006, Christian Klemke wrote: > Hi Paul, > > I was wondering about the same question some days ago and took a look at the > source files. Unfortunately, I found that you can only get rid of that > messages by altering and recompiling the Java code. There is a final static > boolean variable called "devel" in the file "RXTXCommDriver.java" which is > set to "true". This constellation causes the output after the native > libraries have been loaded. No mechanism exists to suppress them otherwise > :-(. > > Trent, does that mean that 2.1.7 is still officially a "development" version > ? When will this value be changed to "false" by default ? With 2.1.8 ? It > would be nice to provide a means to suppress such messages besides that > static flag (maybe by setting a property called > "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The > output can indeed by annoying, especially when used with console > applications, where the message potentially appears "in the middle" of your > own output. Another possibility would be not to use System.out directly, but > instead some PrintStream field which is initially set to System.out but can > programatically be changed. That would allow for any kind of redirection or > suppression by implementing appropriate user-defined PrintStream subclasses > and making RXTX use that stream. What do you think ? > A patch for using properties would be accepted I'm sure. The reason the default is to display the message is not related to the development state of rxtx anymore. The problem is that people first using rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. The message prevents a great deal of email thats easily explained by the message. I question if we should support rxtx 2.0 at all anymore. If you post a patch in bugzilla, we'll put it into CVS this weekend. we'll be going through and doing such things anyhow. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri May 5 13:23:56 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 13:23:56 -0600 (MDT) Subject: [Rxtx] How to read from RxTx parallel port in Win XP In-Reply-To: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> References: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> Message-ID: On Thu, 27 Apr 2006, Worsley, Bob (Development Engineer) wrote: > I'm sorry if this is a dumb question, but I didn't find the answer in > the archives. > > I'm using the RxTx binaries for Windows on a reasonably current notebook > PC running Windows XP. I can send stuff to a printer on the parallel > port (LPT1), but I can't get anything back. > > I wrote a class that has the methods listed below. I write some data to > the printer with the "write" method and then try to read a response > using the "read" method, but I never get any data. I'd greatly > appreciate any help you can give! > > Bob Worsley > bobwoyid2 at yahoo.com > > > > > private ParallelPort parallelPort = null; > private RXTXCommDriver parallelPortDriver = null; > > > public boolean initialize() throws IOException { > if (parallelPort != null) { > return false; // Already initialized > } > > // Create the parallel port; > parallelPortDriver = new RXTXCommDriver(); > parallelPort = > (ParallelPort)parallelPortDriver.getCommPort(address, > CommPortIdentifier.PORT_PARALLEL); > > // Set the parallel port parameters. > try { > parallelPort.enableReceiveTimeout(READ_TIMEOUT); > parallelPort.disableReceiveFraming(); > parallelPort.disableReceiveThreshold(); > //parallelPort.setMode(mode); !!!!errors > } catch (UnsupportedCommOperationException e) { > throw (new IOException("Parallel port with address '" + > address > + "' cannot be configured as specified")); > } > > return true; > } > > > > public void write(final byte[] bytes) throws IOException { > initialize(); > while (busyReading) { > Thread.yield(); > } > busyWriting = true; > if (bytes.length < 1) { > return; > } > OutputStream outputStream = parallelPort.getOutputStream(); > outputStream.write(bytes); > outputStream.flush(); > outputStream.close(); > Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); > busyWriting = false; > } > > > public byte[] read() throws IOException { > > // Read up to MAX_BYTES bytes. > initialize(); > while (busyWriting) { > Thread.yield(); > } > busyReading = true; > byte[] buff = new byte[MAX_BYTES_READ]; > InputStream inputStream = parallelPort.getInputStream(); > // This read blocks until input data is available > int bytesRead = inputStream.read(buff); > inputStream.close(); > // If no data read, create empty array > if (bytesRead == -1) { > bytesRead = 0; > } > byte[] deviceBytes = new byte[bytesRead]; > System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); > if (bytesRead > 0) { > Debug.p("PPIOP.read - got data: '" + new > String(deviceBytes) + "'"); > } > busyReading = false; > return deviceBytes; > } > Hi Bob I've only used rxtx to test a hello world page printing but there are others that have used it. PPIOP? hmm what is this? :) The rxtx parallel support is behind the serial support but should be OK. As you note, the setting of modes is not supported. rxtx uses what is provided when the port is open. Are your asserting the pin for the printer being online? I suspect what often happens is people try to just use the data pins but the C API rxtx uses wants the printer to be online. There should be some posts relating to this in the rxtx mail-list archive. Some APIs are probably reading and writing from the port address (also suggested in your code as something you are looking at). RXTX currently uses a higher level C/C++ API for port access. This can still work if the API thinks the 'printer' is there. -- Trent Jarvi tjarvi at qbang.org From agrodellic at gmail.com Sat May 6 08:39:40 2006 From: agrodellic at gmail.com (Leigh Stewart) Date: Sat, 6 May 2006 10:39:40 -0400 Subject: [Rxtx] sun commapi 3 Message-ID: I think I read here: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html that rxtx-2.0 is basically fracked for now? Does anyone know of a workaround? ie can i somehow get an older version of sun's comm api and use that (not easy to find)? i mean 2.0 must be working for someone...how is it being tested. 2.1 isnt working for me....im getting nasty native exceptions etc, which is why im so set on 2.0... any ideas? From tjarvi at qbang.org Sun May 7 15:40:27 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 7 May 2006 15:40:27 -0600 (MDT) Subject: [Rxtx] sun commapi 3 In-Reply-To: References: Message-ID: On Sat, 6 May 2006, Leigh Stewart wrote: > > 2.1 isnt working for me....im getting nasty native exceptions etc, > which is why im so set on 2.0... any ideas? > Hi Leigh What native exceptions are you seeing? Which OS? The native code is almost identical between rxtx 2.0 and 2.1. Only the names have been changed to protect the inocent. :) ie: javax_comm_... vs gnu_io_... So the odds are very likely that even if you do find commapi 2.0 and get it installed, you will run into the same error. It would be better to just find and fix the problem. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Mon May 8 10:47:20 2006 From: mail at willicon.de (WILLICon) Date: Mon, 08 May 2006 18:47:20 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 Message-ID: <445F7618.3070303@willicon.de> Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/ef37e8ec/attachment-0396.html From tjarvi at qbang.org Mon May 8 16:14:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 May 2006 16:14:51 -0600 (MDT) Subject: [Rxtx] Screenshot of Application using RXTX (fwd) Message-ID: Just though someone may end up searching for 0x0D and 0x0A. Here are the details from his system. SuSE Linux 10.0 (x86_64) Kernel 2.6.13-15.8 j2se 1.4.2_11 (i586) Sun: comm3.0_u1 rxtx: rxtx-2.1-7 ---------- Forwarded message ---------- Date: Sat, 6 May 2006 20:01:46 +0200 From: Michael Poppitz To: taj at www.linux.org.uk Subject: Screenshot of Application using RXTX Hi Trent, the rxtx package works like a charm. Sun's package seemed to replace all 0x0D with 0x0A in received data on my Linux box, which is really annoying when transfering binary data. But rxtx came and saved the day - and turned out to be a lot more convenient as it does not require a configuration file. I use it for connecting to a home made logic analyzer. (http://www.sump.org/projects/analyzer/) Thanks for your great job, Michael -------------- next part -------------- A non-text attachment was scrubbed... Name: la_client.png Type: image/png Size: 16592 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/45494fbb/la_client-0396.png From tjarvi at qbang.org Tue May 9 14:56:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 May 2006 14:56:05 -0600 (MDT) Subject: [Rxtx] RXTX javax.comm: which one to install? In-Reply-To: <20060509161742.43547.qmail@web53814.mail.yahoo.com> References: <20060509161742.43547.qmail@web53814.mail.yahoo.com> Message-ID: On Tue, 9 May 2006, Adenilson Cavalcanti wrote: > Dear Trent Jarvi > > I'm trying to write a small Java app running in linux that interfaces with a device connected to serial port. > > I do have some questions about RXTX and javax.comm state of affairs, since I'm new to Java programming (used to program in plain old C writting to devices using termios and open/write/read syscalls, but this is another story). > > I ask you the favor to clarify this issues (if possible...): > > a) Sun offers to download a file (comm3.0_u1_PUTAUNIXVERSION.zip) which does contain .so files. Does it work out of box? > > b) Case negative, its there that we should use 'librxtx*.so' provided by your site? > > c) Sun's comm3 API version does work with which version of rxtx? > > I already searched google and read documentation available in rxtx site ("Java Comm Serial API How-to") but still have this issues unsolved. Any help will be appreciated. > > Best regards > > Adenilson Hi Adenilson, RXTX does not currently support javax.comm in Sun's CommAPI 3.0. I would recommend using package gnu.io provided by rxtx 2.1. -- Trent Jarvi tjarvi at qbang.org From chris.develder at intec.ugent.be Wed May 10 08:45:40 2006 From: chris.develder at intec.ugent.be (Chris Develder) Date: Wed, 10 May 2006 16:45:40 +0200 Subject: [Rxtx] rxtx troubles on ARM Message-ID: <4461FC94.6040909@intec.ugent.be> Hi all, Sorry to bother you, but I don't seem to get RXTX working on an ARM processor (xscale ixp 425, big endian). I managed to crosscompile the rxtx libs and moved it over to the ARM. Using jamvm (which is the only open source java VM we got working on the ARM), I get the following error result when running SimpleRead from Sun's javax.comm examples (commapi\examples\Simple\SimpleRead) -- see bottom of mail for complete output: "java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver" However, output shows that the RXTXCommDriver code is accessible (cf. debug and devel output of lib versions). So it doesn't seem to be a missing lib/jar issue. The error happens before RXTXCommDriver.initialize() is called, since the first line there is System.out.println("RXTXCommDriver:initialize()"); Any ideas? Cheers, Chris ---------------------------- [root at xxx(ttyp1) /work/cdvelder/xscale/test]# jamvm -Djava.library.path=/work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/jre/lib/arm -classpath /work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/lib/ext/RXTXcomm.jar:./comm.jar:. SimpleRead RXTXCommDriver {} Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTXCommDriver: Jar version = RXTX-2.1-7 native lib Version = RXTX-2.1-7 java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver gnu/io/RXTXCommDriver at javax.comm.CommPortIdentifier.loadDriver (CommPortIdentifier.java:239) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:109) at SimpleRead.main (Unknown Source) java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive (Native Method) at com.sun.comm.Portmapping.registerCommPorts (Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase (Portmapping.java:100) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:138) at SimpleRead.main (Unknown Source) From joachim at buechse.de Fri May 12 00:44:48 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 08:44:48 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) Message-ID: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Good day, I guess that only a selected few (hi Trent) will be able to answer this question, but the answer might be interesting for anyone trying to debug or understand the code. Apparently the MonitorThread is started and stopped in RXTXPort.addEventListener and RXTXPort.removeEventListener. This would indicate that (originally?) the MonitorThread is only required when there is an EventListener. However the MonitorThread is also started in the RXTXPort constructor, which could mean that RXTX won't work at all if it isn't there. It seems to me, that if anyone would add an event listener and later on remove it, he could potentially wreak the port. Because the second action would kill the MonitorThread. For the moment I am only trying to understand the role of and idea behind the MonitorThread. But of course there is a deeper reason thor my question: If the MonitorThread needs to exist anyway, it could be the thread that cleans up the port (ie calls nativeClose) - this would eliminate (a further) problem I am seeing with some USB drivers on Mac OSX. (Close blocks (after releasing the tty, but still) in the USB driver if the device is "not responding"). Greetings, Joachim From tjarvi at qbang.org Fri May 12 07:10:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 12 May 2006 07:10:59 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Fri, 12 May 2006, Joachim Buechse wrote: > Good day, > > I guess that only a selected few (hi Trent) will be able to answer > this question, but the answer might be interesting for anyone trying > to debug or understand the code. > > Apparently the MonitorThread is started and stopped in > RXTXPort.addEventListener and RXTXPort.removeEventListener. This > would indicate that (originally?) the MonitorThread is only required > when there is an EventListener. However the MonitorThread is also > started in the RXTXPort constructor, which could mean that RXTX won't > work at all if it isn't there. > > It seems to me, that if anyone would add an event listener and later > on remove it, he could potentially wreak the port. Because the second > action would kill the MonitorThread. > > > For the moment I am only trying to understand the role of and idea > behind the MonitorThread. But of course there is a deeper reason thor > my question: > > If the MonitorThread needs to exist anyway, it could be the thread > that cleans up the port (ie calls nativeClose) - this would eliminate > (a further) problem I am seeing with some USB drivers on Mac OSX. > (Close blocks (after releasing the tty, but still) in the USB driver > if the device is "not responding"). > Hi Jaochim Before commapi, rxtx did not support events. You could read, write and change port settings. The MonitorThread was added as an afterthought to support commapi events. So the way things are now his historical spaghetti not a well devised plan. It is my opinion that the MonitorThread should exist as long as the port is open. The odd starting of the thread in the constructor and addEventListener was just to get past the obvious problem of people using the port without adding listeners. -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Fri May 12 07:59:50 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 15:59:50 +0200 Subject: [Rxtx] MonitorThread -> ChangeRequest In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: <2B1E508C-8CEE-4AB7-914D-E7BA25C871A2@buechse.de> In this case I suggest removing the starting/stopping of MonitorThread in addEventListener / removeEventListener. This should not affect existing projects. On 12.05.2006, at 15:10, Trent Jarvi wrote: > It is my opinion that the MonitorThread should exist as long as the > port > is open. The odd starting of the thread in the constructor and > addEventListener was just to get past the obvious problem of people > using > the port without adding listeners. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Fri May 12 11:43:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 19:43:21 +0200 Subject: [Rxtx] Spring Cleaning - some suggestions Message-ID: The current implementation of RXTX contains quite a lot of code that will break if it is used from several threads (especially on a multi processor machine). I think it would be nice to clean this up. I suggest the following changes (which keep the current semantics and should not influence existing projects in a negative way): - InterruptedException will never be ignored or reset - read methods will be protected with a Monitor - write methods will be protected with a (separate) Monitor - close() sets the read and write monitors into a "closed" state which will lead to IOExceptions for any following call to RXTXPort.read/write. - close() will wait a finite amount of time (maybe 500ms) for the release of the read and write monitors after that, it will trigger the closing of the file descriptor to abort any pending read or write. - close() will not call close(file_desc). Instead it will "interrupt" (ie set a flag and then, pthread_kill(ABRT)) the MonitorThread, the MonitorThread will call close(file_desc). - the monitors are properly released in a finally block the try of which starts directly after obtaining the monitor. - finally will not call close(file_desc) it will only "interrupt" the MonitorThread (see above) - the native-code (esp read) does not use SA_RESTART but checks Thread.interrupted() when it receives a SIGNAL (ie system call returns with EINTR or other signalling method). The read/write monitors will be allocated from a factory whose mode can be set to fast/normal/advanced. In fast-mode it will create "non thread safe, non synchronized" pseudo-monitors. In default mode, the monitors will store the owning thread. In "advanced" mode setting the monitors into closed state will "interrupt()" threads which are blocked in a native read/write. {Reasoning close behaviour: Calling close on a file descriptor in Windows unblocks any read() or write() on the same file descriptor with an error. On Solaris < 2.7 and MacOS X however the close() will/ can block - until the read or write have finished:-(( Even the JDK people have trouble with this. I dont know how Linux reacts in this case. The best practice for BSD/Solaris is to send a signal to the thread which will usually unblock the read/write with an EINTR - this however is not guarenteed as it also depends on the device driver. So the only resolution that will certainly not block the thread calling RXTXPort.close() (which will often enough be the AWT event dispatcher or the VM finalizer thread) is to call close(fd) from another thread.} {Reasoning read behaviour: It is rather uncommon to receive a signal while reading or writing - it will happen, but checking Thread.interrupted() when it happens will not degrade performance. The checking of Thread.interrupted() can be handled by returning to Java and potententially reentering into the native code if the thread was not interrupted or by calling back into the VM from the native code. On top of this, many functions like read(byte[]) or read(byte [], int, int) are allowed to return less than the requested amount of data. Only int read() is a bit more tricky. } [Trent: From the code I can tell, that you experimented quite a bit with signals. Do you know if the Java Thread.interrupt() triggers a unix signal on Linux/Solaris? If so, which one?? References: - http://java.sun.com/docs/hotspot/VMOptions.html - http://www.hp.com/products1/unix/java/infolibrary/prog_guide/ signals.html ] On OS X (hotspot client jdk-1.4.2) I did not see any signal propagated to the SELECT of the event_loop/MonitorThread (ie no EINTR) when I call monThread.interrupt(). This is a pitty, but thats the way it is. I simply assume this is true for most system calls. How to handle this? Of course it would be possible to install/ deinstall a specific signal handler before/after every native read and to natively send an ABRT signal if RXTXPort.close is called. A more elegant solution might be to have an additional "signaling" socket which is always included in the SELECT. Or the simplest solution: cap the timeout of the select to 500 ms (the loop around it exists already) after every timeout check the Thread.interrupted() flag. From a performance perspective this should be completely invisible... On the other hand, all write() calls need to be preceeded by a SELECT as well, to avoid running into a blocking write. Best regards, Joachim From lyon at docjava.com Sat May 13 05:54:52 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 13 May 2006 07:54:52 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Dmitry suggests that we acquire an implementation of a serial port reference, use it, then release it (i.e., check it back in). Joachim says that making serial ports thread friendly might be a good idea. This is a good idea. The design pattern that is close to this idea is the "Object Pool Design Pattern". # Object Pool Manage the reuse of objects for a type of object that is expensive to create or only a limited number of a kind of object can be created. It has been described at: http://www.developer.com/java/ent/article.php/626171 and in Marks' book, Patterns in Java, Volume 1. However, the Object Pool is intended to pool objects so that each object is just like every other object. The intent of the Parametric Singleton is to enable others to access the same resource at the same time (as long as the same parameters were used in construction). It sounds like we need a NEW Design Pattern (Oh no, Doug is doing it again!). Yes friends, you got me on a role (roll) :) If you like design patterns, you can thank me later. If you don't like design patterns, blame Dmitry, it was his idea ;) And Dave, thanks for the feedback on Singleton abuse. It has led me to change the way I think about application contexts, which we will see, below. We need (drum roll please): The Parametric Object Pool Design Pattern (POP) By Douglas A. Lyon ABSTRACT The goal of the Parametric Singleton design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values, in a given context. In comparison, the goal of the POP design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values and that only one reference to the class is checked out at a time, in a given context. A context is a namespace for holding identifiers during execution. In Java, A context can be changed in any of several ways. For example, creation of a new class loader, the deserialization of an old POP or the creation of a new process all create a new namespace. The POP Design Pattern combines the Parametric Singleton Design Pattern with the check out mechanism of the Object Pool Design Pattern. This enables unique creation of instances of a class. These instances are cached in a table. When a clients asks for an instance with these parameters, the cache is checked. If the instance is not in the cache it is created. If the instance is available, the clients checks out the instance. A reference is left to the clients that checked out the instance. The POP has the role of creating objects uniquely, from parameters. It also has the role of keeping track of which clients has checked out a given object. This is just like a library keeping track of who borrowed a book. If a resource is left unavailable in a system, a deadlock can occur. Deadlock debugging is facilitated by mapping a resource to the clients that have checked it out. We apply our POP Design Pattern to the retrieval of serial ports. The goal of our system is to make sure that serial ports are checked out to only one client at a time, and that they be checked back in when the client is done. The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. Users are discouraged from calling this the Parametric Object Oriented Pool (POOP). Introduction The intent of the POP Design Pattern is to ensure that a class has only one instance for a given set of parameter values. It also provides a point of access that is global to a given context. The POP uses the Singleton Design Pattern to ensure that there is only one POP, in the given context. The POP DP is responsible for checking out a reference to a given instance, and keeping track of that instance. The instance is responsible for sharing that instance. POP requires that users of the DP implement an interface that enables a recall facility. Thus, if there is a contention for a consumed resource, the deadlock can be resolved in an orderly fashion. Motivation A system cannot tolerate multiple instances of some classes with identical parameters used by different instances at the same time. For example, you cannot have two instances use the same serial port, at the same time. You cannot have two instances that are trying to listen to the same socket connection. You cannot have two instances writing to the same file structure at the same time. Further, once a serial port is checked out by a client, it is assigned to the client. This is like the spin-lock service provided by the operating system, only in the application layer. Naturally, deadlock will occur if a resource is not released, therefore the client of the resource is tracked. Recalling a resource is required for the POP DP by virtue of the implementation of an interface. The policy on how to break a deadlock (by honoring the recall) is application specific. As the operating system is often thought of as the arbiter of consumed resources (i.e., tape drives, serial ports, etc.) we frequently leave it to an operating system implementation to resolve these contention issues. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on naming conventions (which are not well standardized). The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. The POP Design Pattern can take on the role of the peer method mapper that homogenizes the API for different operating environments. That is, it can wrapper the different locking mechanisms used in different operating systems. POP that is responsible for keeping track of the instances created and the client that has checked them out. The POP Design Pattern is implemented using the Singleton Design Pattern. In Java, the POP implementation is declared final, so that it cannot be subclassed. The class also has a private constructor, so that other classes cannot instance it. The new design pattern is called the POP design pattern and it provides a way to check out and create instances with given parameters. Applicability Use the POP Design Pattern when: 1. There must be exactly one instance of a class with the given parameters in a given context. 2. The instances must be accessible to clients from a well-known access point. 3. The instances are reusable. 4. Only one client can check out an instance at a time. Structure Insert UML diagram here. Participants The POP Clients that need instances 1. The POP defines an instance upon request from a client, if, and only if, the instance does not already exist. 2. The POP returns the instance to the client. 3. The POP is responsible for creating unique instances from given parameters. 4. The POP is responsible to recalling instances from clients. Collaborations Clients obtain a reference to a POP instance only through the singleton design pattern. If the POP instance is left in an improper state (e.g., the serial port was left open) it is NOT the role of the POP to close the IO port. However, the POP can be requested to get the instance released. Nor is it the role of the POP Design Pattern to open the port. That role is delegate to some other part of the system. Further, it is the role of the POP Design Pattern to check out resources. However, it is still possible to have, multiple threads that have multiple references to the same resource at the same time. Checkout and resource requests are MUTEX locked (i.e., synchronized). Consequences The POP Design Pattern has several benefits: 1. Controlled access to parametrically defined instances. Since the POP encapsulates its instances, there is some limited control over how and when clients access it. 2. Reduced name space. The POP pattern avoids global variables that store instances created from the same parameter. Implementation Here are implementation issues to consider when using the POP pattern: 1. Unique mapping of parameters. The POP pattern requires that there be a mean to isomorphically map the parameter space into the instance space and back again. 2. Ensure unique instances. The POP pattern makes unique instances from parameters, and it does so only once. 3. Cache instances for fast retrieval. The POP must be able to look up instances, given some set of parameters, and do so from some data structure. That is, there must be enough space to hold references to all the instances the program will need. Also, a mechanism is needed to look up and retrieve the instances quickly enough to satisfy the clients. Sample Code To be written....any volunteers? Thanks! - Doug >I don't think I get it > >On Mar 22, 2006, at 9:36 AM, David Garnier wrote: >>Using the singleton pattern in this case is >>just convenient for the programmer. Problems >>arises >>pretty quickly, especially if you attempt to unit-test your classes. > > >so you're saying that something isn't so good >because you can not test it in the convenient >way? >if that's true, I'm totally disagree >change your test, debug whatever, but if >software is efficient at runtime, works fine and >only problem is some unit test >(which is some kind of framework for testing) >then dump that unit test , dump that unit >framework and make something appropriate to the >software >you're testing > >so if Douglas want to use singletons, what's the problem? >and what do you mean by abusing of singleton usage? > >of course singleton doesn't prevent concurrent >access to the resource across the processes >unless >you're using some OS facility to prevent it, besides >singleton as it was introduced is relevant only >and only inside of the same process >otherwise it's not singleton it's something else >(let's say network singleton: so you have remote >invocation facility >and some factory method that return object created by that facility) > >I don't have any problem with using any kind of singletons. > Parametric Singleton idea (if I understand it >right) could be easily implemented in the >following way: >use a map >populate map with instances of some class and key is your parameter >(you can use lazy population too) > >if somebody ask the key check the value if it's null so resource is taken >if somebody returns the resource put it back to the map > >public synchronized static Object getSomeResource(Object parameter); >public synchronized static void returnResource(Object parameter); > >getSomeResource (inside of the same process) could return null in 2 cases >1. if somebody (from other thread for example) already took that resource >2. if OS API said that resource corresponded to >that parameter (serial port with parameter = 1 >(port #)) >is locked and unavailable; >I'm not sure that in case of serial ports we >even need those Parametric Singletons >(unless lock checking is a very expensive operation) >just ask the OS about availability of that >resource and if it's available give it away >and then OS will lock it and therefore in next >time somebody ask it just answer that resource >is locked >and return null > >for example system has 2 serial ports available >so I ask getResource("tty"); >or I ask getResource("Bluetooth-Modem"); > >and if OS is ok you can give tty or Bluetooth-Modem or both > >no need for any additional pattern I think > >back to the problem >mac os x doesn't recognize locking via files, so >it handles locking via some API >an instance of the singleton in each process >should recognize that resource is locked >(by using that API) that's all >we don't have to make things more complicate >then they are just because there is some nice >design pattern or nice unit test framework or whatever >keep things simple, make them work fast, don't introduce middle layers >unless you have really good reason to do so > >of course I could be entirely wrong, so sorry about that in advance > >thanks > > >Dmitry Markman > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx >Good day, > >I guess that only a selected few (hi Trent) will be able to answer? >this question, but the answer might be interesting for anyone trying? >to debug or understand the code. > >Apparently the MonitorThread is started and stopped in? >RXTXPort.addEventListener and RXTXPort.removeEventListener. This? >would indicate that (originally?) the MonitorThread is only required? >when there is an EventListener. However the MonitorThread is also? >started in the RXTXPort constructor, which could mean that RXTX won't? >work at all if it isn't there. > >It seems to me, that if anyone would add an event listener and later? >on remove it, he could potentially wreak the port. Because the second? >action would kill the MonitorThread. > > >For the moment I am only trying to understand the role of and idea? >behind the MonitorThread. But of course there is a deeper reason thor? >my question: > >If the MonitorThread needs to exist anyway, it could be the thread? >that cleans up the port (ie calls nativeClose) - this would eliminate? >(a further) problem I am seeing with some USB drivers on Mac OSX.? >(Close blocks (after releasing the tty, but still) in the USB driver? >if the device is "not responding"). > >Greetings, >Joachim > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Sat May 13 10:07:37 2006 From: joachim at buechse.de (Joachim Buechse) Date: Sat, 13 May 2006 18:07:37 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Douglas, Looking at the current code, leaves me with the feeling, that there is a lot to do. Defining an API that wraps javax.comm to provide what you describe is certainly possible, but I wonder how much benefit it will actually provide. Personally I think the API defined by javax.comm "request/lock" a port with: cp= new CommunicationPort(identifier) "release" a port with: cp.close(); works quite nice for 99% of the applications. In my experience, the most efficient and elegant implementation is to wrap a port/socket/.. into a business object which declares the remote operations that are possible. Ie "uploadFile", "waitForPrompt", "getSerialNumber", "sendContact", "executeCommand", etc Those methods are then either synchronized or guarded by a monitor. I do not see how your design pattern applied to the port resource would help implementing this. [details start, skip if you agree to the above] When I talked about "thread-safe" I didn't mean several independent "sessions" accessing the port concurrently. I think this is a very rare usage. I believe the most common use case for serial ports today is the control of an external device from a PC running a GUI based application. To implement a clean Swing/AWT-GUI one needs to pass any action that can block to a "worker" thread (else the GUI blocks, the application appears dead). While it is possible to use own prespawned thread that will accept Runnables which operate on the port, this is not very elegant. It is more common to spawn a new thread for every action triggered by the user. Additionally the ABORT of a running operation is often implemented via a port.close() delegated to a different thread. - During the lifetime of a port, it will usually be accessed from several different threads. Instance variables need to be set/read in synchronized regions to guarantee a correct operation based on the Java memory model. - Synchronizing the access is usually handled on the application level (synchronizing the reads/writes is usually useless from the applications view because it is not a transaction mechanism). [details end] I am very open to learn about other scenarios where your proposed design pattern applied to the port resource is beneficial to the application implementor. Best regards, Joachim On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > Dmitry suggests that we acquire an implementation of > a serial port reference, use it, then release it (i.e., check it > back in). > > Joachim says that making serial ports thread friendly might be a > good idea. > > This is a good idea. The design pattern that is close to this idea > is the "Object Pool Design Pattern". > # Object Pool From jredman at ergotech.com Sun May 14 14:28:24 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 14:28:24 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers Message-ID: <446792E8.4000506@ergotech.com> Does anyone know of any work to make RXTX work with Ethernet (telent) Terminal Servers? If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? We've used RXTX with upwards of 100 virtual COM ports on Windows and it works well. Linux is more problematic. It would be good to have an OS independent solution to accesses remote Ethernet serial ports. Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From legolas.w at gmail.com Sun May 14 14:26:34 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:56:34 +0430 Subject: [Rxtx] does any one have a working sample of RXTX and LPT port Message-ID: <4467927A.4000008@gmail.com> Hi Thank you for reading my post does any one has a working sample for RXTX and LPT port ? Thanks From legolas.w at gmail.com Sun May 14 14:27:29 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:57:29 +0430 Subject: [Rxtx] does RXTX support Trigerr on parallel port? Message-ID: <446792B1.4040905@gmail.com> Hi does RXTX support trigger on LPT port ? if so , how i can use it ? Thanks From tjarvi at qbang.org Sun May 14 17:40:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 17:40:59 -0600 (MDT) Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: <446792E8.4000506@ergotech.com> References: <446792E8.4000506@ergotech.com> Message-ID: On Sun, 14 May 2006, Jim Redman wrote: > Does anyone know of any work to make RXTX work with Ethernet (telent) > Terminal Servers? > > If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 > Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? > Hi Jim It appears the author of NVTCom has decided to release the library into the public domain. Integration with rxtx is possible but it would be best to contact the author and find out what his intent is. I would suggest contacting the author with a proposal of what you would like to do and take it from there. We could 'take' public domain software but its better to show respect to the authors and respect their wishes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:10:23 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:10:23 -0600 (MDT) Subject: [Rxtx] does any one have a working sample of RXTX and LPT port In-Reply-To: <4467927A.4000008@gmail.com> References: <4467927A.4000008@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > Thank you for reading my post > does any one has a working sample for RXTX and LPT port ? > Thanks Hi Legolas LPT port support in rxtx is spotty. That means some people have sent in patches for what they do and it works well for them. The original code was not very good. It may have been 3 hours work :/ To get started, Sun has some demo programs with their commapi. With rxtx 2.1 you can change their code from using javax.com to gnu.io and it -should- work. But if it does not you can post here and on bugzilla. There has been more interest lately off the list and maybe there will be enough community resources to get what you need going. If you do get a sample program together, we would gladly put it in the contrib directory so the next person can get things going faster. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:12:12 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:12:12 -0600 (MDT) Subject: [Rxtx] does RXTX support Trigerr on parallel port? In-Reply-To: <446792B1.4040905@gmail.com> References: <446792B1.4040905@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > does RXTX support trigger on LPT port ? > if so , how i can use it ? > Hi Legolas As mentioned in the previous post, rxtx parallel support is not very mature. But if you can point to something that describes the trigger feature, we can probably make sure its there and give a quick code example. -- Trent Jarvi tjarvi at qbang.org From jredman at ergotech.com Sun May 14 22:22:48 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 22:22:48 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: References: <446792E8.4000506@ergotech.com> Message-ID: <44680218.4080008@ergotech.com> Trent, Trent Jarvi wrote: > On Sun, 14 May 2006, Jim Redman wrote: > >> Does anyone know of any work to make RXTX work with Ethernet (telent) >> Terminal Servers? >> >> If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 >> Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? >> > > Hi Jim > > It appears the author of NVTCom has decided to release the library into > the public domain. Integration with rxtx is possible but it would be best > to contact the author and find out what his intent is. > > I would suggest contacting the author with a proposal of what you would > like to do and take it from there. We could 'take' public domain software > but its better to show respect to the authors and respect their wishes. > I sent Marco(?), the author of the library, a note before asking the list - I'll let you know the response. If anyone is already working on it, or has an interest and more time and energy than me, I'd hate to duplicate the efforts. If no one is, and no one objects, maybe I'll see what I can do. Jim > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From Christian.Klemke at t-online.de Mon May 15 02:23:06 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Mon, 15 May 2006 10:23:06 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu><004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: <008a01c677f8$cae18590$02fea8c0@NB600> Hi Trent, Hi Paul, I finally found some time to create a simple patch to enable the optional suppression of version output to the console. It is based on a new system property called "gnu.io.rxtx.NoVersionOutput" which can by set to "true" if necessary. I had some problems accessing CVS, therefore I downloaded the rxtx-2.1-7r2 source archive from ftp.qbang.org (which is linked on the rxtx.org download page) and worked with that release. Please find my proposed patch in the attachment ! Regards, Christian ----- Original Message ----- From: "Trent Jarvi" To: "RXTX Developers and Users" Cc: ""Paul Gettings"" Sent: Friday, May 05, 2006 2:09 PM Subject: Re: [Rxtx] RXTX causing stdout messages > On Fri, 5 May 2006, Christian Klemke wrote: > >> Hi Paul, >> >> I was wondering about the same question some days ago and took a look at >> the >> source files. Unfortunately, I found that you can only get rid of that >> messages by altering and recompiling the Java code. There is a final >> static >> boolean variable called "devel" in the file "RXTXCommDriver.java" which >> is >> set to "true". This constellation causes the output after the native >> libraries have been loaded. No mechanism exists to suppress them >> otherwise >> :-(. >> >> Trent, does that mean that 2.1.7 is still officially a "development" >> version >> ? When will this value be changed to "false" by default ? With 2.1.8 ? It >> would be nice to provide a means to suppress such messages besides that >> static flag (maybe by setting a property called >> "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The >> output can indeed by annoying, especially when used with console >> applications, where the message potentially appears "in the middle" of >> your >> own output. Another possibility would be not to use System.out directly, >> but >> instead some PrintStream field which is initially set to System.out but >> can >> programatically be changed. That would allow for any kind of redirection >> or >> suppression by implementing appropriate user-defined PrintStream >> subclasses >> and making RXTX use that stream. What do you think ? >> > > A patch for using properties would be accepted I'm sure. > > The reason the default is to display the message is not related to the > development state of rxtx anymore. The problem is that people first using > rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. > The message prevents a great deal of email thats easily explained by the > message. > > I question if we should support rxtx 2.0 at all anymore. > > If you post a patch in bugzilla, we'll put it into CVS this weekend. > we'll be going through and doing such things anyhow. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_version_output_patch.diff Type: application/octet-stream Size: 991 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060515/3173c2b6/rxtx_version_output_patch-0396.obj From lyon at docjava.com Mon May 15 06:06:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 May 2006 08:06:21 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Joachim makes several good points. Let me see if I can address some of them below: >Hello Douglas, > >Looking at the current code, leaves me with the feeling, that there? >is a lot to do. Yes! >Defining an API that wraps javax.comm to provide what? >you describe is certainly possible, but I wonder how much benefit it? >will actually provide. > >Personally I think the API defined by javax.comm > >"request/lock" a port with: > cp= new CommunicationPort(identifier) >"release" a port with: > cp.close(); > >works quite nice for 99% of the applications. I don't know what percentage of applications turn off locking, the way that I do in my version of the RXTX lib. I do know that this is not safe practice. I also know that it was motivated by the multi-platform nature of my code and that this was the only way I could make things work, at the time. Java does not appear to have a cross-platform standard for locking resources on various platforms. Each OS appears to have its own standard. The question of who breaks deadlocks and how this is done remains open, as this is not an easy question to resolve. Let me continue, below: > >In my experience, the most efficient and elegant implementation is to? >wrap a port/socket/.. into a business object which declares the? >remote operations that are possible. Ie "uploadFile",? >"waitForPrompt", "getSerialNumber", "sendContact", "executeCommand",? >etc Those methods are then either synchronized or guarded by a? >monitor. I do not see how your design pattern applied to the port? >resource would help implementing this. I have no problem with high-level wrappers that are application specific. That is a very good idea, but orthogonal with respect to the issue of deadlocks. More below: > >[details start, skip if you agree to the above] >When I talked about "thread-safe" I didn't mean several independent? >"sessions" accessing the port concurrently. I think this is a very? >rare usage. That is probably why turning locking off works so well! On the other hand, it is not safe and I shouldn't do it. >I believe the most common use case for serial ports today? >is the control of an external device from a PC running a GUI based? >application. To implement a clean Swing/AWT-GUI one needs to pass any? >action that can block to a "worker" thread (else the GUI blocks, the? >application appears dead). While it is possible to use own prespawned? >thread that will accept Runnables which operate on the port, this is? >not very elegant. It is more common to spawn a new thread for every? >action triggered by the user. Additionally the ABORT of a running? >operation is often implemented via a port.close() delegated to a? >different thread. Here lies the heart of serial port concern. An application opens a serial port and then dies. The application is restarted and finds the port locked. How do we clear the lock? Must the application's user reside in the UUCP group? Must installers of the serial port add users to the UUCP group? Should locking be handled at a high-level of abstraction in an operating system independent way? Should the implementation of the locking mechanism be translated into an API that is dependent on the OS convention? Suppose that we restrict the discussion to serial ports. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on inconsistent naming conventions. Hence my feeling that we need to mirror what is done in other API's; we need a locking toolkit that references peer methods, IMHO. >From the Java programming point of view, the locking API is portable across different platforms, but has, as its implementation, a native peer method that uses the conventions of the underlying OS. This enables portable resource locking (in theory!). Consider, for example: org.apache.commons.transaction.locking with: Interface LockManager at: http://jakarta.apache.org/commons/transaction/apidocs/org/apache/commons/transaction/locking/LockManager.html Or, more recently: java.util.concurrent.locks Interface Lock based on Doug Lea's code: http://kickjava.com/src/EDU/oswego/cs/dl/util/concurrent/ReadWriteLock.java.htm Should we incorporate a clean, portable design into serial port use, one that is consistent with current locking APIs? Basically, a comm port is a resource and resources are typically controlled by managers. Thus, I suggest that we make use of a CommPortManager to help control and centralize serial port usage. The question of how this is done remains open, IMHO, but using core API's like: java.util.concurrent.locks might not be amiss. High-level methods (getAllPorts, getAllSerialPorts, getAllParallelPorts, etc...) might be welcome additions. Basic questions like, "what if a port is in use?" remain open, hence my proposal for the new design pattern. Isn't it the CommPortManager's role to break the deadlock? Cheers! - Doug > >- During the lifetime of a port, it will usually be accessed from? >several different threads. Instance variables need to be set/read in? >synchronized regions to guarantee a correct operation based on the? >Java memory model. >- Synchronizing the access is usually handled on the application? >level (synchronizing the reads/writes is usually useless from the? >applications view because it is not a transaction mechanism). >[details end] > >I am very open to learn about other scenarios where your proposed? >design pattern applied to the port resource is beneficial to the? >application implementor. > >Best regards, >Joachim > >On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > >> Dmitry suggests that we acquire an implementation of >> a serial port reference, use it, then release it (i.e., check it? >> back in). >> > > Joachim says that making serial ports thread friendly might be a? >> good idea. >> >> This is a good idea. The design pattern that is close to this idea >> is the "Object Pool Design Pattern". >> # Object Pool > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Mon May 15 06:58:19 2006 From: joachim at buechse.de (Joachim Buechse) Date: Mon, 15 May 2006 14:58:19 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Doug, I agree fully, that locking of the system resource should be abstracted from the user (programmer). Currently this is already the case, but I agree it might be nice to extract the code into a separate class, which uses platform dependent providers to do its job. What I described in my email was not targeted at allocating the system resource, but at handling an already allocated system resource inside the framework. I agree that it may be possible to combine the two - however, I would suggest to do this in phase2. I can contribute a work over of RXTXPort.java which implements clean internal locking and proper close behavior (which I would call phase 1). I could do this this week. However I strongly believe that there is little sense in trying to do this as a series of patches. It will be closer to a rewrite than to a patch. I have already provided a number of suggested patches via Bugzilla, but this is quite inconvenient (for me). My working copy diverges more and more from the master and hence it gets more and more annoying to provide self contained patches. Best regards, Joachim From tjarvi at qbang.org Mon May 15 08:27:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 May 2006 08:27:51 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Mon, 15 May 2006, Joachim Buechse wrote: > Hello Doug, > > I agree fully, that locking of the system resource should be > abstracted from the user (programmer). Currently this is already the > case, but I agree it might be nice to extract the code into a > separate class, which uses platform dependent providers to do its job. > > What I described in my email was not targeted at allocating the > system resource, but at handling an already allocated system resource > inside the framework. I agree that it may be possible to combine the > two - however, I would suggest to do this in phase2. > > I can contribute a work over of RXTXPort.java which implements clean > internal locking and proper close behavior (which I would call phase > 1). I could do this this week. > > However I strongly believe that there is little sense in trying to do > this as a series of patches. It will be closer to a rewrite than to a > patch. I have already provided a number of suggested patches via > Bugzilla, but this is quite inconvenient (for me). My working copy > diverges more and more from the master and hence it gets more and > more annoying to provide self contained patches. > For methodical testing purposes (which does go on) the incremental patches are better. I'm lagging behind in bugzilla but thats soon to change (this week). It has just been rather chaotic up until now. I moved, purchased a house, and jumped into the fire of a feature freeze timeframe at a new job. btw, we see the Solaris close issues on 2.8 also. 9 and 10 are fine. I'll work towards making those test results public and allow others to run new rxtx code through them. We had the OK at one point but setting up the environment is involved. It isn't just a collection of java classes. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Tue May 16 02:01:47 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:01:47 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] Message-ID: <446986EB.209@willicon.de> Hi, any ideas for my problem? Hans -------- Original-Nachricht -------- Betreff: [Rxtx] Problem under Mac OSX 10.3.9 Datum: Mon, 08 May 2006 18:47:20 +0200 Von: WILLICon Antwort an: RXTX Developers and Users An: RXTX Developers and Users Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/b0741c2b/attachment-0396.html From joachim at buechse.de Tue May 16 02:15:08 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 10:15:08 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: Hello Hans, I am using RXTX on OS X for my own project. I do not see the problem you describe. I had some troubles installing it because the current version uses lock files which is non-standard on OS X. I have created a patched version which I currently use. This version does not need to modify user groups and hence does not need an installer. I just pop it in the application directory. If you send me a link where I can download your OSX installer, I will have a quick look. Regards, Joachim On 16.05.2006, at 10:01, WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we > have some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + > spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + > spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always > the value "false". > I can only get the status, while I open the port and catch the > exception. > > Any ideas? > > Hans > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail at willicon.de Tue May 16 02:26:53 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:26:53 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: References: <446986EB.209@willicon.de> Message-ID: <44698CCD.7050709@willicon.de> Joachim, tanks for the answer. I'll send You a mail. Hans Joachim Buechse schrieb: > Hello Hans, > > I am using RXTX on OS X for my own project. I do not see the problem > you describe. > > I had some troubles installing it because the current version uses > lock files which is non-standard on OS X. I have created a patched > version which I currently use. This version does not need to modify > user groups and hence does not need an installer. I just pop it in > the application directory. If you send me a link where I can download > your OSX installer, I will have a quick look. > > Regards, > Joachim > > On 16.05.2006, at 10:01, WILLICon wrote: > > >> Hi, >> >> any ideas for my problem? >> >> Hans >> >> -------- Original-Nachricht -------- >> Betreff: [Rxtx] Problem under Mac OSX 10.3.9 >> Datum: Mon, 08 May 2006 18:47:20 +0200 >> Von: WILLICon >> Antwort an: RXTX Developers and Users >> An: RXTX Developers and Users >> >> >> Hi, >> >> I use for RXTX for communicate with CyclingComputers. >> >> It works good under Win32, Sloaris and Linux but with Mac OSX we >> have some problems. >> >> My users install the Mac OSX serial lib from the actual binary. >> >> After starting the program, they get this error message: >> >> java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while >> loading gnu.io.RXTXCommDriver >> >> Remember, this error comes only under Mac OSX. >> >> That is the code for the error: >> >> Enumeration portList = CommPortIdentifier.getPortIdentifiers(); >> spInUse = getBundleStr("serialPortInUse"); >> spFree = getBundleStr("serialPortFree"); >> while (portList.hasMoreElements()) { >> CommPortIdentifier portId = (CommPortIdentifier) >> portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (osName != null && osName.startsWith("mac")) { >> if (!portId.getName().startsWith("dev/cu.")) { >> continue; >> } >> } >> if (portId.isCurrentlyOwned()) { >> serialPortNames.add(portId.getName() + " - " + >> spInUse); >> } >> else { >> serialPortNames.add(portId.getName() + " - " + >> spFree); >> } >> } >> } >> if (serialPortNames.size() == 0) { >> serialPortNames.add(getBundleStr("serialPortNotFound")); >> } >> >> BTW: The methode isCurrentlyOwned() is not working. I get always >> the value "false". >> I can only get the status, while I open the port and catch the >> exception. >> >> Any ideas? >> >> Hans >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/948333be/attachment-0396.html From jredman at ergotech.com Tue May 16 07:35:52 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 16 May 2006 07:35:52 -0600 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: <4469D538.6070408@ergotech.com> Hans, I have no direct insight, but would note that what you have is a "NoClassDefFoundError" not a "ClassNotFoundException". So the class javax/comm/CommDriver is found, but one of its dependencies is missing. NoClassDefFoundError are a bigger problem to resolve because you get no indication of the real problem. Jim WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we have > some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > * spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always the > value "false". > I can only get the status, while I open the port and catch the exception. > > Any ideas? > > Hans > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.de Tue May 16 08:01:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 16:01:21 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 In-Reply-To: <4469AFC3.6000002@willicon.de> References: <44698EBC.8000008@willicon.de> <8C5680C4-E2BA-42FF-B221-36E1124FA6A4@buechse.de> <4469AFC3.6000002@willicon.de> Message-ID: <9825A602-D6ED-4C28-BF33-9A7C984FACD5@buechse.de> Hallo Hans, you include RXTX 2.17 in your "bikeXexperience.jar" (2.17 uses Interfaces from gnu.io.* not javax.comm.*). Now inspect your error log closely: The class gnu.io.RXTXCommDriver tries to load javax.comm.CommDriver: this is only the case for RXTX 2.07. I assume, that the user has installed Version 2.07 into one of the java.ext.dirs . The VM always tries to load classes from the "system" path first. The current Mac installer distributed with RXTX in fact installs RXTXcomm.jar and librxtxSerial.jnilib into /Library/Java/Extensions. (I wrote some time ago that I consider this as a bad idea because of potential version conflicts-> thanks for delivering the example). For 2.07 it does so without installing the javax.comm classes it seems. I would recommend that you instruct your users to install version 2.17 only. Until RXTX is changed to use TIOCEXCL instead of lock files, you can hardly avoid the installer, as the user needs to be added to a special group and a lockfile directory needs be created. More precisely you are waiting for: http://bugzilla.qbang.org/show_bug.cgi?id=50 [RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL)] Regards, Joachim -------------- next part -------------- A non-text attachment was scrubbed... Name: log.tiff Type: image/tiff Size: 38394 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/e3e52128/log-0396.tiff -------------- next part -------------- > > Ich verwende RXTX 2.17. Das orginal RXTXcomm.jar ist in > CyclingDataManager.jar enthalten. > From tjarvi at qbang.org Wed May 17 23:18:15 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 May 2006 23:18:15 -0600 (MDT) Subject: [Rxtx] update Message-ID: So we have several patches and these have stacked up. I'd like to thank everyone for being patient. Tests for the most intrusive patches look good so far. I still have to get some bits together on my end but it looks like we can catch everything up in CVS this week. I'll try to post a normal list of what went in by whom with links Saturday. But I'm not seeing anything that raises flags yet. I also think I'll be able to submit a patch for nonstandard baud rates. I have to confirm w32 but I think its going to be a one line fix. I don't know if its bugzilla or people tinkering with patch files before submitting but patches are not applying cleanly. So the patches have to be done by hand. This may make things difficult for people hoping to add other patches on top. I'm trying to make that go well but ... -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Thu May 18 02:23:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 May 2006 10:23:47 +0200 Subject: [Rxtx] update In-Reply-To: References: Message-ID: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Hello Trent, in fact I tinkered with the patches (never used this mechanism before, usually I "communicate" via cvs) ... so sorry for any trouble you had applying them. Basicly I edited the patches to make them self contained. Having the tests run with different speeds on different platforms, may well be an effect of caching. I have seen quite interesting propagation delays for the closing flag on my PowerPC system, which makes me doubt, that the propagation of output_buffer_empty_flag works as it should. Maybe the communication mechanism between the two threads should be replaced by something like pthread_cond_*. Could you describe which problems you see on Solaris/SPARC? I'd be interested to see if they exist on OS X (PowerPC) as well... As you seem to work on the stuff at the moment I would like to suggest the following additions (it looks more than it is, I posted some context to make clear where to apply the change). See the comments in braces for what was changed Greetings, Joachim (1) The end of the drain loop could be: --- report("drain_loop: received EINTR in tcdrain\n"); --- (added "in tcdrain" to make debug output clearer) (2) The start of the drain loop should be: --- for(i=0;;i++) { report_verbose("drain_loop: looping\n"); #if defined(__sun__) /* FIXME: No time to test on all OS's for production */ if( eis->eventloop_interrupted ) { goto end; } if (usleep(5000)) { report("drain_loop: received EINTR"); } #else if (usleep(1000000)) { report("drain_loop: received EINTR"); } #endif /* __sun__ */ --- (added a check for "eis->eventloop_interrupted" before the sleep) (3) The end of interrupt_event_loop could (and maybe should) be: --- #if !defined(TIOCSERGETLSR) && !defined(WIN32) /* make sure that the drainloop unblocks from tcdrain */ pthread_kill(index->drain_tid, SIGABRT); /* TODO use wait/join/SIGCHLD/?? instead of sleep? */ usleep(50 * 1000); /* Under normal conditions, SIGABRT will unblock tcdrain. However a non-responding USB device combined with an unclean driver may still block. This is very ugly because it may block the call to close indefinetly. */ if (index->closing != 1) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); index->closing = 1; } #endif report("interruptEventLoop: interrupted\n"); --- (added some comments and pthread_cancel for resisting drain thread) On 18.05.2006, at 07:18, Trent Jarvi wrote: > > So we have several patches and these have stacked up. I'd like to > thank > everyone for being patient. > > Tests for the most intrusive patches look good so far. I still > have to > get some bits together on my end but it looks like we can catch > everything > up in CVS this week. > > I'll try to post a normal list of what went in by whom with links > Saturday. But I'm not seeing anything that raises flags yet. I also > think I'll be able to submit a patch for nonstandard baud rates. > I have > to confirm w32 but I think its going to be a one line fix. > > I don't know if its bugzilla or people tinkering with patch files > before > submitting but patches are not applying cleanly. So the patches > have to > be done by hand. This may make things difficult for people hoping > to add > other patches on top. I'm trying to make that go well but ... > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu May 18 22:28:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 18 May 2006 22:28:00 -0600 (MDT) Subject: [Rxtx] update In-Reply-To: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> References: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Message-ID: On Thu, 18 May 2006, Joachim Buechse wrote: > Hello Trent, > > in fact I tinkered with the patches (never used this mechanism > before, usually I "communicate" via cvs) ... so sorry for any trouble > you had applying them. Basicly I edited the patches to make them self > contained. I think we are close to moving towards that. > > Having the tests run with different speeds on different platforms, > may well be an effect of caching. I have seen quite interesting > propagation delays for the closing flag on my PowerPC system, which > makes me doubt, that the propagation of output_buffer_empty_flag > works as it should. Maybe the communication mechanism between the two > threads should be replaced by something like pthread_cond_*. Could > you describe which problems you see on Solaris/SPARC? I'd be > interested to see if they exist on OS X (PowerPC) as well... This is interesting. I have seen problems with output buffer empty in applications that require it. I'm trying to get a bug list and or test results open for everyone to see but that may take time. But missed output buffer events ... yep. With Sparc, we have seen a few things. One was a kernel race condition that went away when we reimaged and updated 2.8. RXTX was hanging on close, top showed no cpu use but there was 2 second delays just typing on console. The other is our tests now take ~4 times longer on Solaris. Someone is looking at timing just open, close, read, write, ... to see if they can find where the slowdown is. This happened after solaris 2.8. I'll try to share more when/if there is something interesting. This may well not be solvable in userland. > > As you seem to work on the stuff at the moment I would like to > suggest the following additions (it looks more than it is, I posted > some context to make clear where to apply the change). See the > comments in braces for what was changed I'll take a look. This could all come together Saturday but I also have an event to attend that day. I may not wrap this up until Sunday. -- Trent Jarvi tjarvi at qbang.org From andrewlord at internode.on.net Sun May 21 20:10:02 2006 From: andrewlord at internode.on.net (Andrew Lord) Date: Mon, 22 May 2006 11:40:02 +0930 Subject: [Rxtx] Kernel include files do not match kernel Message-ID: <200605221140.03271.andrewlord@internode.on.net> Hi, I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel 2.6.12-18 with the command: ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include However I get the message: ## checking java.version 1.5.0_06 ## checking os.version 2.6.12-18mdk ## ## WARNING: Kernel include files do not match the current kernel ## ## configure: creating ./config.status etc. Is there a problem with the way I'm specifying the 'include' directory ? If not, how else can I specify the correct directory for the include files please ? Cheers, Andrew From tjarvi at qbang.org Sun May 21 20:31:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 May 2006 20:31:31 -0600 (MDT) Subject: [Rxtx] Kernel include files do not match kernel In-Reply-To: <200605221140.03271.andrewlord@internode.on.net> References: <200605221140.03271.andrewlord@internode.on.net> Message-ID: On Mon, 22 May 2006, Andrew Lord wrote: > Hi, > > I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel > 2.6.12-18 with the command: > > ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk > CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include > > However I get the message: > > ## checking java.version 1.5.0_06 > ## checking os.version 2.6.12-18mdk > ## > ## WARNING: Kernel include files do not match the current kernel > ## > ## configure: creating ./config.status > etc. > > Is there a problem with the way I'm specifying the 'include' directory ? If > not, how else can I specify the correct directory for the include files > please ? > Hi Andrew I'm fairly sure your --with-kernel option does nothing. The CPPFLAGS should do what you want. Maybe put an #error message in /usr/src/linux.../incude/linux/version.h But I don't recall a recent problem with version missmatches. It should work. Distros will even ship include files that don't match versions exactly. In theory it should never matter for users. I used to compile new kernels by hand and really didnt have a distro. I didnt have a seperate package of kernel headers for users (myself). When changing a gateway from linux 1.2.12 to 2.1.77, I would worry about such messages. So if you are doing something that weird, the message may be of use to you. If you just see the message on a distro you installed, it is more than likely harmless. -- Trent Jarvi tjarvi at qbang.org From mrogers at spro.net Mon May 22 14:45:39 2006 From: mrogers at spro.net (Mike Rogers) Date: Mon, 22 May 2006 14:45:39 -0600 Subject: [Rxtx] Sun's CommAPI -- think May? Message-ID: <447222F3.9040302@spro.net> Hi, Any word from Sun about progress towards fixing the Java CommAPI v3 "incompatibilities" so RXTX 2.0 can operate within the framework's namespace (javax.comm)? I recall mention of a May time frame. Thanks, Mike From paul.klissner at sun.com Mon May 22 15:09:27 2006 From: paul.klissner at sun.com (Paul Klissner) Date: Mon, 22 May 2006 14:09:27 -0700 Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <447222F3.9040302@spro.net> References: <447222F3.9040302@spro.net> Message-ID: <44722887.8080308@sun.com> Mike Rogers wrote: > Hi, > > Any word from Sun about progress towards fixing the Java CommAPI v3 > "incompatibilities" so RXTX 2.0 can operate within the framework's > namespace (javax.comm)? I recall mention of a May time frame. > > Thanks, > > Mike > We've had a lot of work come in. This hasn't been the only priority. I'm running behind the plan in addressing this, but will be looking at it again soon. Rather than state a new, I'll just say it is in progress, and not off the table. I'll get this fixed as soon as I can. Good timing for asking as we just started discussing javax.comm plans today, and I'll have some cycles to work on it soon. Paul From yhua537 at cse.unsw.edu.au Mon May 22 16:03:05 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Tue, 23 May 2006 08:03:05 +1000 (EST) Subject: [Rxtx] install rxtx in XP Message-ID: Hi Guys, I am new to serial port programming, and have no experience on programming java in xp, but my project require me to builld a communication link between xp and a UART device. Most of the information in the web site seems for linux only. including the commands such as export and chmod. How do I install rxtx in xp? cheers YiQi Huang From mark at mdsh.com Tue May 23 01:24:20 2006 From: mark at mdsh.com (Mark Himsley) Date: Tue, 23 May 2006 08:24:20 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off , it includes DLLs for Windows and the JAR for Java. Follow the Windows instructions in the INSTALL. ie RXTXcomm.jar goes in \jre\lib\ext (under java) rxtxSerial.dll goes in \jre\bin So, assuming a fairly standard Java install, copy RXTXcomm.jar into C:\Program Files\Java\jre1.5.0_06\lib\ext and copy rxtxSerial.dll into C:\Program Files\Java\jre1.5.0_06\bin Yes, it really is that simple. On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > I am new to serial port programming, and have no experience on > programming java in xp, but my project require me to builld a > communication link between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang -- Mark Himsley From joachim at buechse.de Tue May 23 02:51:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 23 May 2006 10:51:47 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) Unless it is absolutely required you should NOT install RXTX in your global Java Runtime Environment. This will for sure create versioning conflicts - if not now, than in the future, if not on your system than at your clients. Instead put the dll in your application directory and include the RXTXcomm.jar in your classpath. This is much safer and not a bit more complicated. Regards, Joachim On 23.05.2006, at 09:24, Mark Himsley wrote: > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR > for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > >> I am new to serial port programming, and have no experience on >> programming java in xp, but my project require me to builld a >> communication link between xp and a UART device. >> >> Most of the information in the web site seems for linux only. >> including >> the commands such as export and chmod. How do I install rxtx in xp? >> >> cheers >> YiQi Huang > > > > -- > Mark Himsley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tod at todbot.com Tue May 23 03:12:22 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 02:12:22 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I totally agree: do not contaminate the Java installation. I put all the RXTX files in a directory and then change my java invocation to be: % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* Alternatively, use Launch4J to create a double-clickable application and keep the RXTX libraries in the directory of the application. -=tod On May 23, 2006, at 1:51 AM, Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > >> Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off >> , it includes DLLs for Windows and the JAR >> for Java. >> >> Follow the Windows instructions in the INSTALL. >> >> ie >> >> RXTXcomm.jar goes in \jre\lib\ext (under java) >> rxtxSerial.dll goes in \jre\bin >> >> So, assuming a fairly standard Java install, copy RXTXcomm.jar into >> C:\Program Files\Java\jre1.5.0_06\lib\ext >> and copy rxtxSerial.dll into >> C:\Program Files\Java\jre1.5.0_06\bin >> >> Yes, it really is that simple. >> >> >> >> On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: >> >>> I am new to serial port programming, and have no experience on >>> programming java in xp, but my project require me to builld a >>> communication link between xp and a UART device. >>> >>> Most of the information in the web site seems for linux only. >>> including >>> the commands such as export and chmod. How do I install rxtx in xp? >>> >>> cheers >>> YiQi Huang >> >> >> >> -- >> Mark Himsley >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From smontgomery at mediaspansoftware.com Tue May 23 08:46:53 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Tue, 23 May 2006 10:46:53 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: Message-ID: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Joachim and Tod mentioned how to keep the files RXTX requires on Windows XP out of the Java installations - thanks gentlemen! Are there similar suggestions for an RXTX install on OS X? The current "canonical" OS X installation instructions "contaminate the Java installation", to use Tod's words. Our app will run fine under 1.4.2 and 5.0 on OS X, and a lot of users will have both. We've already been burned by the recent switch from 1.4.2 to 5.0 as the platform default. Any suggestions welcomed. From tod at todbot.com Tue May 23 13:27:55 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 12:27:55 -0700 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <9BA0F670-A862-42E7-BB2C-130D775ABDF9@todbot.com> Hi Sean, It depends on how you build and deploy your code. If you're using shell scripts, you can do something like this: #!/bin/sh # pick one JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/ Commands/java #JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/ Commands/java $JAVA -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* That both picks which VM to use and uses the RXTX in the directory called 'rxtxlib'. If you want your shell script to be clever, you could test for the existence of the different 'java' executables and go from there (maybe even use different jar files). I am almost positive all OS X systems with Java 1.5 are guaranteed to also have Java 1.4.2. If you're using Jar Builder or XCode, you can specify which JVM to use and add the extra args in the Info.plist file. The paths specified in the 'java' invocation then are based off of the $JAVAROOT variable that the JavaApplicationStub sets for you. For my app, I've have been compiling two sets of jars, one compiled with 1.4.2 and one with 1.5, but they both run under 1.5. So I have a similar shell script that chooses a different 'javac' depending on the need. -=tod On May 23, 2006, at 7:46 AM, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From yhua537 at cse.unsw.edu.au Tue May 23 11:09:37 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 03:09:37 +1000 (EST) Subject: [Rxtx] install rxtx in XP (Mark Himsley, Joachim Buechse, Tod E. Kurt> In-Reply-To: References: Message-ID: > Message: 8 > Date: Tue, 23 May 2006 08:03:05 +1000 (EST) > From: YiQi Huang > Subject: [Rxtx] install rxtx in XP > To: rxtx at qbang.org > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > Hi Guys, > > I am new to serial port programming, and have no experience on programming > java in xp, but my project require me to builld a communication link > between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang > > > ------------------------------ > > Message: 9 > Date: Tue, 23 May 2006 08:24:20 +0100 > From: Mark Himsley > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=us-ascii; format=flowed > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > ------------------------------ > > Message: 10 > Date: Tue, 23 May 2006 10:51:47 +0200 > From: Joachim Buechse > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > > ------------------------------ > > Message: 11 > Date: Tue, 23 May 2006 02:12:22 -0700 > From: "Tod E. Kurt" > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I totally agree: do not contaminate the Java installation. > > I put all the RXTX files in a directory and then change my java > invocation to be: > > % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* > > Alternatively, use Launch4J to create a double-clickable application > and keep the RXTX libraries in the directory of the application. > > -=tod > > Hi, Thanks guys, I don't know if this is the correct way to reply your mecessage, if wrong, please point out. Thank you for Mark to give the detail instructions and Joachim to point out the cons ot installing in the java directory, and specially thanks for Tod to give the instrection in detail. Sorry to ask another stupid question: I have followed Tod's instruction. Now I think i am ready to start hacking. But where is the RXTX API documentation? Is it the same as using normal java comm API? btw, where could i find some examples to start with? Thanks very much cheers YiQi Huang From tjarvi at qbang.org Tue May 23 16:09:32 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 May 2006 16:09:32 -0600 (MDT) Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <44722887.8080308@sun.com> References: <447222F3.9040302@spro.net> <44722887.8080308@sun.com> Message-ID: > Good timing for asking as we just started discussing javax.comm plans > today, and I'll have some cycles to work on it soon. Hi Paul I assume you mean Sun is discussing plans concerning its own internal actions and there is no community involvment at this point. -- Trent Jarvi tjarvi at qbang.org From yhua537 at cse.unsw.edu.au Tue May 23 22:50:01 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 14:50:01 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } From mmester at sps.edu Tue May 23 22:58:21 2006 From: mmester at sps.edu (Michael Mester) Date: Wed, 24 May 2006 00:58:21 -0400 Subject: [Rxtx] install rxtx in XP References: Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below -----Original Message----- From: rxtx-bounces at qbang.org on behalf of YiQi Huang Sent: Wed 5/24/2006 12:50 AM To: RXTX Developers and Users Subject: Re: [Rxtx] install rxtx in XP Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3950 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060523/b36d0c63/attachment-0396.bin From yhua537 at cse.unsw.edu.au Tue May 23 23:05:50 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 15:05:50 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: Yes, Michael you are right, it should be semicolons, But it still can't find the correct library. On Wed, 24 May 2006, Michael Mester wrote: > I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below > > > -----Original Message----- > From: rxtx-bounces at qbang.org on behalf of YiQi Huang > Sent: Wed 5/24/2006 12:50 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] install rxtx in XP > > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > cheers YiQi Huang From tod at todbot.com Wed May 24 00:01:57 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 23:01:57 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Yes, sorry, classpath entries are semicolon-separated on Windows and colon-separated on everything else. Your example code below is importing the wrong set of classes. It should not "import javax.comm.*", instead it should "import gnu.io.*". When I make that change, your example program compiles. The "javax.comm" package is the one released by Sun, the "gnu.io" package is the RXTX one. You might've seen some discussion that the two will be merged or become compatible, but that hasn't happened yet. -=tod On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > > Yes, Michael you are right, it should be semicolons, But it still > can't > find the correct library. > > On Wed, 24 May 2006, Michael Mester wrote: > >> I believe the entries in the classpath need to be seperated with >> semicolons, not a colon as you have in your command below >> >> >> -----Original Message----- >> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >> Sent: Wed 5/24/2006 12:50 AM >> To: RXTX Developers and Users >> Subject: Re: [Rxtx] install rxtx in XP >> >> Hi, >> >> Sorry guys.I follow Tod's instruction, and here is what i did: >> >> put >> RXTXcomm.jar, >> rxtxParallel.dll, >> rxtxSerial.dll >> in >> C:\RXTX_files >> >> and I got a SimpleRead class attached below, compile it with : >> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >> it still saying "cannot find symbol". >> >> Is there anything I did wrong? Do I need the comm.jar from Sun? >> >> Thanks & regards >> YiQi Huang >> >> >> //////////////////////////////////////////////////////// >> // SimpleRead.java >> //////////////////////////////////////////////////////// >> >> import java.io.*; >> import java.util.*; >> import javax.comm.*; >> >> public class SimpleRead >> implements Runnable, SerialPortEventListener { >> static CommPortIdentifier portId; >> static Enumeration portList; >> InputStream inputStream; >> SerialPort serialPort; >> Thread readThread; >> public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == >> CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals("COM1")) { >> //if (portId.getName().equals("/dev/term/a")) { >> SimpleRead reader = new SimpleRead(); >> } >> } >> } >> } >> public SimpleRead() { >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", >> 2000); >> } catch (PortInUseException e) {} >> try { >> inputStream = serialPort.getInputStream(); >> } catch (IOException e) {} >> try { >> serialPort.addEventListener(this); >> } catch (TooManyListenersException e) {} >> serialPort.notifyOnDataAvailable(true); >> try { >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } catch (UnsupportedCommOperationException e) {} >> readThread = new Thread(this); >> readThread.start(); >> } >> public void run() { >> try { >> Thread.sleep(20000); >> } catch (InterruptedException e) {} >> } >> public void serialEvent(SerialPortEvent event) { >> switch(event.getEventType()) { >> case SerialPortEvent.BI: >> case SerialPortEvent.OE: >> case SerialPortEvent.FE: >> case SerialPortEvent.PE: >> case SerialPortEvent.CD: >> case SerialPortEvent.CTS: >> case SerialPortEvent.DSR: >> case SerialPortEvent.RI: >> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >> break; >> case SerialPortEvent.DATA_AVAILABLE: >> byte[] readBuffer = new byte[20]; >> try { >> while (inputStream.available() > 0) { >> int numBytes = inputStream.read(readBuffer); >> } >> System.out.print(new String(readBuffer)); >> } catch (IOException e) {} >> break; >> } >> } >> } >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > cheers > YiQi Huang > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From joachim at buechse.de Wed May 24 00:10:06 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:10:06 +0200 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Hi Sean, my preferred way of dealing with RXTX on OS X is to include the RXTX classes into my application jar and to put the RXTX lib in the same directory as this jar. To make it even more comfortable, you can include the lib in the jar and have some startup code extract it and write it to a temporary file from which you load it with System.load(). Unfortunately the current version of RXTX for OS X requires tinkering with user groups as it is based on lockfiles - and hence it needs the RXTX OS X installer or you need to duplicated this functionality in your own installer. I have created my own native version which is not based on lockfiles but tty locking (the standard way to do it on OSX). I hope that these patches will be integrated soon into the distribution. Regards, Joachim On 23.05.2006, at 16:46, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Wed May 24 00:16:12 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:16:12 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <7017ECFC-B13E-4806-B321-9FFCAC5830F0@buechse.de> I assume you downloaded rxtx-217 (not 207). Instead of importing javax.comm.* you must import gnu.io.* The classes have the same name, but they are not in the same package. On 24.05.2006, at 06:50, YiQi Huang wrote: > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From yhua537 at cse.unsw.edu.au Wed May 24 00:17:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 16:17:45 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Message-ID: Thanks Tod again, i kept reading "gnu.io.*" as "gun.io.*" last few hours after i read some commons from web. Thanks very much Tod. thanks YiQi Huang On Tue, 23 May 2006, Tod E. Kurt wrote: > Yes, sorry, classpath entries are semicolon-separated on Windows and > colon-separated on everything else. > > Your example code below is importing the wrong set of classes. It > should not "import javax.comm.*", instead it should "import > gnu.io.*". When I make that change, your example program compiles. > The "javax.comm" package is the one released by Sun, the "gnu.io" > package is the RXTX one. You might've seen some discussion that the > two will be merged or become compatible, but that hasn't happened yet. > > -=tod > > > On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > >> >> Yes, Michael you are right, it should be semicolons, But it still >> can't >> find the correct library. >> >> On Wed, 24 May 2006, Michael Mester wrote: >> >>> I believe the entries in the classpath need to be seperated with >>> semicolons, not a colon as you have in your command below >>> >>> >>> -----Original Message----- >>> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >>> Sent: Wed 5/24/2006 12:50 AM >>> To: RXTX Developers and Users >>> Subject: Re: [Rxtx] install rxtx in XP >>> >>> Hi, >>> >>> Sorry guys.I follow Tod's instruction, and here is what i did: >>> >>> put >>> RXTXcomm.jar, >>> rxtxParallel.dll, >>> rxtxSerial.dll >>> in >>> C:\RXTX_files >>> >>> and I got a SimpleRead class attached below, compile it with : >>> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >>> it still saying "cannot find symbol". >>> >>> Is there anything I did wrong? Do I need the comm.jar from Sun? >>> >>> Thanks & regards >>> YiQi Huang >>> >>> >>> //////////////////////////////////////////////////////// >>> // SimpleRead.java >>> //////////////////////////////////////////////////////// >>> >>> import java.io.*; >>> import java.util.*; >>> import javax.comm.*; >>> >>> public class SimpleRead >>> implements Runnable, SerialPortEventListener { >>> static CommPortIdentifier portId; >>> static Enumeration portList; >>> InputStream inputStream; >>> SerialPort serialPort; >>> Thread readThread; >>> public static void main(String[] args) { >>> portList = CommPortIdentifier.getPortIdentifiers(); >>> while (portList.hasMoreElements()) { >>> portId = (CommPortIdentifier) portList.nextElement(); >>> if (portId.getPortType() == >>> CommPortIdentifier.PORT_SERIAL) { >>> if (portId.getName().equals("COM1")) { >>> //if (portId.getName().equals("/dev/term/a")) { >>> SimpleRead reader = new SimpleRead(); >>> } >>> } >>> } >>> } >>> public SimpleRead() { >>> try { >>> serialPort = (SerialPort) portId.open("SimpleReadApp", >>> 2000); >>> } catch (PortInUseException e) {} >>> try { >>> inputStream = serialPort.getInputStream(); >>> } catch (IOException e) {} >>> try { >>> serialPort.addEventListener(this); >>> } catch (TooManyListenersException e) {} >>> serialPort.notifyOnDataAvailable(true); >>> try { >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, >>> SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> } catch (UnsupportedCommOperationException e) {} >>> readThread = new Thread(this); >>> readThread.start(); >>> } >>> public void run() { >>> try { >>> Thread.sleep(20000); >>> } catch (InterruptedException e) {} >>> } >>> public void serialEvent(SerialPortEvent event) { >>> switch(event.getEventType()) { >>> case SerialPortEvent.BI: >>> case SerialPortEvent.OE: >>> case SerialPortEvent.FE: >>> case SerialPortEvent.PE: >>> case SerialPortEvent.CD: >>> case SerialPortEvent.CTS: >>> case SerialPortEvent.DSR: >>> case SerialPortEvent.RI: >>> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >>> break; >>> case SerialPortEvent.DATA_AVAILABLE: >>> byte[] readBuffer = new byte[20]; >>> try { >>> while (inputStream.available() > 0) { >>> int numBytes = inputStream.read(readBuffer); >>> } >>> System.out.print(new String(readBuffer)); >>> } catch (IOException e) {} >>> break; >>> } >>> } >>> } >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> >> cheers >> YiQi Huang >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From smontgomery at mediaspansoftware.com Wed May 24 10:24:13 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 12:24:13 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: Tod & Joachim, Thanks for the info, that's very helpful. I'll give that a whirl when I move to rxtx 2.1. I'm still using the older 2.0.7 version for now (don't ask), which probably requires the Sun comm.jar, javax.comm.properties and librxtxSerial.jnilib to be in very specific places in each jvm's file hierarchy. From tjarvi at qbang.org Wed May 24 11:59:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 11:59:16 -0600 (MDT) Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: On Wed, 24 May 2006, Sean Montgomery wrote: > Tod & Joachim, > > Thanks for the info, that's very helpful. I'll give that a whirl > when I move to rxtx 2.1. I'm still using the older 2.0.7 version for > now (don't ask), which probably requires the Sun comm.jar, > javax.comm.properties and librxtxSerial.jnilib to be in very specific > places in each jvm's file hierarchy. > You will need comm.jar from Sun then. It must be Sun's version 2.* or older for Linux or Solaris. I assume they have this in download archives. The default offering from Sun is version 3.0. This version currently does not support rxtx. The older version will probably be fine for your needs. -- Trent Jarvi tjarvi at qbang.org From smontgomery at mediaspansoftware.com Wed May 24 12:19:06 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 14:19:06 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: <3939EFB8-11E1-4E3E-A684-5B3C525577CD@mediaspansoftware.com> Yup, that's right, thanks Trent. I've been using these files for quite a while now. Thanks for bringing it up. I almost didn't mention using 2.0.7 because I didn't want to give any new members of the list the wrong idea! :-) On May 24, 2006, at 1:59 PM, Trent Jarvi wrote: > On Wed, 24 May 2006, Sean Montgomery wrote: > >> Tod & Joachim, >> >> Thanks for the info, that's very helpful. I'll give that a whirl >> when I move to rxtx 2.1. I'm still using the older 2.0.7 version for >> now (don't ask), which probably requires the Sun comm.jar, >> javax.comm.properties and librxtxSerial.jnilib to be in very specific >> places in each jvm's file hierarchy. >> > > You will need comm.jar from Sun then. It must be Sun's version 2.* or > older for Linux or Solaris. I assume they have this in download > archives. > > The default offering from Sun is version 3.0. This version > currently does > not support rxtx. > > The older version will probably be fine for your needs. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mark at mdsh.com Wed May 24 15:55:46 2006 From: mark at mdsh.com (Mark Himsley) Date: Wed, 24 May 2006 22:55:46 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <37B0FC4B1F3237321F093ABE@MacMini.local> On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) That's no problem. BUT, do note that the instructions I elaborated on are in the INSTALL file within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone please update the INSTALL file? > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > > , it includes DLLs for Windows and the JAR > > for Java. > > > > Follow the Windows instructions in the INSTALL. > > > > ie > > > > RXTXcomm.jar goes in \jre\lib\ext (under java) > > rxtxSerial.dll goes in \jre\bin > > > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > > C:\Program Files\Java\jre1.5.0_06\lib\ext > > and copy rxtxSerial.dll into > > C:\Program Files\Java\jre1.5.0_06\bin > > > > Yes, it really is that simple. > > > > > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > > > >> I am new to serial port programming, and have no experience on > >> programming java in xp, but my project require me to builld a > >> communication link between xp and a UART device. > >> > >> Most of the information in the web site seems for linux only. > >> including > >> the commands such as export and chmod. How do I install rxtx in xp? > >> > >> cheers > >> YiQi Huang > > > > > > > > -- > > Mark Himsley > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Mark Himsley From tjarvi at qbang.org Wed May 24 16:41:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 16:41:46 -0600 (MDT) Subject: [Rxtx] install rxtx in XP In-Reply-To: <37B0FC4B1F3237321F093ABE@MacMini.local> References: <37B0FC4B1F3237321F093ABE@MacMini.local> Message-ID: On Wed, 24 May 2006, Mark Himsley wrote: > > > On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > >> I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > That's no problem. > > BUT, do note that the instructions I elaborated on are in the INSTALL file > within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone > please update the INSTALL file? > > The INSTALL file may be updated by anyone at anytime. http://rxtx.qbang.org/wiki/index.php/Installation We are moving it to the wiki so end users may put the type of answers they would like to see in. Sometimes it's best if developers don't give what appears to be cryptic answers. You can even put in that jre/lib/ext is not the right place but you don't understand the classpath solution mentioned on the mail-list and then we know what to add. -- Trent Jarvi tjarvi at qbang.org From stramit at gmail.com Wed May 24 21:45:31 2006 From: stramit at gmail.com (Tim Cooper) Date: Thu, 25 May 2006 13:45:31 +1000 Subject: [Rxtx] Accessing Virtual Com Port Message-ID: Hi, I have to develop an application that talks to a virtual com port (in this case com3) which translates any messages sent across a USB cable to a micro. Using C++ I can talk to this com port and I know that it is configured, present, and working. For the application that I am trying to write I want to use RXTX for the communication. My problem is that the configured virtual port (in windows) is not showing up when I do an enumeration over the available ports. The output I get is (com 3 is not present) : Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 PORT FOUND: COM1 PORT FOUND: LPT1 Is there anything that I need to do to make com3 available to RXTX and my application? Timothy Cooper -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060524/c5591648/attachment-0396.html From antonio.luis at iscte.pt Thu May 25 01:39:13 2006 From: antonio.luis at iscte.pt (=?ISO-8859-1?Q?Ant=F3nio_Lopes?=) Date: Thu, 25 May 2006 08:39:13 +0100 Subject: [Rxtx] RXTX on Pocket PC Message-ID: <44755F21.8060103@iscte.pt> Hello everyone, I've been using RXTX to communicate with serial ports in Windows and it's been quite successful. However, I'm now considering porting my application from Windows to Pocket PC but I can't seem to find the RXTX binaries (*.jar and *.dll) to use in Pocket PC. I've been "digging" on the mailing list's archives and also on the web and I can't find these anywhere. Can anyone in this mailing list give me some pointers on this? Where can I find the necessary files and basic installation instructions? Thanks very much for your help. I very much appreciate any help that you can provide me. Regards, -- Ant?nio Lopes @contact: antonio.luis at iscte.pt @work: ADETTI - ISCTE @web: http://antonio.lopes.googlepages.com/home From doug at dupreeinc.com Fri May 26 15:45:50 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Fri, 26 May 2006 14:45:50 -0700 Subject: [Rxtx] rxtx slow startup Message-ID: <4477770E.9010400@dupreeinc.com> Hello, I hope there are people still reading this mailing list. The archive appeared to not have anything new after 4/2005. I was using the commapi from sun for a project where a java application reads data from test equipment connected to the serial port. I had to upgrade the ftdi vcp driver on my pc and the old sun commapi no longer works with hardware flow control. as an experiment I replaced the javax.com with gnu.io in the SerialDemo.java project that was included with the commapi. This compiled fine using JBuilder 2006 and JRE 1.5.0_05. RXTX also works with the latest ftdi drivers so life is wonderful again... almost... When using the commapi jar the SerialDemo program starts in about 1 second on my system. Using the RXTX jar it takes over 56 seconds to start. Has anyone else seen this problem? Is there a workaround to get the startup performance close to the old commapi? The last thing printed to the console before this delay is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks for your time! Doug From yhua537 at cse.unsw.edu.au Sat May 27 05:46:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 21:46:45 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <4477770E.9010400@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> Message-ID: hi Doug The archive hasn't been update for a long time, But people certainly still reading the list. I don't have enough experience to help on your problem, but without any detail about what your problem doing during that 56 seconds, it is hard to target the your question, I think. cheers YiQi On Fri, 26 May 2006, Doug Thistlethwaite wrote: > Hello, > > I hope there are people still reading this mailing list. The archive > appeared to not have anything new after 4/2005. > > I was using the commapi from sun for a project where a java application > reads data from test equipment connected to the serial port. I had to > upgrade the ftdi vcp driver on my pc and the old sun commapi no longer > works with hardware flow control. as an experiment I replaced the > javax.com with gnu.io in the SerialDemo.java project that was included > with the commapi. This compiled fine using JBuilder 2006 and JRE > 1.5.0_05. RXTX also works with the latest ftdi drivers so life is > wonderful again... almost... > > When using the commapi jar the SerialDemo program starts in about 1 > second on my system. Using the RXTX jar it takes over 56 seconds to > start. Has anyone else seen this problem? Is there a workaround to get > the startup performance close to the old commapi? > > The last thing printed to the console before this delay is: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Thanks for your time! > > Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------- Just a student, Still a student ------------------------------- From yhua537 at cse.unsw.edu.au Sat May 27 06:04:26 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 22:04:26 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: Sorry, I don't think you could understand what I mean .I mean this: Without any detail about what your program is doing during that 56 seconds, it is hard for anyone to target the problem. On Sat, 27 May 2006, YiQi Huang wrote: > hi Doug > > The archive hasn't been update for a long time, But people certainly still > reading the list. > > I don't have enough experience to help on your problem, but without any > detail about what your problem doing during that 56 seconds, it is hard to > target the your question, I think. > > cheers > YiQi > > On Fri, 26 May 2006, Doug Thistlethwaite wrote: > >> Hello, >> >> I hope there are people still reading this mailing list. The archive >> appeared to not have anything new after 4/2005. >> >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From jredman at ergotech.com Sat May 27 08:32:02 2006 From: jredman at ergotech.com (Jim Redman) Date: Sat, 27 May 2006 08:32:02 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: <447862E2.4080506@ergotech.com> Doug, Since you mentioned it, we have a system that is also seems slow. From memory (I don't have one of the slow systems around), I'm not sure that it's consistent, it seems that sometimes it may take longer than others. Since it's part of the bootup it hasn't raised a flag and I haven't researched it. The same code runs much faster on other systems, so now you've got me wondering what's different. The slow system boots DSL (http://www.damnsmalllinux.org/) from a compact flash. FC4 is on my desktop where I haven't noticed a slow down. I think that the rxtx code is the same in both cases with lock files disabled. The slow system has a bunch of serial ports defined, including 4 USB serial ports that do not exist - they are not plugged in. Any clues in there? Jim > On Fri, 26 May 2006, Doug Thistlethwaite wrote: >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Sat May 27 10:41:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 May 2006 10:41:54 -0600 (MDT) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447862E2.4080506@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: On Sat, 27 May 2006, Jim Redman wrote: > Doug, > > Since you mentioned it, we have a system that is also seems slow. From > memory (I don't have one of the slow systems around), I'm not sure that > it's consistent, it seems that sometimes it may take longer than others. > Since it's part of the bootup it hasn't raised a flag and I haven't > researched it. > > The same code runs much faster on other systems, so now you've got me > wondering what's different. > > The slow system boots DSL (http://www.damnsmalllinux.org/) from a > compact flash. FC4 is on my desktop where I haven't noticed a slow > down. I think that the rxtx code is the same in both cases with lock > files disabled. > > The slow system has a bunch of serial ports defined, including 4 USB > serial ports that do not exist - they are not plugged in. > > Any clues in there? > rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. When it does this, it will try to open each port and do a timed out read. most systems will not have entries in device if the port is not there. But some minimal systems will just put all the device files there in case hardware is added. The list of devices scanned used to be ~10-20 times longer than it is today. That was getting very slow. I suspect moving the device files not used to a backup directory would increase the enumeration. I'll look into why the mail-list archive is not updating. The last update was about when I thought I 'fixed' the cron jobs. I probably didn't actually fix it but rather moved the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon May 29 19:46:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 May 2006 19:46:47 -0600 (MDT) Subject: [Rxtx] Mail-List Archives are updating. Message-ID: It was pointed out earlier that the archive is dated. This was a missing crontab entry. The list is currently archived by the week on the web page. It is updated once a day. So every 7 days it starts a new link and updates it daily. I've been limited in what I could do while my cable modem was disconnected this last week. rxtx.org is something I do on my own time. The patches and credits will be comming next. Many of these can be seen in bugzilla right now. -- Trent Jarvi tjarvi at qbang.org From doug at dupreeinc.com Tue May 30 11:18:41 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 10:18:41 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: <447C7E71.4080204@dupreeinc.com> Trent, YiQi, and Jim: Thanks to all for the replies and information! I am just back from a long weekend and I am now trying to figure out what I was doing! :) As for more information. First off, this example is being run under windows XP. I am developing test equipment that communicates with a java application via a serial port. I have been using the commapi for several years and have not had a problem. Recently, I have started a design modification that will replace the RS232 connection with a USB port. I am using the ftdi module for prototyping and I discovered that their virtual com port driver was not compatible with the commapi that Sun released. It turns out that it has problems with hardware flow control ( it works on incoming but not outgoing communications). The way I figured this out was by experimenting with the SerialDemo that was included with the Sum commapi. One nice thing about this example is it has the ability to set incoming and outgoing flow control independently. After I installed RXTX into my JBuilder 2006 IDE, I just replaced all all instances of javax.comm with gnu.io and it compiled and runs without a hitch (except for the slow startup). I Paused the JBuilder IDE during this long pause and the last few entries in the stack trace are: testRead() : -1, gnu.io.RXTXCommDriver registerValidPorts() : 255, gnu.io.RXTXCommDriver registerScannedPorts() : 777, gnu.io.RXTXCommDriver This was all initiated by the following call in the programs init routine: Enumeration en = CommPortIdentifier.getPortIdentifiers(); After looking at this, My guess is that Trent is correct in that the delay is in scanning for ports. I guess one solution would be to not scan for ports, though it would be nice to detect what is available on the system. Is there any way to reduce the number of ports scanned by this function in windows XP? Thanks again for your time, Doug Trent Jarvi wrote: >On Sat, 27 May 2006, Jim Redman wrote: > > > >>Doug, >> >>Since you mentioned it, we have a system that is also seems slow. From >>memory (I don't have one of the slow systems around), I'm not sure that >>it's consistent, it seems that sometimes it may take longer than others. >>Since it's part of the bootup it hasn't raised a flag and I haven't >>researched it. >> >>The same code runs much faster on other systems, so now you've got me >>wondering what's different. >> >>The slow system boots DSL (http://www.damnsmalllinux.org/) from a >>compact flash. FC4 is on my desktop where I haven't noticed a slow >>down. I think that the rxtx code is the same in both cases with lock >>files disabled. >> >>The slow system has a bunch of serial ports defined, including 4 USB >>serial ports that do not exist - they are not plugged in. >> >>Any clues in there? >> >> >> > >rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. > >When it does this, it will try to open each port and do a timed out read. >most systems will not have entries in device if the port is not there. >But some minimal systems will just put all the device files there in case >hardware is added. > >The list of devices scanned used to be ~10-20 times longer than it is >today. That was getting very slow. > >I suspect moving the device files not used to a backup directory would >increase the enumeration. > >I'll look into why the mail-list archive is not updating. The last update >was about when I thought I 'fixed' the cron jobs. I probably didn't >actually fix it but rather moved the problem. > >-- >Trent Jarvi >tjarvi at qbang.org > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/86796453/attachment-0393.html From doug at dupreeinc.com Tue May 30 14:36:09 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 13:36:09 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447C7E71.4080204@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com> Message-ID: <447CACB9.1000801@dupreeinc.com> Hello all, I also notice this pause (not as long however) when I call: CommPortIdentifier.getPortIdentifier(PortName); I would think that if I supply the name of the port, it would not have to go through the same discovery process. If you have any ideas of how to get rid of this startup delay, I would really appreciate it. Thanks, Doug Doug Thistlethwaite wrote: > Trent, YiQi, and Jim: > > Thanks to all for the replies and information! I am just back from a > long weekend and I am now trying to figure out what I was doing! :) > > As for more information. First off, this example is being run under > windows XP. I am developing test equipment that communicates with a > java application via a serial port. I have been using the commapi for > several years and have not had a problem. Recently, I have started a > design modification that will replace the RS232 connection with a USB > port. I am using the ftdi module for prototyping and I discovered > that their virtual com port driver was not compatible with the commapi > that Sun released. It turns out that it has problems with hardware > flow control ( it works on incoming but not outgoing communications). > The way I figured this out was by experimenting with the SerialDemo > that was included with the Sum commapi. One nice thing about this > example is it has the ability to set incoming and outgoing flow > control independently. > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup). > > I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are: > > testRead() : -1, gnu.io.RXTXCommDriver > registerValidPorts() : 255, gnu.io.RXTXCommDriver > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > This was all initiated by the following call in the programs init routine: > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > After looking at this, My guess is that Trent is correct in that the > delay is in scanning for ports. I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system. Is there any way to reduce the number of ports scanned by > this function in windows XP? > > Thanks again for your time, > > Doug > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/edaa5c3c/attachment-0393.html From lynn at swcp.com Tue May 30 15:07:18 2006 From: lynn at swcp.com (lynn@swcp.com) Date: Tue, 30 May 2006 21:07:18 -0000 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CACB9.1000801@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: *IF* the name of the port is supplied, we might want to use the preferences mechanism (java.util.prefs) where we could have previously saved the info for the port. We could do a quick check to see that things have not changed before using it. If things have changed (or never been defined) we would do a full port scan and save detected ports in the preferences. This way if the hardware is not changed, you only pay the time penalty one time. just an idea... Lynn Doug Thistlethwaite said: > This is a multi-part message in MIME format. > --------------070808020900080005070500 > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > Content-Transfer-Encoding: 7bit > > Hello all, > > I also notice this pause (not as long however) when I call: > > CommPortIdentifier.getPortIdentifier(PortName); > > I would think that if I supply the name of the port, it would not have > to go through the same discovery process. If you have any ideas of how > to get rid of this startup delay, I would really appreciate it. > > Thanks, > > Doug > > Doug Thistlethwaite wrote: > > > Trent, YiQi, and Jim: > > > > Thanks to all for the replies and information! I am just back from a > > long weekend and I am now trying to figure out what I was doing! :) > > > > As for more information. First off, this example is being run under > > windows XP. I am developing test equipment that communicates with a > > java application via a serial port. I have been using the commapi for > > several years and have not had a problem. Recently, I have started a > > design modification that will replace the RS232 connection with a USB > > port. I am using the ftdi module for prototyping and I discovered > > that their virtual com port driver was not compatible with the commapi > > that Sun released. It turns out that it has problems with hardware > > flow control ( it works on incoming but not outgoing communications). > > The way I figured this out was by experimenting with the SerialDemo > > that was included with the Sum commapi. One nice thing about this > > example is it has the ability to set incoming and outgoing flow > > control independently. > > > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > > all instances of javax.comm with gnu.io and it compiled and runs > > without a hitch (except for the slow startup). > > > > I Paused the JBuilder IDE during this long pause and the last few > > entries in the stack trace are: > > > > testRead() : -1, gnu.io.RXTXCommDriver > > registerValidPorts() : 255, gnu.io.RXTXCommDriver > > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > > > This was all initiated by the following call in the programs init routine: > > > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > > > After looking at this, My guess is that Trent is correct in that the > > delay is in scanning for ports. I guess one solution would be to not > > scan for ports, though it would be nice to detect what is available on > > the system. Is there any way to reduce the number of ports scanned by > > this function in windows XP? > > > > Thanks again for your time, > > > > Doug > > > > --------------070808020900080005070500 > Content-Type: text/html; charset=ISO-8859-1 > Content-Transfer-Encoding: 7bit > > > > > > > > > Hello all,
>
> I also notice this pause (not as long however) when I call:
>
>          CommPortIdentifier.getPortIdentifier(PortName);
>
> I would think that if I supply the name of the port, it would not have > to go through the same discovery process.  If you have any ideas of how > to get rid of this startup delay, I would really appreciate it.
>
> Thanks,
>
> Doug
>
> Doug Thistlethwaite wrote: >
> > Trent, YiQi, and Jim:
>
> Thanks to all for the replies and information!  I am just back from a > long weekend and I am now trying to figure out what I was doing! :)
>
> As for more information.  First off, this example is being run under > windows XP.  I am developing test equipment that communicates with a > java application via a serial port.  I have been using the commapi for > several years and have not had a problem.  Recently, I have started a > design modification that will replace the RS232 connection with a USB > port.  I am using the ftdi module for prototyping and I discovered that > their virtual com port driver was not compatible with the commapi that > Sun released.  It turns out that it has problems with hardware flow > control ( it works on incoming but not outgoing communications).  The > way I figured this out was by experimenting with the SerialDemo that > was included with the Sum commapi.  One nice thing about this example > is it has the ability to set incoming and outgoing flow control > independently.
>
> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup).
>
> I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are:
>
> testRead() : -1, gnu.io.RXTXCommDriver
> registerValidPorts() : 255, gnu.io.RXTXCommDriver
> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>
> This was all initiated by the following call in the programs init > routine:
>
> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>
> After looking at this,  My guess is that Trent is correct in that the > delay is in scanning for ports.  I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system.  Is there any way to reduce the number of ports scanned by > this function in windows XP? 
>
> Thanks again for your time,
>
> Doug
>
>
> > > > --------------070808020900080005070500-- > -- From jredman at ergotech.com Tue May 30 15:42:35 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 30 May 2006 15:42:35 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: <447CBC4B.2080206@ergotech.com> Lynn, If I understand your idea correctly, I don't think that this would work well for, say, USB ports since these can be easily added/removed by the end user. Jim lynn at swcp.com wrote: > *IF* the name of the port is supplied, we might want to use the preferences > mechanism (java.util.prefs) where we could have previously saved the info for > the port. We could do a quick check to see that things have not changed > before using it. If things have changed (or never been defined) we would do a > full port scan and save detected ports in the preferences. > > This way if the hardware is not changed, you only pay the time penalty one time. > > just an idea... > Lynn > > > Doug Thistlethwaite said: > >> This is a multi-part message in MIME format. >> --------------070808020900080005070500 >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >> Content-Transfer-Encoding: 7bit >> >> Hello all, >> >> I also notice this pause (not as long however) when I call: >> >> CommPortIdentifier.getPortIdentifier(PortName); >> >> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process. If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it. >> >> Thanks, >> >> Doug >> >> Doug Thistlethwaite wrote: >> >>> Trent, YiQi, and Jim: >>> >>> Thanks to all for the replies and information! I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :) >>> >>> As for more information. First off, this example is being run under >>> windows XP. I am developing test equipment that communicates with a >>> java application via a serial port. I have been using the commapi for >>> several years and have not had a problem. Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port. I am using the ftdi module for prototyping and I discovered >>> that their virtual com port driver was not compatible with the commapi >>> that Sun released. It turns out that it has problems with hardware >>> flow control ( it works on incoming but not outgoing communications). >>> The way I figured this out was by experimenting with the SerialDemo >>> that was included with the Sum commapi. One nice thing about this >>> example is it has the ability to set incoming and outgoing flow >>> control independently. >>> >>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup). >>> >>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are: >>> >>> testRead() : -1, gnu.io.RXTXCommDriver >>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>> >>> This was all initiated by the following call in the programs init routine: >>> >>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>> >>> After looking at this, My guess is that Trent is correct in that the >>> delay is in scanning for ports. I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system. Is there any way to reduce the number of ports scanned by >>> this function in windows XP? >>> >>> Thanks again for your time, >>> >>> Doug >>> >> --------------070808020900080005070500 >> Content-Type: text/html; charset=ISO-8859-1 >> Content-Transfer-Encoding: 7bit >> >> >> >> >> >> >> >> >> Hello all,
>>
>> I also notice this pause (not as long however) when I call:
>>
>>         >  CommPortIdentifier.getPortIdentifier(PortName);
>>
>> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process.  If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it.
>>
>> Thanks,
>>
>> Doug
>>
>> Doug Thistlethwaite wrote: >>
>> >> Trent, YiQi, and Jim:
>>
>> Thanks to all for the replies and information!  I am just back from a >> long weekend and I am now trying to figure out what I was doing! :)
>>
>> As for more information.  First off, this example is being run under >> windows XP.  I am developing test equipment that communicates with a >> java application via a serial port.  I have been using the commapi for >> several years and have not had a problem.  Recently, I have started a >> design modification that will replace the RS232 connection with a USB >> port.  I am using the ftdi module for prototyping and I discovered that >> their virtual com port driver was not compatible with the commapi that >> Sun released.  It turns out that it has problems with hardware flow >> control ( it works on incoming but not outgoing communications).  The >> way I figured this out was by experimenting with the SerialDemo that >> was included with the Sum commapi.  One nice thing about this example >> is it has the ability to set incoming and outgoing flow control >> independently.
>>
>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >> all instances of javax.comm with gnu.io and it compiled and runs >> without a hitch (except for the slow startup).
>>
>> I Paused the JBuilder IDE during this long pause and the last few >> entries in the stack trace are:
>>
>> testRead() : -1, gnu.io.RXTXCommDriver
>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>
>> This was all initiated by the following call in the programs init >> routine:
>>
>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>
>> After looking at this,  My guess is that Trent is correct in that the >> delay is in scanning for ports.  I guess one solution would be to not >> scan for ports, though it would be nice to detect what is available on >> the system.  Is there any way to reduce the number of ports scanned by >> this function in windows XP? 
>>
>> Thanks again for your time,
>>
>> Doug
>>
>>
>> >> >> >> --------------070808020900080005070500-- >> > > > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From yhua537 at cse.unsw.edu.au Tue May 30 18:10:23 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 31 May 2006 10:10:23 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CBC4B.2080206@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: Doug, In the SerialDemo, it allow us to save the parameters into a file, and use it when your program start up. Would this help? YiQi On Tue, 30 May 2006, Jim Redman wrote: > Lynn, > > If I understand your idea correctly, I don't think that this would work > well for, say, USB ports since these can be easily added/removed by the > end user. > > Jim > > lynn at swcp.com wrote: >> *IF* the name of the port is supplied, we might want to use the preferences >> mechanism (java.util.prefs) where we could have previously saved the info for >> the port. We could do a quick check to see that things have not changed >> before using it. If things have changed (or never been defined) we would do a >> full port scan and save detected ports in the preferences. >> >> This way if the hardware is not changed, you only pay the time penalty one time. >> >> just an idea... >> Lynn >> >> >> Doug Thistlethwaite said: >> >>> This is a multi-part message in MIME format. >>> --------------070808020900080005070500 >>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>> Content-Transfer-Encoding: 7bit >>> >>> Hello all, >>> >>> I also notice this pause (not as long however) when I call: >>> >>> CommPortIdentifier.getPortIdentifier(PortName); >>> >>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process. If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it. >>> >>> Thanks, >>> >>> Doug >>> >>> Doug Thistlethwaite wrote: >>> >>>> Trent, YiQi, and Jim: >>>> >>>> Thanks to all for the replies and information! I am just back from a >>>> long weekend and I am now trying to figure out what I was doing! :) >>>> >>>> As for more information. First off, this example is being run under >>>> windows XP. I am developing test equipment that communicates with a >>>> java application via a serial port. I have been using the commapi for >>>> several years and have not had a problem. Recently, I have started a >>>> design modification that will replace the RS232 connection with a USB >>>> port. I am using the ftdi module for prototyping and I discovered >>>> that their virtual com port driver was not compatible with the commapi >>>> that Sun released. It turns out that it has problems with hardware >>>> flow control ( it works on incoming but not outgoing communications). >>>> The way I figured this out was by experimenting with the SerialDemo >>>> that was included with the Sum commapi. One nice thing about this >>>> example is it has the ability to set incoming and outgoing flow >>>> control independently. >>>> >>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>> all instances of javax.comm with gnu.io and it compiled and runs >>>> without a hitch (except for the slow startup). >>>> >>>> I Paused the JBuilder IDE during this long pause and the last few >>>> entries in the stack trace are: >>>> >>>> testRead() : -1, gnu.io.RXTXCommDriver >>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>> >>>> This was all initiated by the following call in the programs init routine: >>>> >>>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>> >>>> After looking at this, My guess is that Trent is correct in that the >>>> delay is in scanning for ports. I guess one solution would be to not >>>> scan for ports, though it would be nice to detect what is available on >>>> the system. Is there any way to reduce the number of ports scanned by >>>> this function in windows XP? >>>> >>>> Thanks again for your time, >>>> >>>> Doug >>>> >>> --------------070808020900080005070500 >>> Content-Type: text/html; charset=ISO-8859-1 >>> Content-Transfer-Encoding: 7bit >>> >>> >>> >>> >>> >>> >>> >>> >>> Hello all,
>>>
>>> I also notice this pause (not as long however) when I call:
>>>
>>>         >>  CommPortIdentifier.getPortIdentifier(PortName);
>>>
>>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process.  If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it.
>>>
>>> Thanks,
>>>
>>> Doug
>>>
>>> Doug Thistlethwaite wrote: >>>
>>> >>> Trent, YiQi, and Jim:
>>>
>>> Thanks to all for the replies and information!  I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :)
>>>
>>> As for more information.  First off, this example is being run under >>> windows XP.  I am developing test equipment that communicates with a >>> java application via a serial port.  I have been using the commapi for >>> several years and have not had a problem.  Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port.  I am using the ftdi module for prototyping and I discovered that >>> their virtual com port driver was not compatible with the commapi that >>> Sun released.  It turns out that it has problems with hardware flow >>> control ( it works on incoming but not outgoing communications).  The >>> way I figured this out was by experimenting with the SerialDemo that >>> was included with the Sum commapi.  One nice thing about this example >>> is it has the ability to set incoming and outgoing flow control >>> independently.
>>>
>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup).
>>>
>>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are:
>>>
>>> testRead() : -1, gnu.io.RXTXCommDriver
>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>
>>> This was all initiated by the following call in the programs init >>> routine:
>>>
>>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>
>>> After looking at this,  My guess is that Trent is correct in that the >>> delay is in scanning for ports.  I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system.  Is there any way to reduce the number of ports scanned by >>> this function in windows XP? 
>>>
>>> Thanks again for your time,
>>>
>>> Doug
>>>
>>>
>>> >>> >>> >>> --------------070808020900080005070500-- >>> >> >> >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From halbleib at rechnerbetriebsgruppe.de Wed May 31 02:06:16 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 10:06:16 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp Message-ID: <447D4E78.30302@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, I getting an error while reloading my app in tomcat. At the first start everything runs well, but if i reload mit webapp by tomcat manager i get the following error. java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader Is there a possibility to unload the native library rxtxSerial.dll? thx for all help! regards tom -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 b8FT80HQ1xlbDLnRecDANCc= =heb1 -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 02:52:17 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 10:52:17 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D4E78.30302@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> Message-ID: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Hello Tom, To the best of my knowledge it is impossible to unload native libraries once loaded into the JVM. The exception you see stems from the fact, that Tomcat creates a new classloader when you "reload" the weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar is loaded from the session class loader. Try to add RXTXComm.jar to your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. Regards, Joachim On 31.05.2006, at 10:06, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 > b8FT80HQ1xlbDLnRecDANCc= > =heb1 > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From halbleib at rechnerbetriebsgruppe.de Wed May 31 03:28:35 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 11:28:35 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Message-ID: <447D61C3.1030807@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Joachim, I'm still not getting it. How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml-file? Perhaps web.xml? Regards, Tom Joachim Buechse schrieb: > Hello Tom, > > To the best of my knowledge it is impossible to unload native > libraries once loaded into the JVM. The exception you see stems from > the fact, that Tomcat creates a new classloader when you "reload" the > weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar > is loaded from the session class loader. Try to add RXTXComm.jar to > your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. > > Regards, > Joachim > > On 31.05.2006, at 10:06, Tom Halbleib wrote: > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL tzNy+/0iIUfkYYgt1+UT1ko= =pkpY -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 04:03:42 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 12:03:42 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D61C3.1030807@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> <447D61C3.1030807@rechnerbetriebsgruppe.de> Message-ID: -Xbootclasspath/a: is a start option to the java vm. Google is your friend in finding how to modfiy it and what it means: tomcat modifying bootclasspath Regards, Joachim On 31.05.2006, at 11:28, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Joachim, > > I'm still not getting it. > How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml- > file? > Perhaps web.xml? > > Regards, > Tom > > Joachim Buechse schrieb: >> Hello Tom, >> >> To the best of my knowledge it is impossible to unload native >> libraries once loaded into the JVM. The exception you see stems from >> the fact, that Tomcat creates a new classloader when you "reload" the >> weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar >> is loaded from the session class loader. Try to add RXTXComm.jar to >> your bootlclasspath (-Xbootclasspath/a:) and the problem should go >> away. >> >> Regards, >> Joachim >> >> On 31.05.2006, at 10:06, Tom Halbleib wrote: >> >> Hi all, >> >> I getting an error while reloading my app in tomcat. At the first >> start >> everything runs well, but if i reload mit webapp by tomcat manager >> i get >> the following error. >> >> java.lang.UnsatisfiedLinkError: Native Library >> C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in >> another classloader thrown while loading gnu.io.RXTXCommDriver >> Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: >> Native >> Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already >> loaded >> in another classloader >> >> >> Is there a possibility to unload the native library rxtxSerial.dll? >> >> thx for all help! >> >> regards >> >> tom > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL > tzNy+/0iIUfkYYgt1+UT1ko= > =pkpY > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From impakt01 at optusnet.com.au Wed May 31 06:55:42 2006 From: impakt01 at optusnet.com.au (Daren) Date: Wed, 31 May 2006 22:55:42 +1000 Subject: [Rxtx] (no subject) Message-ID: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/ade7ad37/attachment-0393.html From doug at dupreeinc.com Wed May 31 10:19:19 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 31 May 2006 09:19:19 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: <447DC207.3070702@dupreeinc.com> I am not sure what you are saying. The Save parameters menu option saves the current settings (baud, data bits, etc.). The long pause (~60 seconds) is when the application first starts (before loading the saved parameters). This does bring up a question, though I hate this type of kludge approach to getting this library to work... What exactly is a PortIdentifier? Is it always the same? If I stored the results from "CommPortIdentifier.getPortIdentifier(PortName);" in a file, could I use this the next time the program is executed? In this case I am using a virtual com port driver to connect to the device through a USB port. Doug YiQi Huang wrote: >Doug, > >In the SerialDemo, it allow us to save the parameters into a file, and use >it when your program start up. Would this help? > >YiQi > >On Tue, 30 May 2006, Jim Redman wrote: > > > >>Lynn, >> >>If I understand your idea correctly, I don't think that this would work >>well for, say, USB ports since these can be easily added/removed by the >>end user. >> >>Jim >> >>lynn at swcp.com wrote: >> >> >>>*IF* the name of the port is supplied, we might want to use the preferences >>>mechanism (java.util.prefs) where we could have previously saved the info for >>>the port. We could do a quick check to see that things have not changed >>>before using it. If things have changed (or never been defined) we would do a >>>full port scan and save detected ports in the preferences. >>> >>>This way if the hardware is not changed, you only pay the time penalty one time. >>> >>>just an idea... >>>Lynn >>> >>> >>>Doug Thistlethwaite said: >>> >>> >>> >>>>This is a multi-part message in MIME format. >>>>--------------070808020900080005070500 >>>>Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>>>Content-Transfer-Encoding: 7bit >>>> >>>>Hello all, >>>> >>>>I also notice this pause (not as long however) when I call: >>>> >>>> CommPortIdentifier.getPortIdentifier(PortName); >>>> >>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process. If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it. >>>> >>>>Thanks, >>>> >>>>Doug >>>> >>>>Doug Thistlethwaite wrote: >>>> >>>> >>>> >>>>>Trent, YiQi, and Jim: >>>>> >>>>>Thanks to all for the replies and information! I am just back from a >>>>>long weekend and I am now trying to figure out what I was doing! :) >>>>> >>>>>As for more information. First off, this example is being run under >>>>>windows XP. I am developing test equipment that communicates with a >>>>>java application via a serial port. I have been using the commapi for >>>>>several years and have not had a problem. Recently, I have started a >>>>>design modification that will replace the RS232 connection with a USB >>>>>port. I am using the ftdi module for prototyping and I discovered >>>>>that their virtual com port driver was not compatible with the commapi >>>>>that Sun released. It turns out that it has problems with hardware >>>>>flow control ( it works on incoming but not outgoing communications). >>>>>The way I figured this out was by experimenting with the SerialDemo >>>>>that was included with the Sum commapi. One nice thing about this >>>>>example is it has the ability to set incoming and outgoing flow >>>>>control independently. >>>>> >>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>>without a hitch (except for the slow startup). >>>>> >>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>>entries in the stack trace are: >>>>> >>>>>testRead() : -1, gnu.io.RXTXCommDriver >>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>>> >>>>>This was all initiated by the following call in the programs init routine: >>>>> >>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>>> >>>>>After looking at this, My guess is that Trent is correct in that the >>>>>delay is in scanning for ports. I guess one solution would be to not >>>>>scan for ports, though it would be nice to detect what is available on >>>>>the system. Is there any way to reduce the number of ports scanned by >>>>>this function in windows XP? >>>>> >>>>>Thanks again for your time, >>>>> >>>>>Doug >>>>> >>>>> >>>>> >>>>--------------070808020900080005070500 >>>>Content-Type: text/html; charset=ISO-8859-1 >>>>Content-Transfer-Encoding: 7bit >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>>Hello all,
>>>>
>>>>I also notice this pause (not as long however) when I call:
>>>>
>>>>        >>>> >>>> >>> CommPortIdentifier.getPortIdentifier(PortName);
>>> >>> >>>>
>>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process.  If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it.
>>>>
>>>>Thanks,
>>>>
>>>>Doug
>>>>
>>>>Doug Thistlethwaite wrote: >>>>
>>>> >>>>Trent, YiQi, and Jim:
>>>>
>>>>Thanks to all for the replies and information!  I am just back from a >>>>long weekend and I am now trying to figure out what I was doing! :)
>>>>
>>>>As for more information.  First off, this example is being run under >>>>windows XP.  I am developing test equipment that communicates with a >>>>java application via a serial port.  I have been using the commapi for >>>>several years and have not had a problem.  Recently, I have started a >>>>design modification that will replace the RS232 connection with a USB >>>>port.  I am using the ftdi module for prototyping and I discovered that >>>>their virtual com port driver was not compatible with the commapi that >>>>Sun released.  It turns out that it has problems with hardware flow >>>>control ( it works on incoming but not outgoing communications).  The >>>>way I figured this out was by experimenting with the SerialDemo that >>>>was included with the Sum commapi.  One nice thing about this example >>>>is it has the ability to set incoming and outgoing flow control >>>>independently.
>>>>
>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>without a hitch (except for the slow startup).
>>>>
>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>entries in the stack trace are:
>>>>
>>>>testRead() : -1, gnu.io.RXTXCommDriver
>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>>
>>>>This was all initiated by the following call in the programs init >>>>routine:
>>>>
>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>>
>>>>After looking at this,  My guess is that Trent is correct in that the >>>>delay is in scanning for ports.  I guess one solution would be to not >>>>scan for ports, though it would be nice to detect what is available on >>>>the system.  Is there any way to reduce the number of ports scanned by >>>>this function in windows XP? 
>>>>
>>>>Thanks again for your time,
>>>>
>>>>Doug
>>>>
>>>>
>>>> >>>> >>>> >>>>--------------070808020900080005070500-- >>>> >>>> >>>> >>> >>> >>> >>-- >>Jim Redman >>(505) 662 5156 x85 >>http://www.ergotech.com >>_______________________________________________ >>Rxtx mailing list >>Rxtx at qbang.org >>http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > >cheers >YiQi Huang >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/61d4d4c9/attachment-0392.html From impakt01 at optusnet.com.au Wed May 31 17:02:54 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 09:02:54 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Message-ID: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Hi all, I downloaded 2.1.7-pre16 and managed to build it and get it going. I made the changes as suggested by Peter Smith in an old post, by adding his code to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. Still not working, it opens the port at 9600 according to portmon.exe . Has anyone managed to get this going at a custom rate? Here is the post I'm referring to: http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 Thanks, Daren ________________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Daren Sent: Wednesday, 31 May 2006 10:56 PM To: rxtx at qbang.org Subject: [Rxtx] (no subject) Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren From tjarvi at qbang.org Wed May 31 21:44:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 May 2006 21:44:01 -0600 (MDT) Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> References: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Message-ID: On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org From impakt01 at optusnet.com.au Wed May 31 22:06:04 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 14:06:04 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: Message-ID: <200606010406.k51464X2010447@mail03.syd.optusnet.com.au> Trent, I have managed to successfully open the port at this speed using Realterm (available on sourceforge). From memory this uses DLPortIO. Using portmon.exe with realterm, even there it says that the port has opened at 1953. I changed termios.c:560 to dcb->BaudRate = 1953 ; and it still opens the port at 9600. Daren -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Thursday, 1 June 2006 1:44 PM To: RXTX Developers and Users Subject: Re: [Rxtx] custom baud rate win32 On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From smontgomery at mediaspansoftware.com Mon May 1 09:52:28 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 11:52:28 -0400 Subject: [Rxtx] RXTX, Java COMM and Windows Server 2003 on x64 experiences? Message-ID: Just wondering if anybody here has had to deploy RXTX or the javax.comm on Windows Server 2003 machines running on x64 (i.e. Xeon EM64T) and would like to relate how things went. From Sun's site, the Supported System Configurations pages give the options for that system: Java 5.0: - 32-bit Java 5.0 running on the OS in the 32-bit mode - 64-bit Java 5.0 running on the OS in the 64-bit native mode Java 1.4.2: - no options listed for EM64T processors, but potentially the standard 32-bit Java 1.4.2 could run on the OS in 32-bit mode? I guess the two main points of failure would be 1) the JVM itself and 2) the jni components. Make that three: there's gotta be hardware vendor driver support for the OS in the various modes, too. Guess I better go look at Keyspan's website... Thanks in advance for any info anyone might be able to provide. From smontgomery at mediaspansoftware.com Mon May 1 10:18:33 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 12:18:33 -0400 Subject: [Rxtx] Mailing list archive out of date? Message-ID: The mailing list archive at: http://mailman.qbang.org/pipermail/rxtx/ only shows emails through the end of March. Is there a new archive somewhere else? Didn't see anything mentioned on the wiki. From p.cain at phasefale.com.au Mon May 1 22:33:09 2006 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 02 May 2006 14:33:09 +1000 Subject: [Rxtx] RXTX and the Linux kernel. Message-ID: <4456E105.5080106@phasefale.com.au> Hi, First off the problem I am having isn't caused by RXTX itself but I'm hoping someone out there may have some knowledge that may help me. Background: I have an application monitoring a control system through a standard PC serial port which I talk to with rxtx-2.0.5. The application runs on RedHat7.3 kernel version 2.4.18 using Java 1.4. This configuration has been in use for several years and has proved to be stable. But it has become necessary for me to upgrade the OS but I'm running into problems with the serial communications. Its not that the comms don't work on the new OS (its never that simple) the comms work for a variable period of time (sometimes several hours) and then just stop, nothing on the data lines and control lines all indicate that data could flow. The new OS is Ubuntu 5.10 running kernel version 2.6.12. I have installed the OS and software on a PC and had it perform ok, then install the new OS and same software on the very same hardware and experienced the problems of them comms stopping. In the new OS I'm using Java5 to run the app but since I have experience the problem I reverted back to Java1.4 which didn't fix the problem. I've moved the app to a different system RedHat FC3 running 2.6.14 had experienced the problem. Not wanting to go through all the thing I have tried but I have established that it seems to be the 2.6 versions of the kernel that seem to be the problem and not an individual distribution of Linux. I should point out that I am using the same jar and library files for each java and OS combination. So I'm just wondering if anyone has had or heard of problems similar to these ? Or perhaps might know of what changed in the Linux serial driver (something I'm having a hard time establishing). I'm starting to run low on ideas of what to try so any help would be much appreciated. -- Peter Cain Senior Programmer Phasefale Pty Ltd From tjarvi at qbang.org Wed May 3 07:31:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 May 2006 07:31:00 -0600 (MDT) Subject: [Rxtx] Re: Concering ircomm and RXTX In-Reply-To: References: Message-ID: On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From legolas.w at gmail.com Wed May 3 08:46:23 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 19:16:23 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <4458C23F.2000003@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From legolas.w at gmail.com Wed May 3 13:10:57 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 23:40:57 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <44590041.80706@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From Lars.Hennig at wow-portal.com Thu May 4 00:39:15 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Thu, 4 May 2006 08:39:15 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: Message-ID: Hi, I could not find any solution. I therefore decided to to my own native implementation. Allthough it only supports the functions I need, it works pretty well now for me. I think the main problem there is the use of a wrong Windows API function and not setting an timeout. Regards, Lars Hennig W?rth Online World GmbH Tel. (0049)7181-258183 Mob. (0049)160-3522889 Fax. (0049)7940-153299 Lars.Hennig at wow-portal.com Gesendet von: rxtx-bounces at qbang.org 09.04.2006 10:42 Bitte antworten zu RXTX Developers and Users An d.herwald at dsh-elektronik.de, RXTX Developers and Users Kopie Thema Re: [Rxtx] USB Serialport - disconnection problems WV Proj./Teilpr.: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/7b39f374/attachment-0397.html From Pawan.Kharbanda at dot.state.co.us Thu May 4 11:00:58 2006 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Thu, 4 May 2006 11:00:58 -0600 Subject: [Rxtx] Dangling Lock Files Message-ID: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Hi, I have been using RXTX API's for the Serial Communication for quite some time now and for some of the devices we are opening and closing the connection every 2 minutes. This works great for few days and then suddenly I start seeing some "Port in Use Exception" and I see that the Lock files are still in the /var/lock folder after manually removing the lock files it works good for few hours and I see the same problem again. Can somebody explain me the scenarios why I am seeing the dangling Lock files? I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise Servers. Thanks Pawan Kharbanda -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/ba0e9261/attachment-0397.html From tjarvi at qbang.org Thu May 4 14:10:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:10:30 -0600 (MDT) Subject: [Rxtx] Dangling Lock Files In-Reply-To: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> References: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Message-ID: On Thu, 4 May 2006, Kharbanda, Pawan wrote: > Hi, > I have been using RXTX API's for the Serial Communication for quite > some time now and for some of the devices we are opening and closing the > connection every 2 minutes. This works great for few days and then > suddenly I start seeing some "Port in Use Exception" and I see that the > Lock files are still in the /var/lock folder after manually removing the > lock files it works good for few hours and I see the same problem again. > Can somebody explain me the scenarios why I am seeing the dangling Lock > files? > > I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise > Servers. Hi Pawan The next time it happens, look in the lockfile. There will be a pid. ps aux |grep 'pid' I think you will see that the application is still running for some reason. RXTX does a kill -0 on the pid to see if its alive. If not, it will remove the lockfile. So I suspect the previous program did not exit as you expected. -- Trent Jarvi tjarvi at qbang.org From Scott.Hughes at dalsemi.com Thu May 4 14:23:11 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 4 May 2006 15:23:11 -0500 Subject: [Rxtx] Wiki instructions... Message-ID: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire demo apps, when I stumbled across this tip on the wiki to add yourself to the uucp group: It may be simpler to just run usermod -G uucp jarvi Taken from: http://rxtx.qbang.org/wiki/index.php/Installation This does not work as advertised. I should have read the man page for usermod before I tried that out. If there are any groups which are not listed after the -G switch, the user is removed from those groups. On Ubuntu, this is bad... I removed myself from the Admin group, which removed my sudo priviledges. Ubuntu has no root account, so I've disabled the only account which could fix it. Anyone know of a good workaround? Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor From tjarvi at qbang.org Thu May 4 14:32:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:32:09 -0600 (MDT) Subject: [Rxtx] Wiki instructions... In-Reply-To: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> Message-ID: On Thu, 4 May 2006, Scott Hughes wrote: > I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire > demo apps, when I stumbled across this tip on the wiki to add yourself to > the uucp group: > > It may be simpler to just run > > usermod -G uucp jarvi > > Taken from: > http://rxtx.qbang.org/wiki/index.php/Installation > > This does not work as advertised. I should have read the man page for > usermod before I tried that out. If there are any groups which are not > listed after the -G switch, the user is removed from those groups. On > Ubuntu, this is bad... I removed myself from the Admin group, which removed > my sudo priviledges. Ubuntu has no root account, so I've disabled the only > account which could fix it. > > Anyone know of a good workaround? > Yikes This will get your permissions back: in grub/lilo/.. pass the following option to the kernel init=/bin/sh You are now root. when it boots, mount -o remount,rw / add yourself to the groups, reboot to get normal init going. Thats about all I can think of without sudo/root. -- Trent Jarvi tjarvi at qbang.org From Gettings at earth.utah.edu Thu May 4 14:41:22 2006 From: Gettings at earth.utah.edu (Paul Gettings) Date: Thu, 4 May 2006 14:41:22 -0600 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <20060504204122.GA6534@earth.utah.edu> When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get messages on stdout from the JVM: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 As the only change was the version of RXTX (from 2.1.6), I am unsure why the messages suddenly appeared. Anyone know how to get rid of them? Thanks. -- 101 USES FOR A DEAD MICROPROCESSOR (23) Dead cat brush From mmester at sps.edu Mon May 1 21:22:28 2006 From: mmester at sps.edu (Michael Mester) Date: Mon, 1 May 2006 23:22:28 -0400 Subject: [Rxtx] Windows PortInUseException Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> I'm trying to get simple serial communication going with RxTx under Windows XP. I can enumerate the ports fine, but I always run into problems when I try to open one. I get a PortInUseException, but the owner application is "Unknown" and the port is never open. I've tried this on several different systems and all of them give the same behavior. The only thing I can thiunk of that might be causing the problem is that fact that I had to put the serial .dll file in system32 instead of the reccommended folder, because it didn't work in the folder the documentation gives. The library loads fine, though, so I'm not sure whether that makes sense, and I don't know how to fix it anyway. Any help is greatly appreciated. Below is the output of the program, right up to the PortInUseException and the NullPointerException it causes (because the serial port object is not instantiated). C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI Starting GPSTalkerGUI... Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 gnu.io.PortInUseException: Unknown Application Exception in thread "main" java.lang.NullPointerException at GPSTalkerGUI.(GPSTalkerGUI.java:102) at GPSTalkerGUI.main(GPSTalkerGUI.java:161) Again, thank you very much for any help you can give. From lshellman at qwest.net Wed May 3 01:38:34 2006 From: lshellman at qwest.net (Lucious Shellman) Date: Wed, 03 May 2006 01:38:34 -0600 Subject: [Rxtx] Help needed: Project using parallel port Message-ID: <1146641914.8337.14.camel@localhost.localdomain> I was looking for a way to access the parallel port on a PC using Java. Searching the Internet, I came across this site (rxtx.org). What I am trying to do is detect logic levels from a TTL logic IC on the parallel port. I am not trying to do classic parallel port communication. I just want to detect whether a line(s) is (are) high or low. I am using Windows 98. Can rxtx be used to do this? If yes, is there a tutorial for using rxtx posted on the Internet that someone can direct me to. If you need more information, feel free to e-mail me. Unfortunately for me, I need the information ASAP. Thanks. lshellman at qwest.net From webmaster at egyhelp.com Wed May 3 18:43:39 2006 From: webmaster at egyhelp.com (Mohamed Samy) Date: Thu, 4 May 2006 02:43:39 +0200 Subject: [Rxtx] RE: Concering ircomm and RXTX In-Reply-To: Message-ID: <20060503184362.SM01044@Geek> Hey, I issue the command "modprobe ircomm-tty" yet no ttyircomm appears, while the ircomm appear by "modprobe ircomm" so forgive me but I am bit lost. Even searching google for the keyword "ttyircomm" only returns 3 matches. So any way I can start the ttyircomm???? Thanks a lot. -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Wednesday, May 03, 2006 3:31 PM To: Mohamed Samy; rxtx at qbang.org Cc: taj at www.linux.org.uk Subject: Re: Concering ircomm and RXTX On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 4 15:49:49 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 15:49:49 -0600 (MDT) Subject: [Rxtx] Windows PortInUseException In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> Message-ID: On Mon, 1 May 2006, Michael Mester wrote: > > I'm trying to get simple serial communication going with RxTx under > Windows XP. I can enumerate the ports fine, but I always run into > problems when I try to open one. I get a PortInUseException, but the > owner application is "Unknown" and the port is never open. I've tried > this on several different systems and all of them give the same > behavior. The only thing I can thiunk of that might be causing the > problem is that fact that I had to put the serial .dll file in system32 > instead of the reccommended folder, because it didn't work in the folder > the documentation gives. The library loads fine, though, so I'm not sure > whether that makes sense, and I don't know how to fix it anyway. Any > help is greatly appreciated. Below is the output of the program, right > up to the PortInUseException and the NullPointerException it causes > (because the serial port object is not instantiated). > > C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI > Starting GPSTalkerGUI... > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > gnu.io.PortInUseException: Unknown Application > Exception in thread "main" java.lang.NullPointerException > at GPSTalkerGUI.(GPSTalkerGUI.java:102) > at GPSTalkerGUI.main(GPSTalkerGUI.java:161) > Perhaps you are trying to open the port twice in your code? rxtx does open the ports, do a timed out read and then close the ports during enumeration. I think the port is being opened fine. The Unknown Application is always reported. On linux, there is some code that finds the actual application but on windows, its always unknown. If the port enumeration is returning the ports you expect, rxtx has opened the port and closed it with success. The port should open. There is also example code in the contrib directory that comes with rxtx source that has examples you can modify to work. -- Trent Jarvi tjarvi at qbang.org From Christian.Klemke at t-online.de Thu May 4 23:37:23 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Fri, 5 May 2006 07:37:23 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu> Message-ID: <004f01c67005$fc72fee0$016a10ac@NB600> Hi Paul, I was wondering about the same question some days ago and took a look at the source files. Unfortunately, I found that you can only get rid of that messages by altering and recompiling the Java code. There is a final static boolean variable called "devel" in the file "RXTXCommDriver.java" which is set to "true". This constellation causes the output after the native libraries have been loaded. No mechanism exists to suppress them otherwise :-(. Trent, does that mean that 2.1.7 is still officially a "development" version ? When will this value be changed to "false" by default ? With 2.1.8 ? It would be nice to provide a means to suppress such messages besides that static flag (maybe by setting a property called "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The output can indeed by annoying, especially when used with console applications, where the message potentially appears "in the middle" of your own output. Another possibility would be not to use System.out directly, but instead some PrintStream field which is initially set to System.out but can programatically be changed. That would allow for any kind of redirection or suppression by implementing appropriate user-defined PrintStream subclasses and making RXTX use that stream. What do you think ? Best regards, Christian ----- Original Message ----- From: "Paul Gettings" To: Sent: Thursday, May 04, 2006 10:41 PM Subject: [Rxtx] RXTX causing stdout messages > When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get > messages on stdout from the JVM: > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > As the only change was the version of RXTX (from 2.1.6), I am unsure > why the messages suddenly appeared. Anyone know how to get rid of > them? > > Thanks. > > -- > 101 USES FOR A DEAD MICROPROCESSOR > (23) Dead cat brush > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri May 5 06:09:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 06:09:46 -0600 (MDT) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <004f01c67005$fc72fee0$016a10ac@NB600> References: <20060504204122.GA6534@earth.utah.edu> <004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: On Fri, 5 May 2006, Christian Klemke wrote: > Hi Paul, > > I was wondering about the same question some days ago and took a look at the > source files. Unfortunately, I found that you can only get rid of that > messages by altering and recompiling the Java code. There is a final static > boolean variable called "devel" in the file "RXTXCommDriver.java" which is > set to "true". This constellation causes the output after the native > libraries have been loaded. No mechanism exists to suppress them otherwise > :-(. > > Trent, does that mean that 2.1.7 is still officially a "development" version > ? When will this value be changed to "false" by default ? With 2.1.8 ? It > would be nice to provide a means to suppress such messages besides that > static flag (maybe by setting a property called > "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The > output can indeed by annoying, especially when used with console > applications, where the message potentially appears "in the middle" of your > own output. Another possibility would be not to use System.out directly, but > instead some PrintStream field which is initially set to System.out but can > programatically be changed. That would allow for any kind of redirection or > suppression by implementing appropriate user-defined PrintStream subclasses > and making RXTX use that stream. What do you think ? > A patch for using properties would be accepted I'm sure. The reason the default is to display the message is not related to the development state of rxtx anymore. The problem is that people first using rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. The message prevents a great deal of email thats easily explained by the message. I question if we should support rxtx 2.0 at all anymore. If you post a patch in bugzilla, we'll put it into CVS this weekend. we'll be going through and doing such things anyhow. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri May 5 13:23:56 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 13:23:56 -0600 (MDT) Subject: [Rxtx] How to read from RxTx parallel port in Win XP In-Reply-To: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> References: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> Message-ID: On Thu, 27 Apr 2006, Worsley, Bob (Development Engineer) wrote: > I'm sorry if this is a dumb question, but I didn't find the answer in > the archives. > > I'm using the RxTx binaries for Windows on a reasonably current notebook > PC running Windows XP. I can send stuff to a printer on the parallel > port (LPT1), but I can't get anything back. > > I wrote a class that has the methods listed below. I write some data to > the printer with the "write" method and then try to read a response > using the "read" method, but I never get any data. I'd greatly > appreciate any help you can give! > > Bob Worsley > bobwoyid2 at yahoo.com > > > > > private ParallelPort parallelPort = null; > private RXTXCommDriver parallelPortDriver = null; > > > public boolean initialize() throws IOException { > if (parallelPort != null) { > return false; // Already initialized > } > > // Create the parallel port; > parallelPortDriver = new RXTXCommDriver(); > parallelPort = > (ParallelPort)parallelPortDriver.getCommPort(address, > CommPortIdentifier.PORT_PARALLEL); > > // Set the parallel port parameters. > try { > parallelPort.enableReceiveTimeout(READ_TIMEOUT); > parallelPort.disableReceiveFraming(); > parallelPort.disableReceiveThreshold(); > //parallelPort.setMode(mode); !!!!errors > } catch (UnsupportedCommOperationException e) { > throw (new IOException("Parallel port with address '" + > address > + "' cannot be configured as specified")); > } > > return true; > } > > > > public void write(final byte[] bytes) throws IOException { > initialize(); > while (busyReading) { > Thread.yield(); > } > busyWriting = true; > if (bytes.length < 1) { > return; > } > OutputStream outputStream = parallelPort.getOutputStream(); > outputStream.write(bytes); > outputStream.flush(); > outputStream.close(); > Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); > busyWriting = false; > } > > > public byte[] read() throws IOException { > > // Read up to MAX_BYTES bytes. > initialize(); > while (busyWriting) { > Thread.yield(); > } > busyReading = true; > byte[] buff = new byte[MAX_BYTES_READ]; > InputStream inputStream = parallelPort.getInputStream(); > // This read blocks until input data is available > int bytesRead = inputStream.read(buff); > inputStream.close(); > // If no data read, create empty array > if (bytesRead == -1) { > bytesRead = 0; > } > byte[] deviceBytes = new byte[bytesRead]; > System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); > if (bytesRead > 0) { > Debug.p("PPIOP.read - got data: '" + new > String(deviceBytes) + "'"); > } > busyReading = false; > return deviceBytes; > } > Hi Bob I've only used rxtx to test a hello world page printing but there are others that have used it. PPIOP? hmm what is this? :) The rxtx parallel support is behind the serial support but should be OK. As you note, the setting of modes is not supported. rxtx uses what is provided when the port is open. Are your asserting the pin for the printer being online? I suspect what often happens is people try to just use the data pins but the C API rxtx uses wants the printer to be online. There should be some posts relating to this in the rxtx mail-list archive. Some APIs are probably reading and writing from the port address (also suggested in your code as something you are looking at). RXTX currently uses a higher level C/C++ API for port access. This can still work if the API thinks the 'printer' is there. -- Trent Jarvi tjarvi at qbang.org From agrodellic at gmail.com Sat May 6 08:39:40 2006 From: agrodellic at gmail.com (Leigh Stewart) Date: Sat, 6 May 2006 10:39:40 -0400 Subject: [Rxtx] sun commapi 3 Message-ID: I think I read here: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html that rxtx-2.0 is basically fracked for now? Does anyone know of a workaround? ie can i somehow get an older version of sun's comm api and use that (not easy to find)? i mean 2.0 must be working for someone...how is it being tested. 2.1 isnt working for me....im getting nasty native exceptions etc, which is why im so set on 2.0... any ideas? From tjarvi at qbang.org Sun May 7 15:40:27 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 7 May 2006 15:40:27 -0600 (MDT) Subject: [Rxtx] sun commapi 3 In-Reply-To: References: Message-ID: On Sat, 6 May 2006, Leigh Stewart wrote: > > 2.1 isnt working for me....im getting nasty native exceptions etc, > which is why im so set on 2.0... any ideas? > Hi Leigh What native exceptions are you seeing? Which OS? The native code is almost identical between rxtx 2.0 and 2.1. Only the names have been changed to protect the inocent. :) ie: javax_comm_... vs gnu_io_... So the odds are very likely that even if you do find commapi 2.0 and get it installed, you will run into the same error. It would be better to just find and fix the problem. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Mon May 8 10:47:20 2006 From: mail at willicon.de (WILLICon) Date: Mon, 08 May 2006 18:47:20 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 Message-ID: <445F7618.3070303@willicon.de> Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/ef37e8ec/attachment-0397.html From tjarvi at qbang.org Mon May 8 16:14:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 May 2006 16:14:51 -0600 (MDT) Subject: [Rxtx] Screenshot of Application using RXTX (fwd) Message-ID: Just though someone may end up searching for 0x0D and 0x0A. Here are the details from his system. SuSE Linux 10.0 (x86_64) Kernel 2.6.13-15.8 j2se 1.4.2_11 (i586) Sun: comm3.0_u1 rxtx: rxtx-2.1-7 ---------- Forwarded message ---------- Date: Sat, 6 May 2006 20:01:46 +0200 From: Michael Poppitz To: taj at www.linux.org.uk Subject: Screenshot of Application using RXTX Hi Trent, the rxtx package works like a charm. Sun's package seemed to replace all 0x0D with 0x0A in received data on my Linux box, which is really annoying when transfering binary data. But rxtx came and saved the day - and turned out to be a lot more convenient as it does not require a configuration file. I use it for connecting to a home made logic analyzer. (http://www.sump.org/projects/analyzer/) Thanks for your great job, Michael -------------- next part -------------- A non-text attachment was scrubbed... Name: la_client.png Type: image/png Size: 16592 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/45494fbb/la_client-0397.png From tjarvi at qbang.org Tue May 9 14:56:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 May 2006 14:56:05 -0600 (MDT) Subject: [Rxtx] RXTX javax.comm: which one to install? In-Reply-To: <20060509161742.43547.qmail@web53814.mail.yahoo.com> References: <20060509161742.43547.qmail@web53814.mail.yahoo.com> Message-ID: On Tue, 9 May 2006, Adenilson Cavalcanti wrote: > Dear Trent Jarvi > > I'm trying to write a small Java app running in linux that interfaces with a device connected to serial port. > > I do have some questions about RXTX and javax.comm state of affairs, since I'm new to Java programming (used to program in plain old C writting to devices using termios and open/write/read syscalls, but this is another story). > > I ask you the favor to clarify this issues (if possible...): > > a) Sun offers to download a file (comm3.0_u1_PUTAUNIXVERSION.zip) which does contain .so files. Does it work out of box? > > b) Case negative, its there that we should use 'librxtx*.so' provided by your site? > > c) Sun's comm3 API version does work with which version of rxtx? > > I already searched google and read documentation available in rxtx site ("Java Comm Serial API How-to") but still have this issues unsolved. Any help will be appreciated. > > Best regards > > Adenilson Hi Adenilson, RXTX does not currently support javax.comm in Sun's CommAPI 3.0. I would recommend using package gnu.io provided by rxtx 2.1. -- Trent Jarvi tjarvi at qbang.org From chris.develder at intec.ugent.be Wed May 10 08:45:40 2006 From: chris.develder at intec.ugent.be (Chris Develder) Date: Wed, 10 May 2006 16:45:40 +0200 Subject: [Rxtx] rxtx troubles on ARM Message-ID: <4461FC94.6040909@intec.ugent.be> Hi all, Sorry to bother you, but I don't seem to get RXTX working on an ARM processor (xscale ixp 425, big endian). I managed to crosscompile the rxtx libs and moved it over to the ARM. Using jamvm (which is the only open source java VM we got working on the ARM), I get the following error result when running SimpleRead from Sun's javax.comm examples (commapi\examples\Simple\SimpleRead) -- see bottom of mail for complete output: "java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver" However, output shows that the RXTXCommDriver code is accessible (cf. debug and devel output of lib versions). So it doesn't seem to be a missing lib/jar issue. The error happens before RXTXCommDriver.initialize() is called, since the first line there is System.out.println("RXTXCommDriver:initialize()"); Any ideas? Cheers, Chris ---------------------------- [root at xxx(ttyp1) /work/cdvelder/xscale/test]# jamvm -Djava.library.path=/work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/jre/lib/arm -classpath /work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/lib/ext/RXTXcomm.jar:./comm.jar:. SimpleRead RXTXCommDriver {} Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTXCommDriver: Jar version = RXTX-2.1-7 native lib Version = RXTX-2.1-7 java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver gnu/io/RXTXCommDriver at javax.comm.CommPortIdentifier.loadDriver (CommPortIdentifier.java:239) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:109) at SimpleRead.main (Unknown Source) java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive (Native Method) at com.sun.comm.Portmapping.registerCommPorts (Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase (Portmapping.java:100) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:138) at SimpleRead.main (Unknown Source) From joachim at buechse.de Fri May 12 00:44:48 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 08:44:48 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) Message-ID: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Good day, I guess that only a selected few (hi Trent) will be able to answer this question, but the answer might be interesting for anyone trying to debug or understand the code. Apparently the MonitorThread is started and stopped in RXTXPort.addEventListener and RXTXPort.removeEventListener. This would indicate that (originally?) the MonitorThread is only required when there is an EventListener. However the MonitorThread is also started in the RXTXPort constructor, which could mean that RXTX won't work at all if it isn't there. It seems to me, that if anyone would add an event listener and later on remove it, he could potentially wreak the port. Because the second action would kill the MonitorThread. For the moment I am only trying to understand the role of and idea behind the MonitorThread. But of course there is a deeper reason thor my question: If the MonitorThread needs to exist anyway, it could be the thread that cleans up the port (ie calls nativeClose) - this would eliminate (a further) problem I am seeing with some USB drivers on Mac OSX. (Close blocks (after releasing the tty, but still) in the USB driver if the device is "not responding"). Greetings, Joachim From tjarvi at qbang.org Fri May 12 07:10:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 12 May 2006 07:10:59 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Fri, 12 May 2006, Joachim Buechse wrote: > Good day, > > I guess that only a selected few (hi Trent) will be able to answer > this question, but the answer might be interesting for anyone trying > to debug or understand the code. > > Apparently the MonitorThread is started and stopped in > RXTXPort.addEventListener and RXTXPort.removeEventListener. This > would indicate that (originally?) the MonitorThread is only required > when there is an EventListener. However the MonitorThread is also > started in the RXTXPort constructor, which could mean that RXTX won't > work at all if it isn't there. > > It seems to me, that if anyone would add an event listener and later > on remove it, he could potentially wreak the port. Because the second > action would kill the MonitorThread. > > > For the moment I am only trying to understand the role of and idea > behind the MonitorThread. But of course there is a deeper reason thor > my question: > > If the MonitorThread needs to exist anyway, it could be the thread > that cleans up the port (ie calls nativeClose) - this would eliminate > (a further) problem I am seeing with some USB drivers on Mac OSX. > (Close blocks (after releasing the tty, but still) in the USB driver > if the device is "not responding"). > Hi Jaochim Before commapi, rxtx did not support events. You could read, write and change port settings. The MonitorThread was added as an afterthought to support commapi events. So the way things are now his historical spaghetti not a well devised plan. It is my opinion that the MonitorThread should exist as long as the port is open. The odd starting of the thread in the constructor and addEventListener was just to get past the obvious problem of people using the port without adding listeners. -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Fri May 12 07:59:50 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 15:59:50 +0200 Subject: [Rxtx] MonitorThread -> ChangeRequest In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: <2B1E508C-8CEE-4AB7-914D-E7BA25C871A2@buechse.de> In this case I suggest removing the starting/stopping of MonitorThread in addEventListener / removeEventListener. This should not affect existing projects. On 12.05.2006, at 15:10, Trent Jarvi wrote: > It is my opinion that the MonitorThread should exist as long as the > port > is open. The odd starting of the thread in the constructor and > addEventListener was just to get past the obvious problem of people > using > the port without adding listeners. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Fri May 12 11:43:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 19:43:21 +0200 Subject: [Rxtx] Spring Cleaning - some suggestions Message-ID: The current implementation of RXTX contains quite a lot of code that will break if it is used from several threads (especially on a multi processor machine). I think it would be nice to clean this up. I suggest the following changes (which keep the current semantics and should not influence existing projects in a negative way): - InterruptedException will never be ignored or reset - read methods will be protected with a Monitor - write methods will be protected with a (separate) Monitor - close() sets the read and write monitors into a "closed" state which will lead to IOExceptions for any following call to RXTXPort.read/write. - close() will wait a finite amount of time (maybe 500ms) for the release of the read and write monitors after that, it will trigger the closing of the file descriptor to abort any pending read or write. - close() will not call close(file_desc). Instead it will "interrupt" (ie set a flag and then, pthread_kill(ABRT)) the MonitorThread, the MonitorThread will call close(file_desc). - the monitors are properly released in a finally block the try of which starts directly after obtaining the monitor. - finally will not call close(file_desc) it will only "interrupt" the MonitorThread (see above) - the native-code (esp read) does not use SA_RESTART but checks Thread.interrupted() when it receives a SIGNAL (ie system call returns with EINTR or other signalling method). The read/write monitors will be allocated from a factory whose mode can be set to fast/normal/advanced. In fast-mode it will create "non thread safe, non synchronized" pseudo-monitors. In default mode, the monitors will store the owning thread. In "advanced" mode setting the monitors into closed state will "interrupt()" threads which are blocked in a native read/write. {Reasoning close behaviour: Calling close on a file descriptor in Windows unblocks any read() or write() on the same file descriptor with an error. On Solaris < 2.7 and MacOS X however the close() will/ can block - until the read or write have finished:-(( Even the JDK people have trouble with this. I dont know how Linux reacts in this case. The best practice for BSD/Solaris is to send a signal to the thread which will usually unblock the read/write with an EINTR - this however is not guarenteed as it also depends on the device driver. So the only resolution that will certainly not block the thread calling RXTXPort.close() (which will often enough be the AWT event dispatcher or the VM finalizer thread) is to call close(fd) from another thread.} {Reasoning read behaviour: It is rather uncommon to receive a signal while reading or writing - it will happen, but checking Thread.interrupted() when it happens will not degrade performance. The checking of Thread.interrupted() can be handled by returning to Java and potententially reentering into the native code if the thread was not interrupted or by calling back into the VM from the native code. On top of this, many functions like read(byte[]) or read(byte [], int, int) are allowed to return less than the requested amount of data. Only int read() is a bit more tricky. } [Trent: From the code I can tell, that you experimented quite a bit with signals. Do you know if the Java Thread.interrupt() triggers a unix signal on Linux/Solaris? If so, which one?? References: - http://java.sun.com/docs/hotspot/VMOptions.html - http://www.hp.com/products1/unix/java/infolibrary/prog_guide/ signals.html ] On OS X (hotspot client jdk-1.4.2) I did not see any signal propagated to the SELECT of the event_loop/MonitorThread (ie no EINTR) when I call monThread.interrupt(). This is a pitty, but thats the way it is. I simply assume this is true for most system calls. How to handle this? Of course it would be possible to install/ deinstall a specific signal handler before/after every native read and to natively send an ABRT signal if RXTXPort.close is called. A more elegant solution might be to have an additional "signaling" socket which is always included in the SELECT. Or the simplest solution: cap the timeout of the select to 500 ms (the loop around it exists already) after every timeout check the Thread.interrupted() flag. From a performance perspective this should be completely invisible... On the other hand, all write() calls need to be preceeded by a SELECT as well, to avoid running into a blocking write. Best regards, Joachim From lyon at docjava.com Sat May 13 05:54:52 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 13 May 2006 07:54:52 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Dmitry suggests that we acquire an implementation of a serial port reference, use it, then release it (i.e., check it back in). Joachim says that making serial ports thread friendly might be a good idea. This is a good idea. The design pattern that is close to this idea is the "Object Pool Design Pattern". # Object Pool Manage the reuse of objects for a type of object that is expensive to create or only a limited number of a kind of object can be created. It has been described at: http://www.developer.com/java/ent/article.php/626171 and in Marks' book, Patterns in Java, Volume 1. However, the Object Pool is intended to pool objects so that each object is just like every other object. The intent of the Parametric Singleton is to enable others to access the same resource at the same time (as long as the same parameters were used in construction). It sounds like we need a NEW Design Pattern (Oh no, Doug is doing it again!). Yes friends, you got me on a role (roll) :) If you like design patterns, you can thank me later. If you don't like design patterns, blame Dmitry, it was his idea ;) And Dave, thanks for the feedback on Singleton abuse. It has led me to change the way I think about application contexts, which we will see, below. We need (drum roll please): The Parametric Object Pool Design Pattern (POP) By Douglas A. Lyon ABSTRACT The goal of the Parametric Singleton design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values, in a given context. In comparison, the goal of the POP design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values and that only one reference to the class is checked out at a time, in a given context. A context is a namespace for holding identifiers during execution. In Java, A context can be changed in any of several ways. For example, creation of a new class loader, the deserialization of an old POP or the creation of a new process all create a new namespace. The POP Design Pattern combines the Parametric Singleton Design Pattern with the check out mechanism of the Object Pool Design Pattern. This enables unique creation of instances of a class. These instances are cached in a table. When a clients asks for an instance with these parameters, the cache is checked. If the instance is not in the cache it is created. If the instance is available, the clients checks out the instance. A reference is left to the clients that checked out the instance. The POP has the role of creating objects uniquely, from parameters. It also has the role of keeping track of which clients has checked out a given object. This is just like a library keeping track of who borrowed a book. If a resource is left unavailable in a system, a deadlock can occur. Deadlock debugging is facilitated by mapping a resource to the clients that have checked it out. We apply our POP Design Pattern to the retrieval of serial ports. The goal of our system is to make sure that serial ports are checked out to only one client at a time, and that they be checked back in when the client is done. The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. Users are discouraged from calling this the Parametric Object Oriented Pool (POOP). Introduction The intent of the POP Design Pattern is to ensure that a class has only one instance for a given set of parameter values. It also provides a point of access that is global to a given context. The POP uses the Singleton Design Pattern to ensure that there is only one POP, in the given context. The POP DP is responsible for checking out a reference to a given instance, and keeping track of that instance. The instance is responsible for sharing that instance. POP requires that users of the DP implement an interface that enables a recall facility. Thus, if there is a contention for a consumed resource, the deadlock can be resolved in an orderly fashion. Motivation A system cannot tolerate multiple instances of some classes with identical parameters used by different instances at the same time. For example, you cannot have two instances use the same serial port, at the same time. You cannot have two instances that are trying to listen to the same socket connection. You cannot have two instances writing to the same file structure at the same time. Further, once a serial port is checked out by a client, it is assigned to the client. This is like the spin-lock service provided by the operating system, only in the application layer. Naturally, deadlock will occur if a resource is not released, therefore the client of the resource is tracked. Recalling a resource is required for the POP DP by virtue of the implementation of an interface. The policy on how to break a deadlock (by honoring the recall) is application specific. As the operating system is often thought of as the arbiter of consumed resources (i.e., tape drives, serial ports, etc.) we frequently leave it to an operating system implementation to resolve these contention issues. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on naming conventions (which are not well standardized). The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. The POP Design Pattern can take on the role of the peer method mapper that homogenizes the API for different operating environments. That is, it can wrapper the different locking mechanisms used in different operating systems. POP that is responsible for keeping track of the instances created and the client that has checked them out. The POP Design Pattern is implemented using the Singleton Design Pattern. In Java, the POP implementation is declared final, so that it cannot be subclassed. The class also has a private constructor, so that other classes cannot instance it. The new design pattern is called the POP design pattern and it provides a way to check out and create instances with given parameters. Applicability Use the POP Design Pattern when: 1. There must be exactly one instance of a class with the given parameters in a given context. 2. The instances must be accessible to clients from a well-known access point. 3. The instances are reusable. 4. Only one client can check out an instance at a time. Structure Insert UML diagram here. Participants The POP Clients that need instances 1. The POP defines an instance upon request from a client, if, and only if, the instance does not already exist. 2. The POP returns the instance to the client. 3. The POP is responsible for creating unique instances from given parameters. 4. The POP is responsible to recalling instances from clients. Collaborations Clients obtain a reference to a POP instance only through the singleton design pattern. If the POP instance is left in an improper state (e.g., the serial port was left open) it is NOT the role of the POP to close the IO port. However, the POP can be requested to get the instance released. Nor is it the role of the POP Design Pattern to open the port. That role is delegate to some other part of the system. Further, it is the role of the POP Design Pattern to check out resources. However, it is still possible to have, multiple threads that have multiple references to the same resource at the same time. Checkout and resource requests are MUTEX locked (i.e., synchronized). Consequences The POP Design Pattern has several benefits: 1. Controlled access to parametrically defined instances. Since the POP encapsulates its instances, there is some limited control over how and when clients access it. 2. Reduced name space. The POP pattern avoids global variables that store instances created from the same parameter. Implementation Here are implementation issues to consider when using the POP pattern: 1. Unique mapping of parameters. The POP pattern requires that there be a mean to isomorphically map the parameter space into the instance space and back again. 2. Ensure unique instances. The POP pattern makes unique instances from parameters, and it does so only once. 3. Cache instances for fast retrieval. The POP must be able to look up instances, given some set of parameters, and do so from some data structure. That is, there must be enough space to hold references to all the instances the program will need. Also, a mechanism is needed to look up and retrieve the instances quickly enough to satisfy the clients. Sample Code To be written....any volunteers? Thanks! - Doug >I don't think I get it > >On Mar 22, 2006, at 9:36 AM, David Garnier wrote: >>Using the singleton pattern in this case is >>just convenient for the programmer. Problems >>arises >>pretty quickly, especially if you attempt to unit-test your classes. > > >so you're saying that something isn't so good >because you can not test it in the convenient >way? >if that's true, I'm totally disagree >change your test, debug whatever, but if >software is efficient at runtime, works fine and >only problem is some unit test >(which is some kind of framework for testing) >then dump that unit test , dump that unit >framework and make something appropriate to the >software >you're testing > >so if Douglas want to use singletons, what's the problem? >and what do you mean by abusing of singleton usage? > >of course singleton doesn't prevent concurrent >access to the resource across the processes >unless >you're using some OS facility to prevent it, besides >singleton as it was introduced is relevant only >and only inside of the same process >otherwise it's not singleton it's something else >(let's say network singleton: so you have remote >invocation facility >and some factory method that return object created by that facility) > >I don't have any problem with using any kind of singletons. > Parametric Singleton idea (if I understand it >right) could be easily implemented in the >following way: >use a map >populate map with instances of some class and key is your parameter >(you can use lazy population too) > >if somebody ask the key check the value if it's null so resource is taken >if somebody returns the resource put it back to the map > >public synchronized static Object getSomeResource(Object parameter); >public synchronized static void returnResource(Object parameter); > >getSomeResource (inside of the same process) could return null in 2 cases >1. if somebody (from other thread for example) already took that resource >2. if OS API said that resource corresponded to >that parameter (serial port with parameter = 1 >(port #)) >is locked and unavailable; >I'm not sure that in case of serial ports we >even need those Parametric Singletons >(unless lock checking is a very expensive operation) >just ask the OS about availability of that >resource and if it's available give it away >and then OS will lock it and therefore in next >time somebody ask it just answer that resource >is locked >and return null > >for example system has 2 serial ports available >so I ask getResource("tty"); >or I ask getResource("Bluetooth-Modem"); > >and if OS is ok you can give tty or Bluetooth-Modem or both > >no need for any additional pattern I think > >back to the problem >mac os x doesn't recognize locking via files, so >it handles locking via some API >an instance of the singleton in each process >should recognize that resource is locked >(by using that API) that's all >we don't have to make things more complicate >then they are just because there is some nice >design pattern or nice unit test framework or whatever >keep things simple, make them work fast, don't introduce middle layers >unless you have really good reason to do so > >of course I could be entirely wrong, so sorry about that in advance > >thanks > > >Dmitry Markman > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx >Good day, > >I guess that only a selected few (hi Trent) will be able to answer? >this question, but the answer might be interesting for anyone trying? >to debug or understand the code. > >Apparently the MonitorThread is started and stopped in? >RXTXPort.addEventListener and RXTXPort.removeEventListener. This? >would indicate that (originally?) the MonitorThread is only required? >when there is an EventListener. However the MonitorThread is also? >started in the RXTXPort constructor, which could mean that RXTX won't? >work at all if it isn't there. > >It seems to me, that if anyone would add an event listener and later? >on remove it, he could potentially wreak the port. Because the second? >action would kill the MonitorThread. > > >For the moment I am only trying to understand the role of and idea? >behind the MonitorThread. But of course there is a deeper reason thor? >my question: > >If the MonitorThread needs to exist anyway, it could be the thread? >that cleans up the port (ie calls nativeClose) - this would eliminate? >(a further) problem I am seeing with some USB drivers on Mac OSX.? >(Close blocks (after releasing the tty, but still) in the USB driver? >if the device is "not responding"). > >Greetings, >Joachim > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Sat May 13 10:07:37 2006 From: joachim at buechse.de (Joachim Buechse) Date: Sat, 13 May 2006 18:07:37 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Douglas, Looking at the current code, leaves me with the feeling, that there is a lot to do. Defining an API that wraps javax.comm to provide what you describe is certainly possible, but I wonder how much benefit it will actually provide. Personally I think the API defined by javax.comm "request/lock" a port with: cp= new CommunicationPort(identifier) "release" a port with: cp.close(); works quite nice for 99% of the applications. In my experience, the most efficient and elegant implementation is to wrap a port/socket/.. into a business object which declares the remote operations that are possible. Ie "uploadFile", "waitForPrompt", "getSerialNumber", "sendContact", "executeCommand", etc Those methods are then either synchronized or guarded by a monitor. I do not see how your design pattern applied to the port resource would help implementing this. [details start, skip if you agree to the above] When I talked about "thread-safe" I didn't mean several independent "sessions" accessing the port concurrently. I think this is a very rare usage. I believe the most common use case for serial ports today is the control of an external device from a PC running a GUI based application. To implement a clean Swing/AWT-GUI one needs to pass any action that can block to a "worker" thread (else the GUI blocks, the application appears dead). While it is possible to use own prespawned thread that will accept Runnables which operate on the port, this is not very elegant. It is more common to spawn a new thread for every action triggered by the user. Additionally the ABORT of a running operation is often implemented via a port.close() delegated to a different thread. - During the lifetime of a port, it will usually be accessed from several different threads. Instance variables need to be set/read in synchronized regions to guarantee a correct operation based on the Java memory model. - Synchronizing the access is usually handled on the application level (synchronizing the reads/writes is usually useless from the applications view because it is not a transaction mechanism). [details end] I am very open to learn about other scenarios where your proposed design pattern applied to the port resource is beneficial to the application implementor. Best regards, Joachim On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > Dmitry suggests that we acquire an implementation of > a serial port reference, use it, then release it (i.e., check it > back in). > > Joachim says that making serial ports thread friendly might be a > good idea. > > This is a good idea. The design pattern that is close to this idea > is the "Object Pool Design Pattern". > # Object Pool From jredman at ergotech.com Sun May 14 14:28:24 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 14:28:24 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers Message-ID: <446792E8.4000506@ergotech.com> Does anyone know of any work to make RXTX work with Ethernet (telent) Terminal Servers? If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? We've used RXTX with upwards of 100 virtual COM ports on Windows and it works well. Linux is more problematic. It would be good to have an OS independent solution to accesses remote Ethernet serial ports. Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From legolas.w at gmail.com Sun May 14 14:26:34 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:56:34 +0430 Subject: [Rxtx] does any one have a working sample of RXTX and LPT port Message-ID: <4467927A.4000008@gmail.com> Hi Thank you for reading my post does any one has a working sample for RXTX and LPT port ? Thanks From legolas.w at gmail.com Sun May 14 14:27:29 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:57:29 +0430 Subject: [Rxtx] does RXTX support Trigerr on parallel port? Message-ID: <446792B1.4040905@gmail.com> Hi does RXTX support trigger on LPT port ? if so , how i can use it ? Thanks From tjarvi at qbang.org Sun May 14 17:40:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 17:40:59 -0600 (MDT) Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: <446792E8.4000506@ergotech.com> References: <446792E8.4000506@ergotech.com> Message-ID: On Sun, 14 May 2006, Jim Redman wrote: > Does anyone know of any work to make RXTX work with Ethernet (telent) > Terminal Servers? > > If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 > Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? > Hi Jim It appears the author of NVTCom has decided to release the library into the public domain. Integration with rxtx is possible but it would be best to contact the author and find out what his intent is. I would suggest contacting the author with a proposal of what you would like to do and take it from there. We could 'take' public domain software but its better to show respect to the authors and respect their wishes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:10:23 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:10:23 -0600 (MDT) Subject: [Rxtx] does any one have a working sample of RXTX and LPT port In-Reply-To: <4467927A.4000008@gmail.com> References: <4467927A.4000008@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > Thank you for reading my post > does any one has a working sample for RXTX and LPT port ? > Thanks Hi Legolas LPT port support in rxtx is spotty. That means some people have sent in patches for what they do and it works well for them. The original code was not very good. It may have been 3 hours work :/ To get started, Sun has some demo programs with their commapi. With rxtx 2.1 you can change their code from using javax.com to gnu.io and it -should- work. But if it does not you can post here and on bugzilla. There has been more interest lately off the list and maybe there will be enough community resources to get what you need going. If you do get a sample program together, we would gladly put it in the contrib directory so the next person can get things going faster. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:12:12 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:12:12 -0600 (MDT) Subject: [Rxtx] does RXTX support Trigerr on parallel port? In-Reply-To: <446792B1.4040905@gmail.com> References: <446792B1.4040905@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > does RXTX support trigger on LPT port ? > if so , how i can use it ? > Hi Legolas As mentioned in the previous post, rxtx parallel support is not very mature. But if you can point to something that describes the trigger feature, we can probably make sure its there and give a quick code example. -- Trent Jarvi tjarvi at qbang.org From jredman at ergotech.com Sun May 14 22:22:48 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 22:22:48 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: References: <446792E8.4000506@ergotech.com> Message-ID: <44680218.4080008@ergotech.com> Trent, Trent Jarvi wrote: > On Sun, 14 May 2006, Jim Redman wrote: > >> Does anyone know of any work to make RXTX work with Ethernet (telent) >> Terminal Servers? >> >> If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 >> Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? >> > > Hi Jim > > It appears the author of NVTCom has decided to release the library into > the public domain. Integration with rxtx is possible but it would be best > to contact the author and find out what his intent is. > > I would suggest contacting the author with a proposal of what you would > like to do and take it from there. We could 'take' public domain software > but its better to show respect to the authors and respect their wishes. > I sent Marco(?), the author of the library, a note before asking the list - I'll let you know the response. If anyone is already working on it, or has an interest and more time and energy than me, I'd hate to duplicate the efforts. If no one is, and no one objects, maybe I'll see what I can do. Jim > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From Christian.Klemke at t-online.de Mon May 15 02:23:06 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Mon, 15 May 2006 10:23:06 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu><004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: <008a01c677f8$cae18590$02fea8c0@NB600> Hi Trent, Hi Paul, I finally found some time to create a simple patch to enable the optional suppression of version output to the console. It is based on a new system property called "gnu.io.rxtx.NoVersionOutput" which can by set to "true" if necessary. I had some problems accessing CVS, therefore I downloaded the rxtx-2.1-7r2 source archive from ftp.qbang.org (which is linked on the rxtx.org download page) and worked with that release. Please find my proposed patch in the attachment ! Regards, Christian ----- Original Message ----- From: "Trent Jarvi" To: "RXTX Developers and Users" Cc: ""Paul Gettings"" Sent: Friday, May 05, 2006 2:09 PM Subject: Re: [Rxtx] RXTX causing stdout messages > On Fri, 5 May 2006, Christian Klemke wrote: > >> Hi Paul, >> >> I was wondering about the same question some days ago and took a look at >> the >> source files. Unfortunately, I found that you can only get rid of that >> messages by altering and recompiling the Java code. There is a final >> static >> boolean variable called "devel" in the file "RXTXCommDriver.java" which >> is >> set to "true". This constellation causes the output after the native >> libraries have been loaded. No mechanism exists to suppress them >> otherwise >> :-(. >> >> Trent, does that mean that 2.1.7 is still officially a "development" >> version >> ? When will this value be changed to "false" by default ? With 2.1.8 ? It >> would be nice to provide a means to suppress such messages besides that >> static flag (maybe by setting a property called >> "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The >> output can indeed by annoying, especially when used with console >> applications, where the message potentially appears "in the middle" of >> your >> own output. Another possibility would be not to use System.out directly, >> but >> instead some PrintStream field which is initially set to System.out but >> can >> programatically be changed. That would allow for any kind of redirection >> or >> suppression by implementing appropriate user-defined PrintStream >> subclasses >> and making RXTX use that stream. What do you think ? >> > > A patch for using properties would be accepted I'm sure. > > The reason the default is to display the message is not related to the > development state of rxtx anymore. The problem is that people first using > rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. > The message prevents a great deal of email thats easily explained by the > message. > > I question if we should support rxtx 2.0 at all anymore. > > If you post a patch in bugzilla, we'll put it into CVS this weekend. > we'll be going through and doing such things anyhow. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_version_output_patch.diff Type: application/octet-stream Size: 991 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060515/3173c2b6/rxtx_version_output_patch-0397.obj From lyon at docjava.com Mon May 15 06:06:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 May 2006 08:06:21 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Joachim makes several good points. Let me see if I can address some of them below: >Hello Douglas, > >Looking at the current code, leaves me with the feeling, that there? >is a lot to do. Yes! >Defining an API that wraps javax.comm to provide what? >you describe is certainly possible, but I wonder how much benefit it? >will actually provide. > >Personally I think the API defined by javax.comm > >"request/lock" a port with: > cp= new CommunicationPort(identifier) >"release" a port with: > cp.close(); > >works quite nice for 99% of the applications. I don't know what percentage of applications turn off locking, the way that I do in my version of the RXTX lib. I do know that this is not safe practice. I also know that it was motivated by the multi-platform nature of my code and that this was the only way I could make things work, at the time. Java does not appear to have a cross-platform standard for locking resources on various platforms. Each OS appears to have its own standard. The question of who breaks deadlocks and how this is done remains open, as this is not an easy question to resolve. Let me continue, below: > >In my experience, the most efficient and elegant implementation is to? >wrap a port/socket/.. into a business object which declares the? >remote operations that are possible. Ie "uploadFile",? >"waitForPrompt", "getSerialNumber", "sendContact", "executeCommand",? >etc Those methods are then either synchronized or guarded by a? >monitor. I do not see how your design pattern applied to the port? >resource would help implementing this. I have no problem with high-level wrappers that are application specific. That is a very good idea, but orthogonal with respect to the issue of deadlocks. More below: > >[details start, skip if you agree to the above] >When I talked about "thread-safe" I didn't mean several independent? >"sessions" accessing the port concurrently. I think this is a very? >rare usage. That is probably why turning locking off works so well! On the other hand, it is not safe and I shouldn't do it. >I believe the most common use case for serial ports today? >is the control of an external device from a PC running a GUI based? >application. To implement a clean Swing/AWT-GUI one needs to pass any? >action that can block to a "worker" thread (else the GUI blocks, the? >application appears dead). While it is possible to use own prespawned? >thread that will accept Runnables which operate on the port, this is? >not very elegant. It is more common to spawn a new thread for every? >action triggered by the user. Additionally the ABORT of a running? >operation is often implemented via a port.close() delegated to a? >different thread. Here lies the heart of serial port concern. An application opens a serial port and then dies. The application is restarted and finds the port locked. How do we clear the lock? Must the application's user reside in the UUCP group? Must installers of the serial port add users to the UUCP group? Should locking be handled at a high-level of abstraction in an operating system independent way? Should the implementation of the locking mechanism be translated into an API that is dependent on the OS convention? Suppose that we restrict the discussion to serial ports. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on inconsistent naming conventions. Hence my feeling that we need to mirror what is done in other API's; we need a locking toolkit that references peer methods, IMHO. >From the Java programming point of view, the locking API is portable across different platforms, but has, as its implementation, a native peer method that uses the conventions of the underlying OS. This enables portable resource locking (in theory!). Consider, for example: org.apache.commons.transaction.locking with: Interface LockManager at: http://jakarta.apache.org/commons/transaction/apidocs/org/apache/commons/transaction/locking/LockManager.html Or, more recently: java.util.concurrent.locks Interface Lock based on Doug Lea's code: http://kickjava.com/src/EDU/oswego/cs/dl/util/concurrent/ReadWriteLock.java.htm Should we incorporate a clean, portable design into serial port use, one that is consistent with current locking APIs? Basically, a comm port is a resource and resources are typically controlled by managers. Thus, I suggest that we make use of a CommPortManager to help control and centralize serial port usage. The question of how this is done remains open, IMHO, but using core API's like: java.util.concurrent.locks might not be amiss. High-level methods (getAllPorts, getAllSerialPorts, getAllParallelPorts, etc...) might be welcome additions. Basic questions like, "what if a port is in use?" remain open, hence my proposal for the new design pattern. Isn't it the CommPortManager's role to break the deadlock? Cheers! - Doug > >- During the lifetime of a port, it will usually be accessed from? >several different threads. Instance variables need to be set/read in? >synchronized regions to guarantee a correct operation based on the? >Java memory model. >- Synchronizing the access is usually handled on the application? >level (synchronizing the reads/writes is usually useless from the? >applications view because it is not a transaction mechanism). >[details end] > >I am very open to learn about other scenarios where your proposed? >design pattern applied to the port resource is beneficial to the? >application implementor. > >Best regards, >Joachim > >On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > >> Dmitry suggests that we acquire an implementation of >> a serial port reference, use it, then release it (i.e., check it? >> back in). >> > > Joachim says that making serial ports thread friendly might be a? >> good idea. >> >> This is a good idea. The design pattern that is close to this idea >> is the "Object Pool Design Pattern". >> # Object Pool > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Mon May 15 06:58:19 2006 From: joachim at buechse.de (Joachim Buechse) Date: Mon, 15 May 2006 14:58:19 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Doug, I agree fully, that locking of the system resource should be abstracted from the user (programmer). Currently this is already the case, but I agree it might be nice to extract the code into a separate class, which uses platform dependent providers to do its job. What I described in my email was not targeted at allocating the system resource, but at handling an already allocated system resource inside the framework. I agree that it may be possible to combine the two - however, I would suggest to do this in phase2. I can contribute a work over of RXTXPort.java which implements clean internal locking and proper close behavior (which I would call phase 1). I could do this this week. However I strongly believe that there is little sense in trying to do this as a series of patches. It will be closer to a rewrite than to a patch. I have already provided a number of suggested patches via Bugzilla, but this is quite inconvenient (for me). My working copy diverges more and more from the master and hence it gets more and more annoying to provide self contained patches. Best regards, Joachim From tjarvi at qbang.org Mon May 15 08:27:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 May 2006 08:27:51 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Mon, 15 May 2006, Joachim Buechse wrote: > Hello Doug, > > I agree fully, that locking of the system resource should be > abstracted from the user (programmer). Currently this is already the > case, but I agree it might be nice to extract the code into a > separate class, which uses platform dependent providers to do its job. > > What I described in my email was not targeted at allocating the > system resource, but at handling an already allocated system resource > inside the framework. I agree that it may be possible to combine the > two - however, I would suggest to do this in phase2. > > I can contribute a work over of RXTXPort.java which implements clean > internal locking and proper close behavior (which I would call phase > 1). I could do this this week. > > However I strongly believe that there is little sense in trying to do > this as a series of patches. It will be closer to a rewrite than to a > patch. I have already provided a number of suggested patches via > Bugzilla, but this is quite inconvenient (for me). My working copy > diverges more and more from the master and hence it gets more and > more annoying to provide self contained patches. > For methodical testing purposes (which does go on) the incremental patches are better. I'm lagging behind in bugzilla but thats soon to change (this week). It has just been rather chaotic up until now. I moved, purchased a house, and jumped into the fire of a feature freeze timeframe at a new job. btw, we see the Solaris close issues on 2.8 also. 9 and 10 are fine. I'll work towards making those test results public and allow others to run new rxtx code through them. We had the OK at one point but setting up the environment is involved. It isn't just a collection of java classes. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Tue May 16 02:01:47 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:01:47 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] Message-ID: <446986EB.209@willicon.de> Hi, any ideas for my problem? Hans -------- Original-Nachricht -------- Betreff: [Rxtx] Problem under Mac OSX 10.3.9 Datum: Mon, 08 May 2006 18:47:20 +0200 Von: WILLICon Antwort an: RXTX Developers and Users An: RXTX Developers and Users Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/b0741c2b/attachment-0397.html From joachim at buechse.de Tue May 16 02:15:08 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 10:15:08 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: Hello Hans, I am using RXTX on OS X for my own project. I do not see the problem you describe. I had some troubles installing it because the current version uses lock files which is non-standard on OS X. I have created a patched version which I currently use. This version does not need to modify user groups and hence does not need an installer. I just pop it in the application directory. If you send me a link where I can download your OSX installer, I will have a quick look. Regards, Joachim On 16.05.2006, at 10:01, WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we > have some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + > spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + > spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always > the value "false". > I can only get the status, while I open the port and catch the > exception. > > Any ideas? > > Hans > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail at willicon.de Tue May 16 02:26:53 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:26:53 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: References: <446986EB.209@willicon.de> Message-ID: <44698CCD.7050709@willicon.de> Joachim, tanks for the answer. I'll send You a mail. Hans Joachim Buechse schrieb: > Hello Hans, > > I am using RXTX on OS X for my own project. I do not see the problem > you describe. > > I had some troubles installing it because the current version uses > lock files which is non-standard on OS X. I have created a patched > version which I currently use. This version does not need to modify > user groups and hence does not need an installer. I just pop it in > the application directory. If you send me a link where I can download > your OSX installer, I will have a quick look. > > Regards, > Joachim > > On 16.05.2006, at 10:01, WILLICon wrote: > > >> Hi, >> >> any ideas for my problem? >> >> Hans >> >> -------- Original-Nachricht -------- >> Betreff: [Rxtx] Problem under Mac OSX 10.3.9 >> Datum: Mon, 08 May 2006 18:47:20 +0200 >> Von: WILLICon >> Antwort an: RXTX Developers and Users >> An: RXTX Developers and Users >> >> >> Hi, >> >> I use for RXTX for communicate with CyclingComputers. >> >> It works good under Win32, Sloaris and Linux but with Mac OSX we >> have some problems. >> >> My users install the Mac OSX serial lib from the actual binary. >> >> After starting the program, they get this error message: >> >> java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while >> loading gnu.io.RXTXCommDriver >> >> Remember, this error comes only under Mac OSX. >> >> That is the code for the error: >> >> Enumeration portList = CommPortIdentifier.getPortIdentifiers(); >> spInUse = getBundleStr("serialPortInUse"); >> spFree = getBundleStr("serialPortFree"); >> while (portList.hasMoreElements()) { >> CommPortIdentifier portId = (CommPortIdentifier) >> portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (osName != null && osName.startsWith("mac")) { >> if (!portId.getName().startsWith("dev/cu.")) { >> continue; >> } >> } >> if (portId.isCurrentlyOwned()) { >> serialPortNames.add(portId.getName() + " - " + >> spInUse); >> } >> else { >> serialPortNames.add(portId.getName() + " - " + >> spFree); >> } >> } >> } >> if (serialPortNames.size() == 0) { >> serialPortNames.add(getBundleStr("serialPortNotFound")); >> } >> >> BTW: The methode isCurrentlyOwned() is not working. I get always >> the value "false". >> I can only get the status, while I open the port and catch the >> exception. >> >> Any ideas? >> >> Hans >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/948333be/attachment-0397.html From jredman at ergotech.com Tue May 16 07:35:52 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 16 May 2006 07:35:52 -0600 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: <4469D538.6070408@ergotech.com> Hans, I have no direct insight, but would note that what you have is a "NoClassDefFoundError" not a "ClassNotFoundException". So the class javax/comm/CommDriver is found, but one of its dependencies is missing. NoClassDefFoundError are a bigger problem to resolve because you get no indication of the real problem. Jim WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we have > some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > * spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always the > value "false". > I can only get the status, while I open the port and catch the exception. > > Any ideas? > > Hans > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.de Tue May 16 08:01:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 16:01:21 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 In-Reply-To: <4469AFC3.6000002@willicon.de> References: <44698EBC.8000008@willicon.de> <8C5680C4-E2BA-42FF-B221-36E1124FA6A4@buechse.de> <4469AFC3.6000002@willicon.de> Message-ID: <9825A602-D6ED-4C28-BF33-9A7C984FACD5@buechse.de> Hallo Hans, you include RXTX 2.17 in your "bikeXexperience.jar" (2.17 uses Interfaces from gnu.io.* not javax.comm.*). Now inspect your error log closely: The class gnu.io.RXTXCommDriver tries to load javax.comm.CommDriver: this is only the case for RXTX 2.07. I assume, that the user has installed Version 2.07 into one of the java.ext.dirs . The VM always tries to load classes from the "system" path first. The current Mac installer distributed with RXTX in fact installs RXTXcomm.jar and librxtxSerial.jnilib into /Library/Java/Extensions. (I wrote some time ago that I consider this as a bad idea because of potential version conflicts-> thanks for delivering the example). For 2.07 it does so without installing the javax.comm classes it seems. I would recommend that you instruct your users to install version 2.17 only. Until RXTX is changed to use TIOCEXCL instead of lock files, you can hardly avoid the installer, as the user needs to be added to a special group and a lockfile directory needs be created. More precisely you are waiting for: http://bugzilla.qbang.org/show_bug.cgi?id=50 [RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL)] Regards, Joachim -------------- next part -------------- A non-text attachment was scrubbed... Name: log.tiff Type: image/tiff Size: 38394 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/e3e52128/log-0397.tiff -------------- next part -------------- > > Ich verwende RXTX 2.17. Das orginal RXTXcomm.jar ist in > CyclingDataManager.jar enthalten. > From tjarvi at qbang.org Wed May 17 23:18:15 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 May 2006 23:18:15 -0600 (MDT) Subject: [Rxtx] update Message-ID: So we have several patches and these have stacked up. I'd like to thank everyone for being patient. Tests for the most intrusive patches look good so far. I still have to get some bits together on my end but it looks like we can catch everything up in CVS this week. I'll try to post a normal list of what went in by whom with links Saturday. But I'm not seeing anything that raises flags yet. I also think I'll be able to submit a patch for nonstandard baud rates. I have to confirm w32 but I think its going to be a one line fix. I don't know if its bugzilla or people tinkering with patch files before submitting but patches are not applying cleanly. So the patches have to be done by hand. This may make things difficult for people hoping to add other patches on top. I'm trying to make that go well but ... -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Thu May 18 02:23:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 May 2006 10:23:47 +0200 Subject: [Rxtx] update In-Reply-To: References: Message-ID: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Hello Trent, in fact I tinkered with the patches (never used this mechanism before, usually I "communicate" via cvs) ... so sorry for any trouble you had applying them. Basicly I edited the patches to make them self contained. Having the tests run with different speeds on different platforms, may well be an effect of caching. I have seen quite interesting propagation delays for the closing flag on my PowerPC system, which makes me doubt, that the propagation of output_buffer_empty_flag works as it should. Maybe the communication mechanism between the two threads should be replaced by something like pthread_cond_*. Could you describe which problems you see on Solaris/SPARC? I'd be interested to see if they exist on OS X (PowerPC) as well... As you seem to work on the stuff at the moment I would like to suggest the following additions (it looks more than it is, I posted some context to make clear where to apply the change). See the comments in braces for what was changed Greetings, Joachim (1) The end of the drain loop could be: --- report("drain_loop: received EINTR in tcdrain\n"); --- (added "in tcdrain" to make debug output clearer) (2) The start of the drain loop should be: --- for(i=0;;i++) { report_verbose("drain_loop: looping\n"); #if defined(__sun__) /* FIXME: No time to test on all OS's for production */ if( eis->eventloop_interrupted ) { goto end; } if (usleep(5000)) { report("drain_loop: received EINTR"); } #else if (usleep(1000000)) { report("drain_loop: received EINTR"); } #endif /* __sun__ */ --- (added a check for "eis->eventloop_interrupted" before the sleep) (3) The end of interrupt_event_loop could (and maybe should) be: --- #if !defined(TIOCSERGETLSR) && !defined(WIN32) /* make sure that the drainloop unblocks from tcdrain */ pthread_kill(index->drain_tid, SIGABRT); /* TODO use wait/join/SIGCHLD/?? instead of sleep? */ usleep(50 * 1000); /* Under normal conditions, SIGABRT will unblock tcdrain. However a non-responding USB device combined with an unclean driver may still block. This is very ugly because it may block the call to close indefinetly. */ if (index->closing != 1) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); index->closing = 1; } #endif report("interruptEventLoop: interrupted\n"); --- (added some comments and pthread_cancel for resisting drain thread) On 18.05.2006, at 07:18, Trent Jarvi wrote: > > So we have several patches and these have stacked up. I'd like to > thank > everyone for being patient. > > Tests for the most intrusive patches look good so far. I still > have to > get some bits together on my end but it looks like we can catch > everything > up in CVS this week. > > I'll try to post a normal list of what went in by whom with links > Saturday. But I'm not seeing anything that raises flags yet. I also > think I'll be able to submit a patch for nonstandard baud rates. > I have > to confirm w32 but I think its going to be a one line fix. > > I don't know if its bugzilla or people tinkering with patch files > before > submitting but patches are not applying cleanly. So the patches > have to > be done by hand. This may make things difficult for people hoping > to add > other patches on top. I'm trying to make that go well but ... > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu May 18 22:28:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 18 May 2006 22:28:00 -0600 (MDT) Subject: [Rxtx] update In-Reply-To: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> References: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Message-ID: On Thu, 18 May 2006, Joachim Buechse wrote: > Hello Trent, > > in fact I tinkered with the patches (never used this mechanism > before, usually I "communicate" via cvs) ... so sorry for any trouble > you had applying them. Basicly I edited the patches to make them self > contained. I think we are close to moving towards that. > > Having the tests run with different speeds on different platforms, > may well be an effect of caching. I have seen quite interesting > propagation delays for the closing flag on my PowerPC system, which > makes me doubt, that the propagation of output_buffer_empty_flag > works as it should. Maybe the communication mechanism between the two > threads should be replaced by something like pthread_cond_*. Could > you describe which problems you see on Solaris/SPARC? I'd be > interested to see if they exist on OS X (PowerPC) as well... This is interesting. I have seen problems with output buffer empty in applications that require it. I'm trying to get a bug list and or test results open for everyone to see but that may take time. But missed output buffer events ... yep. With Sparc, we have seen a few things. One was a kernel race condition that went away when we reimaged and updated 2.8. RXTX was hanging on close, top showed no cpu use but there was 2 second delays just typing on console. The other is our tests now take ~4 times longer on Solaris. Someone is looking at timing just open, close, read, write, ... to see if they can find where the slowdown is. This happened after solaris 2.8. I'll try to share more when/if there is something interesting. This may well not be solvable in userland. > > As you seem to work on the stuff at the moment I would like to > suggest the following additions (it looks more than it is, I posted > some context to make clear where to apply the change). See the > comments in braces for what was changed I'll take a look. This could all come together Saturday but I also have an event to attend that day. I may not wrap this up until Sunday. -- Trent Jarvi tjarvi at qbang.org From andrewlord at internode.on.net Sun May 21 20:10:02 2006 From: andrewlord at internode.on.net (Andrew Lord) Date: Mon, 22 May 2006 11:40:02 +0930 Subject: [Rxtx] Kernel include files do not match kernel Message-ID: <200605221140.03271.andrewlord@internode.on.net> Hi, I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel 2.6.12-18 with the command: ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include However I get the message: ## checking java.version 1.5.0_06 ## checking os.version 2.6.12-18mdk ## ## WARNING: Kernel include files do not match the current kernel ## ## configure: creating ./config.status etc. Is there a problem with the way I'm specifying the 'include' directory ? If not, how else can I specify the correct directory for the include files please ? Cheers, Andrew From tjarvi at qbang.org Sun May 21 20:31:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 May 2006 20:31:31 -0600 (MDT) Subject: [Rxtx] Kernel include files do not match kernel In-Reply-To: <200605221140.03271.andrewlord@internode.on.net> References: <200605221140.03271.andrewlord@internode.on.net> Message-ID: On Mon, 22 May 2006, Andrew Lord wrote: > Hi, > > I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel > 2.6.12-18 with the command: > > ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk > CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include > > However I get the message: > > ## checking java.version 1.5.0_06 > ## checking os.version 2.6.12-18mdk > ## > ## WARNING: Kernel include files do not match the current kernel > ## > ## configure: creating ./config.status > etc. > > Is there a problem with the way I'm specifying the 'include' directory ? If > not, how else can I specify the correct directory for the include files > please ? > Hi Andrew I'm fairly sure your --with-kernel option does nothing. The CPPFLAGS should do what you want. Maybe put an #error message in /usr/src/linux.../incude/linux/version.h But I don't recall a recent problem with version missmatches. It should work. Distros will even ship include files that don't match versions exactly. In theory it should never matter for users. I used to compile new kernels by hand and really didnt have a distro. I didnt have a seperate package of kernel headers for users (myself). When changing a gateway from linux 1.2.12 to 2.1.77, I would worry about such messages. So if you are doing something that weird, the message may be of use to you. If you just see the message on a distro you installed, it is more than likely harmless. -- Trent Jarvi tjarvi at qbang.org From mrogers at spro.net Mon May 22 14:45:39 2006 From: mrogers at spro.net (Mike Rogers) Date: Mon, 22 May 2006 14:45:39 -0600 Subject: [Rxtx] Sun's CommAPI -- think May? Message-ID: <447222F3.9040302@spro.net> Hi, Any word from Sun about progress towards fixing the Java CommAPI v3 "incompatibilities" so RXTX 2.0 can operate within the framework's namespace (javax.comm)? I recall mention of a May time frame. Thanks, Mike From paul.klissner at sun.com Mon May 22 15:09:27 2006 From: paul.klissner at sun.com (Paul Klissner) Date: Mon, 22 May 2006 14:09:27 -0700 Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <447222F3.9040302@spro.net> References: <447222F3.9040302@spro.net> Message-ID: <44722887.8080308@sun.com> Mike Rogers wrote: > Hi, > > Any word from Sun about progress towards fixing the Java CommAPI v3 > "incompatibilities" so RXTX 2.0 can operate within the framework's > namespace (javax.comm)? I recall mention of a May time frame. > > Thanks, > > Mike > We've had a lot of work come in. This hasn't been the only priority. I'm running behind the plan in addressing this, but will be looking at it again soon. Rather than state a new, I'll just say it is in progress, and not off the table. I'll get this fixed as soon as I can. Good timing for asking as we just started discussing javax.comm plans today, and I'll have some cycles to work on it soon. Paul From yhua537 at cse.unsw.edu.au Mon May 22 16:03:05 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Tue, 23 May 2006 08:03:05 +1000 (EST) Subject: [Rxtx] install rxtx in XP Message-ID: Hi Guys, I am new to serial port programming, and have no experience on programming java in xp, but my project require me to builld a communication link between xp and a UART device. Most of the information in the web site seems for linux only. including the commands such as export and chmod. How do I install rxtx in xp? cheers YiQi Huang From mark at mdsh.com Tue May 23 01:24:20 2006 From: mark at mdsh.com (Mark Himsley) Date: Tue, 23 May 2006 08:24:20 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off , it includes DLLs for Windows and the JAR for Java. Follow the Windows instructions in the INSTALL. ie RXTXcomm.jar goes in \jre\lib\ext (under java) rxtxSerial.dll goes in \jre\bin So, assuming a fairly standard Java install, copy RXTXcomm.jar into C:\Program Files\Java\jre1.5.0_06\lib\ext and copy rxtxSerial.dll into C:\Program Files\Java\jre1.5.0_06\bin Yes, it really is that simple. On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > I am new to serial port programming, and have no experience on > programming java in xp, but my project require me to builld a > communication link between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang -- Mark Himsley From joachim at buechse.de Tue May 23 02:51:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 23 May 2006 10:51:47 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) Unless it is absolutely required you should NOT install RXTX in your global Java Runtime Environment. This will for sure create versioning conflicts - if not now, than in the future, if not on your system than at your clients. Instead put the dll in your application directory and include the RXTXcomm.jar in your classpath. This is much safer and not a bit more complicated. Regards, Joachim On 23.05.2006, at 09:24, Mark Himsley wrote: > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR > for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > >> I am new to serial port programming, and have no experience on >> programming java in xp, but my project require me to builld a >> communication link between xp and a UART device. >> >> Most of the information in the web site seems for linux only. >> including >> the commands such as export and chmod. How do I install rxtx in xp? >> >> cheers >> YiQi Huang > > > > -- > Mark Himsley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tod at todbot.com Tue May 23 03:12:22 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 02:12:22 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I totally agree: do not contaminate the Java installation. I put all the RXTX files in a directory and then change my java invocation to be: % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* Alternatively, use Launch4J to create a double-clickable application and keep the RXTX libraries in the directory of the application. -=tod On May 23, 2006, at 1:51 AM, Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > >> Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off >> , it includes DLLs for Windows and the JAR >> for Java. >> >> Follow the Windows instructions in the INSTALL. >> >> ie >> >> RXTXcomm.jar goes in \jre\lib\ext (under java) >> rxtxSerial.dll goes in \jre\bin >> >> So, assuming a fairly standard Java install, copy RXTXcomm.jar into >> C:\Program Files\Java\jre1.5.0_06\lib\ext >> and copy rxtxSerial.dll into >> C:\Program Files\Java\jre1.5.0_06\bin >> >> Yes, it really is that simple. >> >> >> >> On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: >> >>> I am new to serial port programming, and have no experience on >>> programming java in xp, but my project require me to builld a >>> communication link between xp and a UART device. >>> >>> Most of the information in the web site seems for linux only. >>> including >>> the commands such as export and chmod. How do I install rxtx in xp? >>> >>> cheers >>> YiQi Huang >> >> >> >> -- >> Mark Himsley >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From smontgomery at mediaspansoftware.com Tue May 23 08:46:53 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Tue, 23 May 2006 10:46:53 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: Message-ID: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Joachim and Tod mentioned how to keep the files RXTX requires on Windows XP out of the Java installations - thanks gentlemen! Are there similar suggestions for an RXTX install on OS X? The current "canonical" OS X installation instructions "contaminate the Java installation", to use Tod's words. Our app will run fine under 1.4.2 and 5.0 on OS X, and a lot of users will have both. We've already been burned by the recent switch from 1.4.2 to 5.0 as the platform default. Any suggestions welcomed. From tod at todbot.com Tue May 23 13:27:55 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 12:27:55 -0700 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <9BA0F670-A862-42E7-BB2C-130D775ABDF9@todbot.com> Hi Sean, It depends on how you build and deploy your code. If you're using shell scripts, you can do something like this: #!/bin/sh # pick one JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/ Commands/java #JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/ Commands/java $JAVA -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* That both picks which VM to use and uses the RXTX in the directory called 'rxtxlib'. If you want your shell script to be clever, you could test for the existence of the different 'java' executables and go from there (maybe even use different jar files). I am almost positive all OS X systems with Java 1.5 are guaranteed to also have Java 1.4.2. If you're using Jar Builder or XCode, you can specify which JVM to use and add the extra args in the Info.plist file. The paths specified in the 'java' invocation then are based off of the $JAVAROOT variable that the JavaApplicationStub sets for you. For my app, I've have been compiling two sets of jars, one compiled with 1.4.2 and one with 1.5, but they both run under 1.5. So I have a similar shell script that chooses a different 'javac' depending on the need. -=tod On May 23, 2006, at 7:46 AM, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From yhua537 at cse.unsw.edu.au Tue May 23 11:09:37 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 03:09:37 +1000 (EST) Subject: [Rxtx] install rxtx in XP (Mark Himsley, Joachim Buechse, Tod E. Kurt> In-Reply-To: References: Message-ID: > Message: 8 > Date: Tue, 23 May 2006 08:03:05 +1000 (EST) > From: YiQi Huang > Subject: [Rxtx] install rxtx in XP > To: rxtx at qbang.org > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > Hi Guys, > > I am new to serial port programming, and have no experience on programming > java in xp, but my project require me to builld a communication link > between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang > > > ------------------------------ > > Message: 9 > Date: Tue, 23 May 2006 08:24:20 +0100 > From: Mark Himsley > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=us-ascii; format=flowed > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > ------------------------------ > > Message: 10 > Date: Tue, 23 May 2006 10:51:47 +0200 > From: Joachim Buechse > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > > ------------------------------ > > Message: 11 > Date: Tue, 23 May 2006 02:12:22 -0700 > From: "Tod E. Kurt" > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I totally agree: do not contaminate the Java installation. > > I put all the RXTX files in a directory and then change my java > invocation to be: > > % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* > > Alternatively, use Launch4J to create a double-clickable application > and keep the RXTX libraries in the directory of the application. > > -=tod > > Hi, Thanks guys, I don't know if this is the correct way to reply your mecessage, if wrong, please point out. Thank you for Mark to give the detail instructions and Joachim to point out the cons ot installing in the java directory, and specially thanks for Tod to give the instrection in detail. Sorry to ask another stupid question: I have followed Tod's instruction. Now I think i am ready to start hacking. But where is the RXTX API documentation? Is it the same as using normal java comm API? btw, where could i find some examples to start with? Thanks very much cheers YiQi Huang From tjarvi at qbang.org Tue May 23 16:09:32 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 May 2006 16:09:32 -0600 (MDT) Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <44722887.8080308@sun.com> References: <447222F3.9040302@spro.net> <44722887.8080308@sun.com> Message-ID: > Good timing for asking as we just started discussing javax.comm plans > today, and I'll have some cycles to work on it soon. Hi Paul I assume you mean Sun is discussing plans concerning its own internal actions and there is no community involvment at this point. -- Trent Jarvi tjarvi at qbang.org From yhua537 at cse.unsw.edu.au Tue May 23 22:50:01 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 14:50:01 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } From mmester at sps.edu Tue May 23 22:58:21 2006 From: mmester at sps.edu (Michael Mester) Date: Wed, 24 May 2006 00:58:21 -0400 Subject: [Rxtx] install rxtx in XP References: Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below -----Original Message----- From: rxtx-bounces at qbang.org on behalf of YiQi Huang Sent: Wed 5/24/2006 12:50 AM To: RXTX Developers and Users Subject: Re: [Rxtx] install rxtx in XP Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3950 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060523/b36d0c63/attachment-0397.bin From yhua537 at cse.unsw.edu.au Tue May 23 23:05:50 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 15:05:50 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: Yes, Michael you are right, it should be semicolons, But it still can't find the correct library. On Wed, 24 May 2006, Michael Mester wrote: > I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below > > > -----Original Message----- > From: rxtx-bounces at qbang.org on behalf of YiQi Huang > Sent: Wed 5/24/2006 12:50 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] install rxtx in XP > > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > cheers YiQi Huang From tod at todbot.com Wed May 24 00:01:57 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 23:01:57 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Yes, sorry, classpath entries are semicolon-separated on Windows and colon-separated on everything else. Your example code below is importing the wrong set of classes. It should not "import javax.comm.*", instead it should "import gnu.io.*". When I make that change, your example program compiles. The "javax.comm" package is the one released by Sun, the "gnu.io" package is the RXTX one. You might've seen some discussion that the two will be merged or become compatible, but that hasn't happened yet. -=tod On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > > Yes, Michael you are right, it should be semicolons, But it still > can't > find the correct library. > > On Wed, 24 May 2006, Michael Mester wrote: > >> I believe the entries in the classpath need to be seperated with >> semicolons, not a colon as you have in your command below >> >> >> -----Original Message----- >> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >> Sent: Wed 5/24/2006 12:50 AM >> To: RXTX Developers and Users >> Subject: Re: [Rxtx] install rxtx in XP >> >> Hi, >> >> Sorry guys.I follow Tod's instruction, and here is what i did: >> >> put >> RXTXcomm.jar, >> rxtxParallel.dll, >> rxtxSerial.dll >> in >> C:\RXTX_files >> >> and I got a SimpleRead class attached below, compile it with : >> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >> it still saying "cannot find symbol". >> >> Is there anything I did wrong? Do I need the comm.jar from Sun? >> >> Thanks & regards >> YiQi Huang >> >> >> //////////////////////////////////////////////////////// >> // SimpleRead.java >> //////////////////////////////////////////////////////// >> >> import java.io.*; >> import java.util.*; >> import javax.comm.*; >> >> public class SimpleRead >> implements Runnable, SerialPortEventListener { >> static CommPortIdentifier portId; >> static Enumeration portList; >> InputStream inputStream; >> SerialPort serialPort; >> Thread readThread; >> public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == >> CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals("COM1")) { >> //if (portId.getName().equals("/dev/term/a")) { >> SimpleRead reader = new SimpleRead(); >> } >> } >> } >> } >> public SimpleRead() { >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", >> 2000); >> } catch (PortInUseException e) {} >> try { >> inputStream = serialPort.getInputStream(); >> } catch (IOException e) {} >> try { >> serialPort.addEventListener(this); >> } catch (TooManyListenersException e) {} >> serialPort.notifyOnDataAvailable(true); >> try { >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } catch (UnsupportedCommOperationException e) {} >> readThread = new Thread(this); >> readThread.start(); >> } >> public void run() { >> try { >> Thread.sleep(20000); >> } catch (InterruptedException e) {} >> } >> public void serialEvent(SerialPortEvent event) { >> switch(event.getEventType()) { >> case SerialPortEvent.BI: >> case SerialPortEvent.OE: >> case SerialPortEvent.FE: >> case SerialPortEvent.PE: >> case SerialPortEvent.CD: >> case SerialPortEvent.CTS: >> case SerialPortEvent.DSR: >> case SerialPortEvent.RI: >> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >> break; >> case SerialPortEvent.DATA_AVAILABLE: >> byte[] readBuffer = new byte[20]; >> try { >> while (inputStream.available() > 0) { >> int numBytes = inputStream.read(readBuffer); >> } >> System.out.print(new String(readBuffer)); >> } catch (IOException e) {} >> break; >> } >> } >> } >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > cheers > YiQi Huang > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From joachim at buechse.de Wed May 24 00:10:06 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:10:06 +0200 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Hi Sean, my preferred way of dealing with RXTX on OS X is to include the RXTX classes into my application jar and to put the RXTX lib in the same directory as this jar. To make it even more comfortable, you can include the lib in the jar and have some startup code extract it and write it to a temporary file from which you load it with System.load(). Unfortunately the current version of RXTX for OS X requires tinkering with user groups as it is based on lockfiles - and hence it needs the RXTX OS X installer or you need to duplicated this functionality in your own installer. I have created my own native version which is not based on lockfiles but tty locking (the standard way to do it on OSX). I hope that these patches will be integrated soon into the distribution. Regards, Joachim On 23.05.2006, at 16:46, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Wed May 24 00:16:12 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:16:12 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <7017ECFC-B13E-4806-B321-9FFCAC5830F0@buechse.de> I assume you downloaded rxtx-217 (not 207). Instead of importing javax.comm.* you must import gnu.io.* The classes have the same name, but they are not in the same package. On 24.05.2006, at 06:50, YiQi Huang wrote: > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From yhua537 at cse.unsw.edu.au Wed May 24 00:17:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 16:17:45 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Message-ID: Thanks Tod again, i kept reading "gnu.io.*" as "gun.io.*" last few hours after i read some commons from web. Thanks very much Tod. thanks YiQi Huang On Tue, 23 May 2006, Tod E. Kurt wrote: > Yes, sorry, classpath entries are semicolon-separated on Windows and > colon-separated on everything else. > > Your example code below is importing the wrong set of classes. It > should not "import javax.comm.*", instead it should "import > gnu.io.*". When I make that change, your example program compiles. > The "javax.comm" package is the one released by Sun, the "gnu.io" > package is the RXTX one. You might've seen some discussion that the > two will be merged or become compatible, but that hasn't happened yet. > > -=tod > > > On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > >> >> Yes, Michael you are right, it should be semicolons, But it still >> can't >> find the correct library. >> >> On Wed, 24 May 2006, Michael Mester wrote: >> >>> I believe the entries in the classpath need to be seperated with >>> semicolons, not a colon as you have in your command below >>> >>> >>> -----Original Message----- >>> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >>> Sent: Wed 5/24/2006 12:50 AM >>> To: RXTX Developers and Users >>> Subject: Re: [Rxtx] install rxtx in XP >>> >>> Hi, >>> >>> Sorry guys.I follow Tod's instruction, and here is what i did: >>> >>> put >>> RXTXcomm.jar, >>> rxtxParallel.dll, >>> rxtxSerial.dll >>> in >>> C:\RXTX_files >>> >>> and I got a SimpleRead class attached below, compile it with : >>> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >>> it still saying "cannot find symbol". >>> >>> Is there anything I did wrong? Do I need the comm.jar from Sun? >>> >>> Thanks & regards >>> YiQi Huang >>> >>> >>> //////////////////////////////////////////////////////// >>> // SimpleRead.java >>> //////////////////////////////////////////////////////// >>> >>> import java.io.*; >>> import java.util.*; >>> import javax.comm.*; >>> >>> public class SimpleRead >>> implements Runnable, SerialPortEventListener { >>> static CommPortIdentifier portId; >>> static Enumeration portList; >>> InputStream inputStream; >>> SerialPort serialPort; >>> Thread readThread; >>> public static void main(String[] args) { >>> portList = CommPortIdentifier.getPortIdentifiers(); >>> while (portList.hasMoreElements()) { >>> portId = (CommPortIdentifier) portList.nextElement(); >>> if (portId.getPortType() == >>> CommPortIdentifier.PORT_SERIAL) { >>> if (portId.getName().equals("COM1")) { >>> //if (portId.getName().equals("/dev/term/a")) { >>> SimpleRead reader = new SimpleRead(); >>> } >>> } >>> } >>> } >>> public SimpleRead() { >>> try { >>> serialPort = (SerialPort) portId.open("SimpleReadApp", >>> 2000); >>> } catch (PortInUseException e) {} >>> try { >>> inputStream = serialPort.getInputStream(); >>> } catch (IOException e) {} >>> try { >>> serialPort.addEventListener(this); >>> } catch (TooManyListenersException e) {} >>> serialPort.notifyOnDataAvailable(true); >>> try { >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, >>> SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> } catch (UnsupportedCommOperationException e) {} >>> readThread = new Thread(this); >>> readThread.start(); >>> } >>> public void run() { >>> try { >>> Thread.sleep(20000); >>> } catch (InterruptedException e) {} >>> } >>> public void serialEvent(SerialPortEvent event) { >>> switch(event.getEventType()) { >>> case SerialPortEvent.BI: >>> case SerialPortEvent.OE: >>> case SerialPortEvent.FE: >>> case SerialPortEvent.PE: >>> case SerialPortEvent.CD: >>> case SerialPortEvent.CTS: >>> case SerialPortEvent.DSR: >>> case SerialPortEvent.RI: >>> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >>> break; >>> case SerialPortEvent.DATA_AVAILABLE: >>> byte[] readBuffer = new byte[20]; >>> try { >>> while (inputStream.available() > 0) { >>> int numBytes = inputStream.read(readBuffer); >>> } >>> System.out.print(new String(readBuffer)); >>> } catch (IOException e) {} >>> break; >>> } >>> } >>> } >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> >> cheers >> YiQi Huang >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From smontgomery at mediaspansoftware.com Wed May 24 10:24:13 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 12:24:13 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: Tod & Joachim, Thanks for the info, that's very helpful. I'll give that a whirl when I move to rxtx 2.1. I'm still using the older 2.0.7 version for now (don't ask), which probably requires the Sun comm.jar, javax.comm.properties and librxtxSerial.jnilib to be in very specific places in each jvm's file hierarchy. From tjarvi at qbang.org Wed May 24 11:59:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 11:59:16 -0600 (MDT) Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: On Wed, 24 May 2006, Sean Montgomery wrote: > Tod & Joachim, > > Thanks for the info, that's very helpful. I'll give that a whirl > when I move to rxtx 2.1. I'm still using the older 2.0.7 version for > now (don't ask), which probably requires the Sun comm.jar, > javax.comm.properties and librxtxSerial.jnilib to be in very specific > places in each jvm's file hierarchy. > You will need comm.jar from Sun then. It must be Sun's version 2.* or older for Linux or Solaris. I assume they have this in download archives. The default offering from Sun is version 3.0. This version currently does not support rxtx. The older version will probably be fine for your needs. -- Trent Jarvi tjarvi at qbang.org From smontgomery at mediaspansoftware.com Wed May 24 12:19:06 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 14:19:06 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: <3939EFB8-11E1-4E3E-A684-5B3C525577CD@mediaspansoftware.com> Yup, that's right, thanks Trent. I've been using these files for quite a while now. Thanks for bringing it up. I almost didn't mention using 2.0.7 because I didn't want to give any new members of the list the wrong idea! :-) On May 24, 2006, at 1:59 PM, Trent Jarvi wrote: > On Wed, 24 May 2006, Sean Montgomery wrote: > >> Tod & Joachim, >> >> Thanks for the info, that's very helpful. I'll give that a whirl >> when I move to rxtx 2.1. I'm still using the older 2.0.7 version for >> now (don't ask), which probably requires the Sun comm.jar, >> javax.comm.properties and librxtxSerial.jnilib to be in very specific >> places in each jvm's file hierarchy. >> > > You will need comm.jar from Sun then. It must be Sun's version 2.* or > older for Linux or Solaris. I assume they have this in download > archives. > > The default offering from Sun is version 3.0. This version > currently does > not support rxtx. > > The older version will probably be fine for your needs. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mark at mdsh.com Wed May 24 15:55:46 2006 From: mark at mdsh.com (Mark Himsley) Date: Wed, 24 May 2006 22:55:46 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <37B0FC4B1F3237321F093ABE@MacMini.local> On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) That's no problem. BUT, do note that the instructions I elaborated on are in the INSTALL file within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone please update the INSTALL file? > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > > , it includes DLLs for Windows and the JAR > > for Java. > > > > Follow the Windows instructions in the INSTALL. > > > > ie > > > > RXTXcomm.jar goes in \jre\lib\ext (under java) > > rxtxSerial.dll goes in \jre\bin > > > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > > C:\Program Files\Java\jre1.5.0_06\lib\ext > > and copy rxtxSerial.dll into > > C:\Program Files\Java\jre1.5.0_06\bin > > > > Yes, it really is that simple. > > > > > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > > > >> I am new to serial port programming, and have no experience on > >> programming java in xp, but my project require me to builld a > >> communication link between xp and a UART device. > >> > >> Most of the information in the web site seems for linux only. > >> including > >> the commands such as export and chmod. How do I install rxtx in xp? > >> > >> cheers > >> YiQi Huang > > > > > > > > -- > > Mark Himsley > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Mark Himsley From tjarvi at qbang.org Wed May 24 16:41:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 16:41:46 -0600 (MDT) Subject: [Rxtx] install rxtx in XP In-Reply-To: <37B0FC4B1F3237321F093ABE@MacMini.local> References: <37B0FC4B1F3237321F093ABE@MacMini.local> Message-ID: On Wed, 24 May 2006, Mark Himsley wrote: > > > On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > >> I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > That's no problem. > > BUT, do note that the instructions I elaborated on are in the INSTALL file > within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone > please update the INSTALL file? > > The INSTALL file may be updated by anyone at anytime. http://rxtx.qbang.org/wiki/index.php/Installation We are moving it to the wiki so end users may put the type of answers they would like to see in. Sometimes it's best if developers don't give what appears to be cryptic answers. You can even put in that jre/lib/ext is not the right place but you don't understand the classpath solution mentioned on the mail-list and then we know what to add. -- Trent Jarvi tjarvi at qbang.org From stramit at gmail.com Wed May 24 21:45:31 2006 From: stramit at gmail.com (Tim Cooper) Date: Thu, 25 May 2006 13:45:31 +1000 Subject: [Rxtx] Accessing Virtual Com Port Message-ID: Hi, I have to develop an application that talks to a virtual com port (in this case com3) which translates any messages sent across a USB cable to a micro. Using C++ I can talk to this com port and I know that it is configured, present, and working. For the application that I am trying to write I want to use RXTX for the communication. My problem is that the configured virtual port (in windows) is not showing up when I do an enumeration over the available ports. The output I get is (com 3 is not present) : Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 PORT FOUND: COM1 PORT FOUND: LPT1 Is there anything that I need to do to make com3 available to RXTX and my application? Timothy Cooper -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060524/c5591648/attachment-0397.html From antonio.luis at iscte.pt Thu May 25 01:39:13 2006 From: antonio.luis at iscte.pt (=?ISO-8859-1?Q?Ant=F3nio_Lopes?=) Date: Thu, 25 May 2006 08:39:13 +0100 Subject: [Rxtx] RXTX on Pocket PC Message-ID: <44755F21.8060103@iscte.pt> Hello everyone, I've been using RXTX to communicate with serial ports in Windows and it's been quite successful. However, I'm now considering porting my application from Windows to Pocket PC but I can't seem to find the RXTX binaries (*.jar and *.dll) to use in Pocket PC. I've been "digging" on the mailing list's archives and also on the web and I can't find these anywhere. Can anyone in this mailing list give me some pointers on this? Where can I find the necessary files and basic installation instructions? Thanks very much for your help. I very much appreciate any help that you can provide me. Regards, -- Ant?nio Lopes @contact: antonio.luis at iscte.pt @work: ADETTI - ISCTE @web: http://antonio.lopes.googlepages.com/home From doug at dupreeinc.com Fri May 26 15:45:50 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Fri, 26 May 2006 14:45:50 -0700 Subject: [Rxtx] rxtx slow startup Message-ID: <4477770E.9010400@dupreeinc.com> Hello, I hope there are people still reading this mailing list. The archive appeared to not have anything new after 4/2005. I was using the commapi from sun for a project where a java application reads data from test equipment connected to the serial port. I had to upgrade the ftdi vcp driver on my pc and the old sun commapi no longer works with hardware flow control. as an experiment I replaced the javax.com with gnu.io in the SerialDemo.java project that was included with the commapi. This compiled fine using JBuilder 2006 and JRE 1.5.0_05. RXTX also works with the latest ftdi drivers so life is wonderful again... almost... When using the commapi jar the SerialDemo program starts in about 1 second on my system. Using the RXTX jar it takes over 56 seconds to start. Has anyone else seen this problem? Is there a workaround to get the startup performance close to the old commapi? The last thing printed to the console before this delay is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks for your time! Doug From yhua537 at cse.unsw.edu.au Sat May 27 05:46:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 21:46:45 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <4477770E.9010400@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> Message-ID: hi Doug The archive hasn't been update for a long time, But people certainly still reading the list. I don't have enough experience to help on your problem, but without any detail about what your problem doing during that 56 seconds, it is hard to target the your question, I think. cheers YiQi On Fri, 26 May 2006, Doug Thistlethwaite wrote: > Hello, > > I hope there are people still reading this mailing list. The archive > appeared to not have anything new after 4/2005. > > I was using the commapi from sun for a project where a java application > reads data from test equipment connected to the serial port. I had to > upgrade the ftdi vcp driver on my pc and the old sun commapi no longer > works with hardware flow control. as an experiment I replaced the > javax.com with gnu.io in the SerialDemo.java project that was included > with the commapi. This compiled fine using JBuilder 2006 and JRE > 1.5.0_05. RXTX also works with the latest ftdi drivers so life is > wonderful again... almost... > > When using the commapi jar the SerialDemo program starts in about 1 > second on my system. Using the RXTX jar it takes over 56 seconds to > start. Has anyone else seen this problem? Is there a workaround to get > the startup performance close to the old commapi? > > The last thing printed to the console before this delay is: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Thanks for your time! > > Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------- Just a student, Still a student ------------------------------- From yhua537 at cse.unsw.edu.au Sat May 27 06:04:26 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 22:04:26 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: Sorry, I don't think you could understand what I mean .I mean this: Without any detail about what your program is doing during that 56 seconds, it is hard for anyone to target the problem. On Sat, 27 May 2006, YiQi Huang wrote: > hi Doug > > The archive hasn't been update for a long time, But people certainly still > reading the list. > > I don't have enough experience to help on your problem, but without any > detail about what your problem doing during that 56 seconds, it is hard to > target the your question, I think. > > cheers > YiQi > > On Fri, 26 May 2006, Doug Thistlethwaite wrote: > >> Hello, >> >> I hope there are people still reading this mailing list. The archive >> appeared to not have anything new after 4/2005. >> >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From jredman at ergotech.com Sat May 27 08:32:02 2006 From: jredman at ergotech.com (Jim Redman) Date: Sat, 27 May 2006 08:32:02 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: <447862E2.4080506@ergotech.com> Doug, Since you mentioned it, we have a system that is also seems slow. From memory (I don't have one of the slow systems around), I'm not sure that it's consistent, it seems that sometimes it may take longer than others. Since it's part of the bootup it hasn't raised a flag and I haven't researched it. The same code runs much faster on other systems, so now you've got me wondering what's different. The slow system boots DSL (http://www.damnsmalllinux.org/) from a compact flash. FC4 is on my desktop where I haven't noticed a slow down. I think that the rxtx code is the same in both cases with lock files disabled. The slow system has a bunch of serial ports defined, including 4 USB serial ports that do not exist - they are not plugged in. Any clues in there? Jim > On Fri, 26 May 2006, Doug Thistlethwaite wrote: >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Sat May 27 10:41:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 May 2006 10:41:54 -0600 (MDT) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447862E2.4080506@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: On Sat, 27 May 2006, Jim Redman wrote: > Doug, > > Since you mentioned it, we have a system that is also seems slow. From > memory (I don't have one of the slow systems around), I'm not sure that > it's consistent, it seems that sometimes it may take longer than others. > Since it's part of the bootup it hasn't raised a flag and I haven't > researched it. > > The same code runs much faster on other systems, so now you've got me > wondering what's different. > > The slow system boots DSL (http://www.damnsmalllinux.org/) from a > compact flash. FC4 is on my desktop where I haven't noticed a slow > down. I think that the rxtx code is the same in both cases with lock > files disabled. > > The slow system has a bunch of serial ports defined, including 4 USB > serial ports that do not exist - they are not plugged in. > > Any clues in there? > rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. When it does this, it will try to open each port and do a timed out read. most systems will not have entries in device if the port is not there. But some minimal systems will just put all the device files there in case hardware is added. The list of devices scanned used to be ~10-20 times longer than it is today. That was getting very slow. I suspect moving the device files not used to a backup directory would increase the enumeration. I'll look into why the mail-list archive is not updating. The last update was about when I thought I 'fixed' the cron jobs. I probably didn't actually fix it but rather moved the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon May 29 19:46:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 May 2006 19:46:47 -0600 (MDT) Subject: [Rxtx] Mail-List Archives are updating. Message-ID: It was pointed out earlier that the archive is dated. This was a missing crontab entry. The list is currently archived by the week on the web page. It is updated once a day. So every 7 days it starts a new link and updates it daily. I've been limited in what I could do while my cable modem was disconnected this last week. rxtx.org is something I do on my own time. The patches and credits will be comming next. Many of these can be seen in bugzilla right now. -- Trent Jarvi tjarvi at qbang.org From doug at dupreeinc.com Tue May 30 11:18:41 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 10:18:41 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: <447C7E71.4080204@dupreeinc.com> Trent, YiQi, and Jim: Thanks to all for the replies and information! I am just back from a long weekend and I am now trying to figure out what I was doing! :) As for more information. First off, this example is being run under windows XP. I am developing test equipment that communicates with a java application via a serial port. I have been using the commapi for several years and have not had a problem. Recently, I have started a design modification that will replace the RS232 connection with a USB port. I am using the ftdi module for prototyping and I discovered that their virtual com port driver was not compatible with the commapi that Sun released. It turns out that it has problems with hardware flow control ( it works on incoming but not outgoing communications). The way I figured this out was by experimenting with the SerialDemo that was included with the Sum commapi. One nice thing about this example is it has the ability to set incoming and outgoing flow control independently. After I installed RXTX into my JBuilder 2006 IDE, I just replaced all all instances of javax.comm with gnu.io and it compiled and runs without a hitch (except for the slow startup). I Paused the JBuilder IDE during this long pause and the last few entries in the stack trace are: testRead() : -1, gnu.io.RXTXCommDriver registerValidPorts() : 255, gnu.io.RXTXCommDriver registerScannedPorts() : 777, gnu.io.RXTXCommDriver This was all initiated by the following call in the programs init routine: Enumeration en = CommPortIdentifier.getPortIdentifiers(); After looking at this, My guess is that Trent is correct in that the delay is in scanning for ports. I guess one solution would be to not scan for ports, though it would be nice to detect what is available on the system. Is there any way to reduce the number of ports scanned by this function in windows XP? Thanks again for your time, Doug Trent Jarvi wrote: >On Sat, 27 May 2006, Jim Redman wrote: > > > >>Doug, >> >>Since you mentioned it, we have a system that is also seems slow. From >>memory (I don't have one of the slow systems around), I'm not sure that >>it's consistent, it seems that sometimes it may take longer than others. >>Since it's part of the bootup it hasn't raised a flag and I haven't >>researched it. >> >>The same code runs much faster on other systems, so now you've got me >>wondering what's different. >> >>The slow system boots DSL (http://www.damnsmalllinux.org/) from a >>compact flash. FC4 is on my desktop where I haven't noticed a slow >>down. I think that the rxtx code is the same in both cases with lock >>files disabled. >> >>The slow system has a bunch of serial ports defined, including 4 USB >>serial ports that do not exist - they are not plugged in. >> >>Any clues in there? >> >> >> > >rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. > >When it does this, it will try to open each port and do a timed out read. >most systems will not have entries in device if the port is not there. >But some minimal systems will just put all the device files there in case >hardware is added. > >The list of devices scanned used to be ~10-20 times longer than it is >today. That was getting very slow. > >I suspect moving the device files not used to a backup directory would >increase the enumeration. > >I'll look into why the mail-list archive is not updating. The last update >was about when I thought I 'fixed' the cron jobs. I probably didn't >actually fix it but rather moved the problem. > >-- >Trent Jarvi >tjarvi at qbang.org > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/86796453/attachment-0394.html From doug at dupreeinc.com Tue May 30 14:36:09 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 13:36:09 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447C7E71.4080204@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com> Message-ID: <447CACB9.1000801@dupreeinc.com> Hello all, I also notice this pause (not as long however) when I call: CommPortIdentifier.getPortIdentifier(PortName); I would think that if I supply the name of the port, it would not have to go through the same discovery process. If you have any ideas of how to get rid of this startup delay, I would really appreciate it. Thanks, Doug Doug Thistlethwaite wrote: > Trent, YiQi, and Jim: > > Thanks to all for the replies and information! I am just back from a > long weekend and I am now trying to figure out what I was doing! :) > > As for more information. First off, this example is being run under > windows XP. I am developing test equipment that communicates with a > java application via a serial port. I have been using the commapi for > several years and have not had a problem. Recently, I have started a > design modification that will replace the RS232 connection with a USB > port. I am using the ftdi module for prototyping and I discovered > that their virtual com port driver was not compatible with the commapi > that Sun released. It turns out that it has problems with hardware > flow control ( it works on incoming but not outgoing communications). > The way I figured this out was by experimenting with the SerialDemo > that was included with the Sum commapi. One nice thing about this > example is it has the ability to set incoming and outgoing flow > control independently. > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup). > > I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are: > > testRead() : -1, gnu.io.RXTXCommDriver > registerValidPorts() : 255, gnu.io.RXTXCommDriver > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > This was all initiated by the following call in the programs init routine: > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > After looking at this, My guess is that Trent is correct in that the > delay is in scanning for ports. I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system. Is there any way to reduce the number of ports scanned by > this function in windows XP? > > Thanks again for your time, > > Doug > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/edaa5c3c/attachment-0394.html From lynn at swcp.com Tue May 30 15:07:18 2006 From: lynn at swcp.com (lynn@swcp.com) Date: Tue, 30 May 2006 21:07:18 -0000 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CACB9.1000801@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: *IF* the name of the port is supplied, we might want to use the preferences mechanism (java.util.prefs) where we could have previously saved the info for the port. We could do a quick check to see that things have not changed before using it. If things have changed (or never been defined) we would do a full port scan and save detected ports in the preferences. This way if the hardware is not changed, you only pay the time penalty one time. just an idea... Lynn Doug Thistlethwaite said: > This is a multi-part message in MIME format. > --------------070808020900080005070500 > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > Content-Transfer-Encoding: 7bit > > Hello all, > > I also notice this pause (not as long however) when I call: > > CommPortIdentifier.getPortIdentifier(PortName); > > I would think that if I supply the name of the port, it would not have > to go through the same discovery process. If you have any ideas of how > to get rid of this startup delay, I would really appreciate it. > > Thanks, > > Doug > > Doug Thistlethwaite wrote: > > > Trent, YiQi, and Jim: > > > > Thanks to all for the replies and information! I am just back from a > > long weekend and I am now trying to figure out what I was doing! :) > > > > As for more information. First off, this example is being run under > > windows XP. I am developing test equipment that communicates with a > > java application via a serial port. I have been using the commapi for > > several years and have not had a problem. Recently, I have started a > > design modification that will replace the RS232 connection with a USB > > port. I am using the ftdi module for prototyping and I discovered > > that their virtual com port driver was not compatible with the commapi > > that Sun released. It turns out that it has problems with hardware > > flow control ( it works on incoming but not outgoing communications). > > The way I figured this out was by experimenting with the SerialDemo > > that was included with the Sum commapi. One nice thing about this > > example is it has the ability to set incoming and outgoing flow > > control independently. > > > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > > all instances of javax.comm with gnu.io and it compiled and runs > > without a hitch (except for the slow startup). > > > > I Paused the JBuilder IDE during this long pause and the last few > > entries in the stack trace are: > > > > testRead() : -1, gnu.io.RXTXCommDriver > > registerValidPorts() : 255, gnu.io.RXTXCommDriver > > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > > > This was all initiated by the following call in the programs init routine: > > > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > > > After looking at this, My guess is that Trent is correct in that the > > delay is in scanning for ports. I guess one solution would be to not > > scan for ports, though it would be nice to detect what is available on > > the system. Is there any way to reduce the number of ports scanned by > > this function in windows XP? > > > > Thanks again for your time, > > > > Doug > > > > --------------070808020900080005070500 > Content-Type: text/html; charset=ISO-8859-1 > Content-Transfer-Encoding: 7bit > > > > > > > > > Hello all,
>
> I also notice this pause (not as long however) when I call:
>
>          CommPortIdentifier.getPortIdentifier(PortName);
>
> I would think that if I supply the name of the port, it would not have > to go through the same discovery process.  If you have any ideas of how > to get rid of this startup delay, I would really appreciate it.
>
> Thanks,
>
> Doug
>
> Doug Thistlethwaite wrote: >
> > Trent, YiQi, and Jim:
>
> Thanks to all for the replies and information!  I am just back from a > long weekend and I am now trying to figure out what I was doing! :)
>
> As for more information.  First off, this example is being run under > windows XP.  I am developing test equipment that communicates with a > java application via a serial port.  I have been using the commapi for > several years and have not had a problem.  Recently, I have started a > design modification that will replace the RS232 connection with a USB > port.  I am using the ftdi module for prototyping and I discovered that > their virtual com port driver was not compatible with the commapi that > Sun released.  It turns out that it has problems with hardware flow > control ( it works on incoming but not outgoing communications).  The > way I figured this out was by experimenting with the SerialDemo that > was included with the Sum commapi.  One nice thing about this example > is it has the ability to set incoming and outgoing flow control > independently.
>
> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup).
>
> I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are:
>
> testRead() : -1, gnu.io.RXTXCommDriver
> registerValidPorts() : 255, gnu.io.RXTXCommDriver
> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>
> This was all initiated by the following call in the programs init > routine:
>
> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>
> After looking at this,  My guess is that Trent is correct in that the > delay is in scanning for ports.  I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system.  Is there any way to reduce the number of ports scanned by > this function in windows XP? 
>
> Thanks again for your time,
>
> Doug
>
>
> > > > --------------070808020900080005070500-- > -- From jredman at ergotech.com Tue May 30 15:42:35 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 30 May 2006 15:42:35 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: <447CBC4B.2080206@ergotech.com> Lynn, If I understand your idea correctly, I don't think that this would work well for, say, USB ports since these can be easily added/removed by the end user. Jim lynn at swcp.com wrote: > *IF* the name of the port is supplied, we might want to use the preferences > mechanism (java.util.prefs) where we could have previously saved the info for > the port. We could do a quick check to see that things have not changed > before using it. If things have changed (or never been defined) we would do a > full port scan and save detected ports in the preferences. > > This way if the hardware is not changed, you only pay the time penalty one time. > > just an idea... > Lynn > > > Doug Thistlethwaite said: > >> This is a multi-part message in MIME format. >> --------------070808020900080005070500 >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >> Content-Transfer-Encoding: 7bit >> >> Hello all, >> >> I also notice this pause (not as long however) when I call: >> >> CommPortIdentifier.getPortIdentifier(PortName); >> >> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process. If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it. >> >> Thanks, >> >> Doug >> >> Doug Thistlethwaite wrote: >> >>> Trent, YiQi, and Jim: >>> >>> Thanks to all for the replies and information! I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :) >>> >>> As for more information. First off, this example is being run under >>> windows XP. I am developing test equipment that communicates with a >>> java application via a serial port. I have been using the commapi for >>> several years and have not had a problem. Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port. I am using the ftdi module for prototyping and I discovered >>> that their virtual com port driver was not compatible with the commapi >>> that Sun released. It turns out that it has problems with hardware >>> flow control ( it works on incoming but not outgoing communications). >>> The way I figured this out was by experimenting with the SerialDemo >>> that was included with the Sum commapi. One nice thing about this >>> example is it has the ability to set incoming and outgoing flow >>> control independently. >>> >>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup). >>> >>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are: >>> >>> testRead() : -1, gnu.io.RXTXCommDriver >>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>> >>> This was all initiated by the following call in the programs init routine: >>> >>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>> >>> After looking at this, My guess is that Trent is correct in that the >>> delay is in scanning for ports. I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system. Is there any way to reduce the number of ports scanned by >>> this function in windows XP? >>> >>> Thanks again for your time, >>> >>> Doug >>> >> --------------070808020900080005070500 >> Content-Type: text/html; charset=ISO-8859-1 >> Content-Transfer-Encoding: 7bit >> >> >> >> >> >> >> >> >> Hello all,
>>
>> I also notice this pause (not as long however) when I call:
>>
>>         >  CommPortIdentifier.getPortIdentifier(PortName);
>>
>> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process.  If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it.
>>
>> Thanks,
>>
>> Doug
>>
>> Doug Thistlethwaite wrote: >>
>> >> Trent, YiQi, and Jim:
>>
>> Thanks to all for the replies and information!  I am just back from a >> long weekend and I am now trying to figure out what I was doing! :)
>>
>> As for more information.  First off, this example is being run under >> windows XP.  I am developing test equipment that communicates with a >> java application via a serial port.  I have been using the commapi for >> several years and have not had a problem.  Recently, I have started a >> design modification that will replace the RS232 connection with a USB >> port.  I am using the ftdi module for prototyping and I discovered that >> their virtual com port driver was not compatible with the commapi that >> Sun released.  It turns out that it has problems with hardware flow >> control ( it works on incoming but not outgoing communications).  The >> way I figured this out was by experimenting with the SerialDemo that >> was included with the Sum commapi.  One nice thing about this example >> is it has the ability to set incoming and outgoing flow control >> independently.
>>
>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >> all instances of javax.comm with gnu.io and it compiled and runs >> without a hitch (except for the slow startup).
>>
>> I Paused the JBuilder IDE during this long pause and the last few >> entries in the stack trace are:
>>
>> testRead() : -1, gnu.io.RXTXCommDriver
>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>
>> This was all initiated by the following call in the programs init >> routine:
>>
>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>
>> After looking at this,  My guess is that Trent is correct in that the >> delay is in scanning for ports.  I guess one solution would be to not >> scan for ports, though it would be nice to detect what is available on >> the system.  Is there any way to reduce the number of ports scanned by >> this function in windows XP? 
>>
>> Thanks again for your time,
>>
>> Doug
>>
>>
>> >> >> >> --------------070808020900080005070500-- >> > > > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From yhua537 at cse.unsw.edu.au Tue May 30 18:10:23 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 31 May 2006 10:10:23 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CBC4B.2080206@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: Doug, In the SerialDemo, it allow us to save the parameters into a file, and use it when your program start up. Would this help? YiQi On Tue, 30 May 2006, Jim Redman wrote: > Lynn, > > If I understand your idea correctly, I don't think that this would work > well for, say, USB ports since these can be easily added/removed by the > end user. > > Jim > > lynn at swcp.com wrote: >> *IF* the name of the port is supplied, we might want to use the preferences >> mechanism (java.util.prefs) where we could have previously saved the info for >> the port. We could do a quick check to see that things have not changed >> before using it. If things have changed (or never been defined) we would do a >> full port scan and save detected ports in the preferences. >> >> This way if the hardware is not changed, you only pay the time penalty one time. >> >> just an idea... >> Lynn >> >> >> Doug Thistlethwaite said: >> >>> This is a multi-part message in MIME format. >>> --------------070808020900080005070500 >>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>> Content-Transfer-Encoding: 7bit >>> >>> Hello all, >>> >>> I also notice this pause (not as long however) when I call: >>> >>> CommPortIdentifier.getPortIdentifier(PortName); >>> >>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process. If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it. >>> >>> Thanks, >>> >>> Doug >>> >>> Doug Thistlethwaite wrote: >>> >>>> Trent, YiQi, and Jim: >>>> >>>> Thanks to all for the replies and information! I am just back from a >>>> long weekend and I am now trying to figure out what I was doing! :) >>>> >>>> As for more information. First off, this example is being run under >>>> windows XP. I am developing test equipment that communicates with a >>>> java application via a serial port. I have been using the commapi for >>>> several years and have not had a problem. Recently, I have started a >>>> design modification that will replace the RS232 connection with a USB >>>> port. I am using the ftdi module for prototyping and I discovered >>>> that their virtual com port driver was not compatible with the commapi >>>> that Sun released. It turns out that it has problems with hardware >>>> flow control ( it works on incoming but not outgoing communications). >>>> The way I figured this out was by experimenting with the SerialDemo >>>> that was included with the Sum commapi. One nice thing about this >>>> example is it has the ability to set incoming and outgoing flow >>>> control independently. >>>> >>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>> all instances of javax.comm with gnu.io and it compiled and runs >>>> without a hitch (except for the slow startup). >>>> >>>> I Paused the JBuilder IDE during this long pause and the last few >>>> entries in the stack trace are: >>>> >>>> testRead() : -1, gnu.io.RXTXCommDriver >>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>> >>>> This was all initiated by the following call in the programs init routine: >>>> >>>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>> >>>> After looking at this, My guess is that Trent is correct in that the >>>> delay is in scanning for ports. I guess one solution would be to not >>>> scan for ports, though it would be nice to detect what is available on >>>> the system. Is there any way to reduce the number of ports scanned by >>>> this function in windows XP? >>>> >>>> Thanks again for your time, >>>> >>>> Doug >>>> >>> --------------070808020900080005070500 >>> Content-Type: text/html; charset=ISO-8859-1 >>> Content-Transfer-Encoding: 7bit >>> >>> >>> >>> >>> >>> >>> >>> >>> Hello all,
>>>
>>> I also notice this pause (not as long however) when I call:
>>>
>>>         >>  CommPortIdentifier.getPortIdentifier(PortName);
>>>
>>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process.  If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it.
>>>
>>> Thanks,
>>>
>>> Doug
>>>
>>> Doug Thistlethwaite wrote: >>>
>>> >>> Trent, YiQi, and Jim:
>>>
>>> Thanks to all for the replies and information!  I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :)
>>>
>>> As for more information.  First off, this example is being run under >>> windows XP.  I am developing test equipment that communicates with a >>> java application via a serial port.  I have been using the commapi for >>> several years and have not had a problem.  Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port.  I am using the ftdi module for prototyping and I discovered that >>> their virtual com port driver was not compatible with the commapi that >>> Sun released.  It turns out that it has problems with hardware flow >>> control ( it works on incoming but not outgoing communications).  The >>> way I figured this out was by experimenting with the SerialDemo that >>> was included with the Sum commapi.  One nice thing about this example >>> is it has the ability to set incoming and outgoing flow control >>> independently.
>>>
>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup).
>>>
>>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are:
>>>
>>> testRead() : -1, gnu.io.RXTXCommDriver
>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>
>>> This was all initiated by the following call in the programs init >>> routine:
>>>
>>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>
>>> After looking at this,  My guess is that Trent is correct in that the >>> delay is in scanning for ports.  I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system.  Is there any way to reduce the number of ports scanned by >>> this function in windows XP? 
>>>
>>> Thanks again for your time,
>>>
>>> Doug
>>>
>>>
>>> >>> >>> >>> --------------070808020900080005070500-- >>> >> >> >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From halbleib at rechnerbetriebsgruppe.de Wed May 31 02:06:16 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 10:06:16 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp Message-ID: <447D4E78.30302@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, I getting an error while reloading my app in tomcat. At the first start everything runs well, but if i reload mit webapp by tomcat manager i get the following error. java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader Is there a possibility to unload the native library rxtxSerial.dll? thx for all help! regards tom -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 b8FT80HQ1xlbDLnRecDANCc= =heb1 -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 02:52:17 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 10:52:17 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D4E78.30302@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> Message-ID: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Hello Tom, To the best of my knowledge it is impossible to unload native libraries once loaded into the JVM. The exception you see stems from the fact, that Tomcat creates a new classloader when you "reload" the weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar is loaded from the session class loader. Try to add RXTXComm.jar to your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. Regards, Joachim On 31.05.2006, at 10:06, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 > b8FT80HQ1xlbDLnRecDANCc= > =heb1 > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From halbleib at rechnerbetriebsgruppe.de Wed May 31 03:28:35 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 11:28:35 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Message-ID: <447D61C3.1030807@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Joachim, I'm still not getting it. How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml-file? Perhaps web.xml? Regards, Tom Joachim Buechse schrieb: > Hello Tom, > > To the best of my knowledge it is impossible to unload native > libraries once loaded into the JVM. The exception you see stems from > the fact, that Tomcat creates a new classloader when you "reload" the > weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar > is loaded from the session class loader. Try to add RXTXComm.jar to > your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. > > Regards, > Joachim > > On 31.05.2006, at 10:06, Tom Halbleib wrote: > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL tzNy+/0iIUfkYYgt1+UT1ko= =pkpY -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 04:03:42 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 12:03:42 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D61C3.1030807@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> <447D61C3.1030807@rechnerbetriebsgruppe.de> Message-ID: -Xbootclasspath/a: is a start option to the java vm. Google is your friend in finding how to modfiy it and what it means: tomcat modifying bootclasspath Regards, Joachim On 31.05.2006, at 11:28, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Joachim, > > I'm still not getting it. > How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml- > file? > Perhaps web.xml? > > Regards, > Tom > > Joachim Buechse schrieb: >> Hello Tom, >> >> To the best of my knowledge it is impossible to unload native >> libraries once loaded into the JVM. The exception you see stems from >> the fact, that Tomcat creates a new classloader when you "reload" the >> weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar >> is loaded from the session class loader. Try to add RXTXComm.jar to >> your bootlclasspath (-Xbootclasspath/a:) and the problem should go >> away. >> >> Regards, >> Joachim >> >> On 31.05.2006, at 10:06, Tom Halbleib wrote: >> >> Hi all, >> >> I getting an error while reloading my app in tomcat. At the first >> start >> everything runs well, but if i reload mit webapp by tomcat manager >> i get >> the following error. >> >> java.lang.UnsatisfiedLinkError: Native Library >> C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in >> another classloader thrown while loading gnu.io.RXTXCommDriver >> Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: >> Native >> Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already >> loaded >> in another classloader >> >> >> Is there a possibility to unload the native library rxtxSerial.dll? >> >> thx for all help! >> >> regards >> >> tom > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL > tzNy+/0iIUfkYYgt1+UT1ko= > =pkpY > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From impakt01 at optusnet.com.au Wed May 31 06:55:42 2006 From: impakt01 at optusnet.com.au (Daren) Date: Wed, 31 May 2006 22:55:42 +1000 Subject: [Rxtx] (no subject) Message-ID: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/ade7ad37/attachment-0394.html From doug at dupreeinc.com Wed May 31 10:19:19 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 31 May 2006 09:19:19 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: <447DC207.3070702@dupreeinc.com> I am not sure what you are saying. The Save parameters menu option saves the current settings (baud, data bits, etc.). The long pause (~60 seconds) is when the application first starts (before loading the saved parameters). This does bring up a question, though I hate this type of kludge approach to getting this library to work... What exactly is a PortIdentifier? Is it always the same? If I stored the results from "CommPortIdentifier.getPortIdentifier(PortName);" in a file, could I use this the next time the program is executed? In this case I am using a virtual com port driver to connect to the device through a USB port. Doug YiQi Huang wrote: >Doug, > >In the SerialDemo, it allow us to save the parameters into a file, and use >it when your program start up. Would this help? > >YiQi > >On Tue, 30 May 2006, Jim Redman wrote: > > > >>Lynn, >> >>If I understand your idea correctly, I don't think that this would work >>well for, say, USB ports since these can be easily added/removed by the >>end user. >> >>Jim >> >>lynn at swcp.com wrote: >> >> >>>*IF* the name of the port is supplied, we might want to use the preferences >>>mechanism (java.util.prefs) where we could have previously saved the info for >>>the port. We could do a quick check to see that things have not changed >>>before using it. If things have changed (or never been defined) we would do a >>>full port scan and save detected ports in the preferences. >>> >>>This way if the hardware is not changed, you only pay the time penalty one time. >>> >>>just an idea... >>>Lynn >>> >>> >>>Doug Thistlethwaite said: >>> >>> >>> >>>>This is a multi-part message in MIME format. >>>>--------------070808020900080005070500 >>>>Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>>>Content-Transfer-Encoding: 7bit >>>> >>>>Hello all, >>>> >>>>I also notice this pause (not as long however) when I call: >>>> >>>> CommPortIdentifier.getPortIdentifier(PortName); >>>> >>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process. If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it. >>>> >>>>Thanks, >>>> >>>>Doug >>>> >>>>Doug Thistlethwaite wrote: >>>> >>>> >>>> >>>>>Trent, YiQi, and Jim: >>>>> >>>>>Thanks to all for the replies and information! I am just back from a >>>>>long weekend and I am now trying to figure out what I was doing! :) >>>>> >>>>>As for more information. First off, this example is being run under >>>>>windows XP. I am developing test equipment that communicates with a >>>>>java application via a serial port. I have been using the commapi for >>>>>several years and have not had a problem. Recently, I have started a >>>>>design modification that will replace the RS232 connection with a USB >>>>>port. I am using the ftdi module for prototyping and I discovered >>>>>that their virtual com port driver was not compatible with the commapi >>>>>that Sun released. It turns out that it has problems with hardware >>>>>flow control ( it works on incoming but not outgoing communications). >>>>>The way I figured this out was by experimenting with the SerialDemo >>>>>that was included with the Sum commapi. One nice thing about this >>>>>example is it has the ability to set incoming and outgoing flow >>>>>control independently. >>>>> >>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>>without a hitch (except for the slow startup). >>>>> >>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>>entries in the stack trace are: >>>>> >>>>>testRead() : -1, gnu.io.RXTXCommDriver >>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>>> >>>>>This was all initiated by the following call in the programs init routine: >>>>> >>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>>> >>>>>After looking at this, My guess is that Trent is correct in that the >>>>>delay is in scanning for ports. I guess one solution would be to not >>>>>scan for ports, though it would be nice to detect what is available on >>>>>the system. Is there any way to reduce the number of ports scanned by >>>>>this function in windows XP? >>>>> >>>>>Thanks again for your time, >>>>> >>>>>Doug >>>>> >>>>> >>>>> >>>>--------------070808020900080005070500 >>>>Content-Type: text/html; charset=ISO-8859-1 >>>>Content-Transfer-Encoding: 7bit >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>>Hello all,
>>>>
>>>>I also notice this pause (not as long however) when I call:
>>>>
>>>>        >>>> >>>> >>> CommPortIdentifier.getPortIdentifier(PortName);
>>> >>> >>>>
>>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process.  If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it.
>>>>
>>>>Thanks,
>>>>
>>>>Doug
>>>>
>>>>Doug Thistlethwaite wrote: >>>>
>>>> >>>>Trent, YiQi, and Jim:
>>>>
>>>>Thanks to all for the replies and information!  I am just back from a >>>>long weekend and I am now trying to figure out what I was doing! :)
>>>>
>>>>As for more information.  First off, this example is being run under >>>>windows XP.  I am developing test equipment that communicates with a >>>>java application via a serial port.  I have been using the commapi for >>>>several years and have not had a problem.  Recently, I have started a >>>>design modification that will replace the RS232 connection with a USB >>>>port.  I am using the ftdi module for prototyping and I discovered that >>>>their virtual com port driver was not compatible with the commapi that >>>>Sun released.  It turns out that it has problems with hardware flow >>>>control ( it works on incoming but not outgoing communications).  The >>>>way I figured this out was by experimenting with the SerialDemo that >>>>was included with the Sum commapi.  One nice thing about this example >>>>is it has the ability to set incoming and outgoing flow control >>>>independently.
>>>>
>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>without a hitch (except for the slow startup).
>>>>
>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>entries in the stack trace are:
>>>>
>>>>testRead() : -1, gnu.io.RXTXCommDriver
>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>>
>>>>This was all initiated by the following call in the programs init >>>>routine:
>>>>
>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>>
>>>>After looking at this,  My guess is that Trent is correct in that the >>>>delay is in scanning for ports.  I guess one solution would be to not >>>>scan for ports, though it would be nice to detect what is available on >>>>the system.  Is there any way to reduce the number of ports scanned by >>>>this function in windows XP? 
>>>>
>>>>Thanks again for your time,
>>>>
>>>>Doug
>>>>
>>>>
>>>> >>>> >>>> >>>>--------------070808020900080005070500-- >>>> >>>> >>>> >>> >>> >>> >>-- >>Jim Redman >>(505) 662 5156 x85 >>http://www.ergotech.com >>_______________________________________________ >>Rxtx mailing list >>Rxtx at qbang.org >>http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > >cheers >YiQi Huang >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/61d4d4c9/attachment-0393.html From impakt01 at optusnet.com.au Wed May 31 17:02:54 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 09:02:54 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Message-ID: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Hi all, I downloaded 2.1.7-pre16 and managed to build it and get it going. I made the changes as suggested by Peter Smith in an old post, by adding his code to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. Still not working, it opens the port at 9600 according to portmon.exe . Has anyone managed to get this going at a custom rate? Here is the post I'm referring to: http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 Thanks, Daren ________________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Daren Sent: Wednesday, 31 May 2006 10:56 PM To: rxtx at qbang.org Subject: [Rxtx] (no subject) Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren From tjarvi at qbang.org Wed May 31 21:44:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 May 2006 21:44:01 -0600 (MDT) Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> References: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Message-ID: On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org From impakt01 at optusnet.com.au Wed May 31 22:06:04 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 14:06:04 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: Message-ID: <200606010406.k51464X2010447@mail03.syd.optusnet.com.au> Trent, I have managed to successfully open the port at this speed using Realterm (available on sourceforge). From memory this uses DLPortIO. Using portmon.exe with realterm, even there it says that the port has opened at 1953. I changed termios.c:560 to dcb->BaudRate = 1953 ; and it still opens the port at 9600. Daren -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Thursday, 1 June 2006 1:44 PM To: RXTX Developers and Users Subject: Re: [Rxtx] custom baud rate win32 On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From smontgomery at mediaspansoftware.com Mon May 1 09:52:28 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 11:52:28 -0400 Subject: [Rxtx] RXTX, Java COMM and Windows Server 2003 on x64 experiences? Message-ID: Just wondering if anybody here has had to deploy RXTX or the javax.comm on Windows Server 2003 machines running on x64 (i.e. Xeon EM64T) and would like to relate how things went. From Sun's site, the Supported System Configurations pages give the options for that system: Java 5.0: - 32-bit Java 5.0 running on the OS in the 32-bit mode - 64-bit Java 5.0 running on the OS in the 64-bit native mode Java 1.4.2: - no options listed for EM64T processors, but potentially the standard 32-bit Java 1.4.2 could run on the OS in 32-bit mode? I guess the two main points of failure would be 1) the JVM itself and 2) the jni components. Make that three: there's gotta be hardware vendor driver support for the OS in the various modes, too. Guess I better go look at Keyspan's website... Thanks in advance for any info anyone might be able to provide. From smontgomery at mediaspansoftware.com Mon May 1 10:18:33 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 12:18:33 -0400 Subject: [Rxtx] Mailing list archive out of date? Message-ID: The mailing list archive at: http://mailman.qbang.org/pipermail/rxtx/ only shows emails through the end of March. Is there a new archive somewhere else? Didn't see anything mentioned on the wiki. From p.cain at phasefale.com.au Mon May 1 22:33:09 2006 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 02 May 2006 14:33:09 +1000 Subject: [Rxtx] RXTX and the Linux kernel. Message-ID: <4456E105.5080106@phasefale.com.au> Hi, First off the problem I am having isn't caused by RXTX itself but I'm hoping someone out there may have some knowledge that may help me. Background: I have an application monitoring a control system through a standard PC serial port which I talk to with rxtx-2.0.5. The application runs on RedHat7.3 kernel version 2.4.18 using Java 1.4. This configuration has been in use for several years and has proved to be stable. But it has become necessary for me to upgrade the OS but I'm running into problems with the serial communications. Its not that the comms don't work on the new OS (its never that simple) the comms work for a variable period of time (sometimes several hours) and then just stop, nothing on the data lines and control lines all indicate that data could flow. The new OS is Ubuntu 5.10 running kernel version 2.6.12. I have installed the OS and software on a PC and had it perform ok, then install the new OS and same software on the very same hardware and experienced the problems of them comms stopping. In the new OS I'm using Java5 to run the app but since I have experience the problem I reverted back to Java1.4 which didn't fix the problem. I've moved the app to a different system RedHat FC3 running 2.6.14 had experienced the problem. Not wanting to go through all the thing I have tried but I have established that it seems to be the 2.6 versions of the kernel that seem to be the problem and not an individual distribution of Linux. I should point out that I am using the same jar and library files for each java and OS combination. So I'm just wondering if anyone has had or heard of problems similar to these ? Or perhaps might know of what changed in the Linux serial driver (something I'm having a hard time establishing). I'm starting to run low on ideas of what to try so any help would be much appreciated. -- Peter Cain Senior Programmer Phasefale Pty Ltd From tjarvi at qbang.org Wed May 3 07:31:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 May 2006 07:31:00 -0600 (MDT) Subject: [Rxtx] Re: Concering ircomm and RXTX In-Reply-To: References: Message-ID: On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From legolas.w at gmail.com Wed May 3 08:46:23 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 19:16:23 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <4458C23F.2000003@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From legolas.w at gmail.com Wed May 3 13:10:57 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 23:40:57 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <44590041.80706@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From Lars.Hennig at wow-portal.com Thu May 4 00:39:15 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Thu, 4 May 2006 08:39:15 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: Message-ID: Hi, I could not find any solution. I therefore decided to to my own native implementation. Allthough it only supports the functions I need, it works pretty well now for me. I think the main problem there is the use of a wrong Windows API function and not setting an timeout. Regards, Lars Hennig W?rth Online World GmbH Tel. (0049)7181-258183 Mob. (0049)160-3522889 Fax. (0049)7940-153299 Lars.Hennig at wow-portal.com Gesendet von: rxtx-bounces at qbang.org 09.04.2006 10:42 Bitte antworten zu RXTX Developers and Users An d.herwald at dsh-elektronik.de, RXTX Developers and Users Kopie Thema Re: [Rxtx] USB Serialport - disconnection problems WV Proj./Teilpr.: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/7b39f374/attachment-0398.html From Pawan.Kharbanda at dot.state.co.us Thu May 4 11:00:58 2006 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Thu, 4 May 2006 11:00:58 -0600 Subject: [Rxtx] Dangling Lock Files Message-ID: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Hi, I have been using RXTX API's for the Serial Communication for quite some time now and for some of the devices we are opening and closing the connection every 2 minutes. This works great for few days and then suddenly I start seeing some "Port in Use Exception" and I see that the Lock files are still in the /var/lock folder after manually removing the lock files it works good for few hours and I see the same problem again. Can somebody explain me the scenarios why I am seeing the dangling Lock files? I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise Servers. Thanks Pawan Kharbanda -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/ba0e9261/attachment-0398.html From tjarvi at qbang.org Thu May 4 14:10:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:10:30 -0600 (MDT) Subject: [Rxtx] Dangling Lock Files In-Reply-To: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> References: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Message-ID: On Thu, 4 May 2006, Kharbanda, Pawan wrote: > Hi, > I have been using RXTX API's for the Serial Communication for quite > some time now and for some of the devices we are opening and closing the > connection every 2 minutes. This works great for few days and then > suddenly I start seeing some "Port in Use Exception" and I see that the > Lock files are still in the /var/lock folder after manually removing the > lock files it works good for few hours and I see the same problem again. > Can somebody explain me the scenarios why I am seeing the dangling Lock > files? > > I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise > Servers. Hi Pawan The next time it happens, look in the lockfile. There will be a pid. ps aux |grep 'pid' I think you will see that the application is still running for some reason. RXTX does a kill -0 on the pid to see if its alive. If not, it will remove the lockfile. So I suspect the previous program did not exit as you expected. -- Trent Jarvi tjarvi at qbang.org From Scott.Hughes at dalsemi.com Thu May 4 14:23:11 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 4 May 2006 15:23:11 -0500 Subject: [Rxtx] Wiki instructions... Message-ID: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire demo apps, when I stumbled across this tip on the wiki to add yourself to the uucp group: It may be simpler to just run usermod -G uucp jarvi Taken from: http://rxtx.qbang.org/wiki/index.php/Installation This does not work as advertised. I should have read the man page for usermod before I tried that out. If there are any groups which are not listed after the -G switch, the user is removed from those groups. On Ubuntu, this is bad... I removed myself from the Admin group, which removed my sudo priviledges. Ubuntu has no root account, so I've disabled the only account which could fix it. Anyone know of a good workaround? Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor From tjarvi at qbang.org Thu May 4 14:32:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:32:09 -0600 (MDT) Subject: [Rxtx] Wiki instructions... In-Reply-To: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> Message-ID: On Thu, 4 May 2006, Scott Hughes wrote: > I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire > demo apps, when I stumbled across this tip on the wiki to add yourself to > the uucp group: > > It may be simpler to just run > > usermod -G uucp jarvi > > Taken from: > http://rxtx.qbang.org/wiki/index.php/Installation > > This does not work as advertised. I should have read the man page for > usermod before I tried that out. If there are any groups which are not > listed after the -G switch, the user is removed from those groups. On > Ubuntu, this is bad... I removed myself from the Admin group, which removed > my sudo priviledges. Ubuntu has no root account, so I've disabled the only > account which could fix it. > > Anyone know of a good workaround? > Yikes This will get your permissions back: in grub/lilo/.. pass the following option to the kernel init=/bin/sh You are now root. when it boots, mount -o remount,rw / add yourself to the groups, reboot to get normal init going. Thats about all I can think of without sudo/root. -- Trent Jarvi tjarvi at qbang.org From Gettings at earth.utah.edu Thu May 4 14:41:22 2006 From: Gettings at earth.utah.edu (Paul Gettings) Date: Thu, 4 May 2006 14:41:22 -0600 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <20060504204122.GA6534@earth.utah.edu> When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get messages on stdout from the JVM: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 As the only change was the version of RXTX (from 2.1.6), I am unsure why the messages suddenly appeared. Anyone know how to get rid of them? Thanks. -- 101 USES FOR A DEAD MICROPROCESSOR (23) Dead cat brush From mmester at sps.edu Mon May 1 21:22:28 2006 From: mmester at sps.edu (Michael Mester) Date: Mon, 1 May 2006 23:22:28 -0400 Subject: [Rxtx] Windows PortInUseException Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> I'm trying to get simple serial communication going with RxTx under Windows XP. I can enumerate the ports fine, but I always run into problems when I try to open one. I get a PortInUseException, but the owner application is "Unknown" and the port is never open. I've tried this on several different systems and all of them give the same behavior. The only thing I can thiunk of that might be causing the problem is that fact that I had to put the serial .dll file in system32 instead of the reccommended folder, because it didn't work in the folder the documentation gives. The library loads fine, though, so I'm not sure whether that makes sense, and I don't know how to fix it anyway. Any help is greatly appreciated. Below is the output of the program, right up to the PortInUseException and the NullPointerException it causes (because the serial port object is not instantiated). C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI Starting GPSTalkerGUI... Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 gnu.io.PortInUseException: Unknown Application Exception in thread "main" java.lang.NullPointerException at GPSTalkerGUI.(GPSTalkerGUI.java:102) at GPSTalkerGUI.main(GPSTalkerGUI.java:161) Again, thank you very much for any help you can give. From lshellman at qwest.net Wed May 3 01:38:34 2006 From: lshellman at qwest.net (Lucious Shellman) Date: Wed, 03 May 2006 01:38:34 -0600 Subject: [Rxtx] Help needed: Project using parallel port Message-ID: <1146641914.8337.14.camel@localhost.localdomain> I was looking for a way to access the parallel port on a PC using Java. Searching the Internet, I came across this site (rxtx.org). What I am trying to do is detect logic levels from a TTL logic IC on the parallel port. I am not trying to do classic parallel port communication. I just want to detect whether a line(s) is (are) high or low. I am using Windows 98. Can rxtx be used to do this? If yes, is there a tutorial for using rxtx posted on the Internet that someone can direct me to. If you need more information, feel free to e-mail me. Unfortunately for me, I need the information ASAP. Thanks. lshellman at qwest.net From webmaster at egyhelp.com Wed May 3 18:43:39 2006 From: webmaster at egyhelp.com (Mohamed Samy) Date: Thu, 4 May 2006 02:43:39 +0200 Subject: [Rxtx] RE: Concering ircomm and RXTX In-Reply-To: Message-ID: <20060503184362.SM01044@Geek> Hey, I issue the command "modprobe ircomm-tty" yet no ttyircomm appears, while the ircomm appear by "modprobe ircomm" so forgive me but I am bit lost. Even searching google for the keyword "ttyircomm" only returns 3 matches. So any way I can start the ttyircomm???? Thanks a lot. -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Wednesday, May 03, 2006 3:31 PM To: Mohamed Samy; rxtx at qbang.org Cc: taj at www.linux.org.uk Subject: Re: Concering ircomm and RXTX On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 4 15:49:49 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 15:49:49 -0600 (MDT) Subject: [Rxtx] Windows PortInUseException In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> Message-ID: On Mon, 1 May 2006, Michael Mester wrote: > > I'm trying to get simple serial communication going with RxTx under > Windows XP. I can enumerate the ports fine, but I always run into > problems when I try to open one. I get a PortInUseException, but the > owner application is "Unknown" and the port is never open. I've tried > this on several different systems and all of them give the same > behavior. The only thing I can thiunk of that might be causing the > problem is that fact that I had to put the serial .dll file in system32 > instead of the reccommended folder, because it didn't work in the folder > the documentation gives. The library loads fine, though, so I'm not sure > whether that makes sense, and I don't know how to fix it anyway. Any > help is greatly appreciated. Below is the output of the program, right > up to the PortInUseException and the NullPointerException it causes > (because the serial port object is not instantiated). > > C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI > Starting GPSTalkerGUI... > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > gnu.io.PortInUseException: Unknown Application > Exception in thread "main" java.lang.NullPointerException > at GPSTalkerGUI.(GPSTalkerGUI.java:102) > at GPSTalkerGUI.main(GPSTalkerGUI.java:161) > Perhaps you are trying to open the port twice in your code? rxtx does open the ports, do a timed out read and then close the ports during enumeration. I think the port is being opened fine. The Unknown Application is always reported. On linux, there is some code that finds the actual application but on windows, its always unknown. If the port enumeration is returning the ports you expect, rxtx has opened the port and closed it with success. The port should open. There is also example code in the contrib directory that comes with rxtx source that has examples you can modify to work. -- Trent Jarvi tjarvi at qbang.org From Christian.Klemke at t-online.de Thu May 4 23:37:23 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Fri, 5 May 2006 07:37:23 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu> Message-ID: <004f01c67005$fc72fee0$016a10ac@NB600> Hi Paul, I was wondering about the same question some days ago and took a look at the source files. Unfortunately, I found that you can only get rid of that messages by altering and recompiling the Java code. There is a final static boolean variable called "devel" in the file "RXTXCommDriver.java" which is set to "true". This constellation causes the output after the native libraries have been loaded. No mechanism exists to suppress them otherwise :-(. Trent, does that mean that 2.1.7 is still officially a "development" version ? When will this value be changed to "false" by default ? With 2.1.8 ? It would be nice to provide a means to suppress such messages besides that static flag (maybe by setting a property called "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The output can indeed by annoying, especially when used with console applications, where the message potentially appears "in the middle" of your own output. Another possibility would be not to use System.out directly, but instead some PrintStream field which is initially set to System.out but can programatically be changed. That would allow for any kind of redirection or suppression by implementing appropriate user-defined PrintStream subclasses and making RXTX use that stream. What do you think ? Best regards, Christian ----- Original Message ----- From: "Paul Gettings" To: Sent: Thursday, May 04, 2006 10:41 PM Subject: [Rxtx] RXTX causing stdout messages > When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get > messages on stdout from the JVM: > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > As the only change was the version of RXTX (from 2.1.6), I am unsure > why the messages suddenly appeared. Anyone know how to get rid of > them? > > Thanks. > > -- > 101 USES FOR A DEAD MICROPROCESSOR > (23) Dead cat brush > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri May 5 06:09:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 06:09:46 -0600 (MDT) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <004f01c67005$fc72fee0$016a10ac@NB600> References: <20060504204122.GA6534@earth.utah.edu> <004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: On Fri, 5 May 2006, Christian Klemke wrote: > Hi Paul, > > I was wondering about the same question some days ago and took a look at the > source files. Unfortunately, I found that you can only get rid of that > messages by altering and recompiling the Java code. There is a final static > boolean variable called "devel" in the file "RXTXCommDriver.java" which is > set to "true". This constellation causes the output after the native > libraries have been loaded. No mechanism exists to suppress them otherwise > :-(. > > Trent, does that mean that 2.1.7 is still officially a "development" version > ? When will this value be changed to "false" by default ? With 2.1.8 ? It > would be nice to provide a means to suppress such messages besides that > static flag (maybe by setting a property called > "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The > output can indeed by annoying, especially when used with console > applications, where the message potentially appears "in the middle" of your > own output. Another possibility would be not to use System.out directly, but > instead some PrintStream field which is initially set to System.out but can > programatically be changed. That would allow for any kind of redirection or > suppression by implementing appropriate user-defined PrintStream subclasses > and making RXTX use that stream. What do you think ? > A patch for using properties would be accepted I'm sure. The reason the default is to display the message is not related to the development state of rxtx anymore. The problem is that people first using rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. The message prevents a great deal of email thats easily explained by the message. I question if we should support rxtx 2.0 at all anymore. If you post a patch in bugzilla, we'll put it into CVS this weekend. we'll be going through and doing such things anyhow. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri May 5 13:23:56 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 13:23:56 -0600 (MDT) Subject: [Rxtx] How to read from RxTx parallel port in Win XP In-Reply-To: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> References: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> Message-ID: On Thu, 27 Apr 2006, Worsley, Bob (Development Engineer) wrote: > I'm sorry if this is a dumb question, but I didn't find the answer in > the archives. > > I'm using the RxTx binaries for Windows on a reasonably current notebook > PC running Windows XP. I can send stuff to a printer on the parallel > port (LPT1), but I can't get anything back. > > I wrote a class that has the methods listed below. I write some data to > the printer with the "write" method and then try to read a response > using the "read" method, but I never get any data. I'd greatly > appreciate any help you can give! > > Bob Worsley > bobwoyid2 at yahoo.com > > > > > private ParallelPort parallelPort = null; > private RXTXCommDriver parallelPortDriver = null; > > > public boolean initialize() throws IOException { > if (parallelPort != null) { > return false; // Already initialized > } > > // Create the parallel port; > parallelPortDriver = new RXTXCommDriver(); > parallelPort = > (ParallelPort)parallelPortDriver.getCommPort(address, > CommPortIdentifier.PORT_PARALLEL); > > // Set the parallel port parameters. > try { > parallelPort.enableReceiveTimeout(READ_TIMEOUT); > parallelPort.disableReceiveFraming(); > parallelPort.disableReceiveThreshold(); > //parallelPort.setMode(mode); !!!!errors > } catch (UnsupportedCommOperationException e) { > throw (new IOException("Parallel port with address '" + > address > + "' cannot be configured as specified")); > } > > return true; > } > > > > public void write(final byte[] bytes) throws IOException { > initialize(); > while (busyReading) { > Thread.yield(); > } > busyWriting = true; > if (bytes.length < 1) { > return; > } > OutputStream outputStream = parallelPort.getOutputStream(); > outputStream.write(bytes); > outputStream.flush(); > outputStream.close(); > Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); > busyWriting = false; > } > > > public byte[] read() throws IOException { > > // Read up to MAX_BYTES bytes. > initialize(); > while (busyWriting) { > Thread.yield(); > } > busyReading = true; > byte[] buff = new byte[MAX_BYTES_READ]; > InputStream inputStream = parallelPort.getInputStream(); > // This read blocks until input data is available > int bytesRead = inputStream.read(buff); > inputStream.close(); > // If no data read, create empty array > if (bytesRead == -1) { > bytesRead = 0; > } > byte[] deviceBytes = new byte[bytesRead]; > System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); > if (bytesRead > 0) { > Debug.p("PPIOP.read - got data: '" + new > String(deviceBytes) + "'"); > } > busyReading = false; > return deviceBytes; > } > Hi Bob I've only used rxtx to test a hello world page printing but there are others that have used it. PPIOP? hmm what is this? :) The rxtx parallel support is behind the serial support but should be OK. As you note, the setting of modes is not supported. rxtx uses what is provided when the port is open. Are your asserting the pin for the printer being online? I suspect what often happens is people try to just use the data pins but the C API rxtx uses wants the printer to be online. There should be some posts relating to this in the rxtx mail-list archive. Some APIs are probably reading and writing from the port address (also suggested in your code as something you are looking at). RXTX currently uses a higher level C/C++ API for port access. This can still work if the API thinks the 'printer' is there. -- Trent Jarvi tjarvi at qbang.org From agrodellic at gmail.com Sat May 6 08:39:40 2006 From: agrodellic at gmail.com (Leigh Stewart) Date: Sat, 6 May 2006 10:39:40 -0400 Subject: [Rxtx] sun commapi 3 Message-ID: I think I read here: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html that rxtx-2.0 is basically fracked for now? Does anyone know of a workaround? ie can i somehow get an older version of sun's comm api and use that (not easy to find)? i mean 2.0 must be working for someone...how is it being tested. 2.1 isnt working for me....im getting nasty native exceptions etc, which is why im so set on 2.0... any ideas? From tjarvi at qbang.org Sun May 7 15:40:27 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 7 May 2006 15:40:27 -0600 (MDT) Subject: [Rxtx] sun commapi 3 In-Reply-To: References: Message-ID: On Sat, 6 May 2006, Leigh Stewart wrote: > > 2.1 isnt working for me....im getting nasty native exceptions etc, > which is why im so set on 2.0... any ideas? > Hi Leigh What native exceptions are you seeing? Which OS? The native code is almost identical between rxtx 2.0 and 2.1. Only the names have been changed to protect the inocent. :) ie: javax_comm_... vs gnu_io_... So the odds are very likely that even if you do find commapi 2.0 and get it installed, you will run into the same error. It would be better to just find and fix the problem. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Mon May 8 10:47:20 2006 From: mail at willicon.de (WILLICon) Date: Mon, 08 May 2006 18:47:20 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 Message-ID: <445F7618.3070303@willicon.de> Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/ef37e8ec/attachment-0398.html From tjarvi at qbang.org Mon May 8 16:14:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 May 2006 16:14:51 -0600 (MDT) Subject: [Rxtx] Screenshot of Application using RXTX (fwd) Message-ID: Just though someone may end up searching for 0x0D and 0x0A. Here are the details from his system. SuSE Linux 10.0 (x86_64) Kernel 2.6.13-15.8 j2se 1.4.2_11 (i586) Sun: comm3.0_u1 rxtx: rxtx-2.1-7 ---------- Forwarded message ---------- Date: Sat, 6 May 2006 20:01:46 +0200 From: Michael Poppitz To: taj at www.linux.org.uk Subject: Screenshot of Application using RXTX Hi Trent, the rxtx package works like a charm. Sun's package seemed to replace all 0x0D with 0x0A in received data on my Linux box, which is really annoying when transfering binary data. But rxtx came and saved the day - and turned out to be a lot more convenient as it does not require a configuration file. I use it for connecting to a home made logic analyzer. (http://www.sump.org/projects/analyzer/) Thanks for your great job, Michael -------------- next part -------------- A non-text attachment was scrubbed... Name: la_client.png Type: image/png Size: 16592 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/45494fbb/la_client-0398.png From tjarvi at qbang.org Tue May 9 14:56:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 May 2006 14:56:05 -0600 (MDT) Subject: [Rxtx] RXTX javax.comm: which one to install? In-Reply-To: <20060509161742.43547.qmail@web53814.mail.yahoo.com> References: <20060509161742.43547.qmail@web53814.mail.yahoo.com> Message-ID: On Tue, 9 May 2006, Adenilson Cavalcanti wrote: > Dear Trent Jarvi > > I'm trying to write a small Java app running in linux that interfaces with a device connected to serial port. > > I do have some questions about RXTX and javax.comm state of affairs, since I'm new to Java programming (used to program in plain old C writting to devices using termios and open/write/read syscalls, but this is another story). > > I ask you the favor to clarify this issues (if possible...): > > a) Sun offers to download a file (comm3.0_u1_PUTAUNIXVERSION.zip) which does contain .so files. Does it work out of box? > > b) Case negative, its there that we should use 'librxtx*.so' provided by your site? > > c) Sun's comm3 API version does work with which version of rxtx? > > I already searched google and read documentation available in rxtx site ("Java Comm Serial API How-to") but still have this issues unsolved. Any help will be appreciated. > > Best regards > > Adenilson Hi Adenilson, RXTX does not currently support javax.comm in Sun's CommAPI 3.0. I would recommend using package gnu.io provided by rxtx 2.1. -- Trent Jarvi tjarvi at qbang.org From chris.develder at intec.ugent.be Wed May 10 08:45:40 2006 From: chris.develder at intec.ugent.be (Chris Develder) Date: Wed, 10 May 2006 16:45:40 +0200 Subject: [Rxtx] rxtx troubles on ARM Message-ID: <4461FC94.6040909@intec.ugent.be> Hi all, Sorry to bother you, but I don't seem to get RXTX working on an ARM processor (xscale ixp 425, big endian). I managed to crosscompile the rxtx libs and moved it over to the ARM. Using jamvm (which is the only open source java VM we got working on the ARM), I get the following error result when running SimpleRead from Sun's javax.comm examples (commapi\examples\Simple\SimpleRead) -- see bottom of mail for complete output: "java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver" However, output shows that the RXTXCommDriver code is accessible (cf. debug and devel output of lib versions). So it doesn't seem to be a missing lib/jar issue. The error happens before RXTXCommDriver.initialize() is called, since the first line there is System.out.println("RXTXCommDriver:initialize()"); Any ideas? Cheers, Chris ---------------------------- [root at xxx(ttyp1) /work/cdvelder/xscale/test]# jamvm -Djava.library.path=/work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/jre/lib/arm -classpath /work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/lib/ext/RXTXcomm.jar:./comm.jar:. SimpleRead RXTXCommDriver {} Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTXCommDriver: Jar version = RXTX-2.1-7 native lib Version = RXTX-2.1-7 java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver gnu/io/RXTXCommDriver at javax.comm.CommPortIdentifier.loadDriver (CommPortIdentifier.java:239) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:109) at SimpleRead.main (Unknown Source) java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive (Native Method) at com.sun.comm.Portmapping.registerCommPorts (Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase (Portmapping.java:100) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:138) at SimpleRead.main (Unknown Source) From joachim at buechse.de Fri May 12 00:44:48 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 08:44:48 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) Message-ID: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Good day, I guess that only a selected few (hi Trent) will be able to answer this question, but the answer might be interesting for anyone trying to debug or understand the code. Apparently the MonitorThread is started and stopped in RXTXPort.addEventListener and RXTXPort.removeEventListener. This would indicate that (originally?) the MonitorThread is only required when there is an EventListener. However the MonitorThread is also started in the RXTXPort constructor, which could mean that RXTX won't work at all if it isn't there. It seems to me, that if anyone would add an event listener and later on remove it, he could potentially wreak the port. Because the second action would kill the MonitorThread. For the moment I am only trying to understand the role of and idea behind the MonitorThread. But of course there is a deeper reason thor my question: If the MonitorThread needs to exist anyway, it could be the thread that cleans up the port (ie calls nativeClose) - this would eliminate (a further) problem I am seeing with some USB drivers on Mac OSX. (Close blocks (after releasing the tty, but still) in the USB driver if the device is "not responding"). Greetings, Joachim From tjarvi at qbang.org Fri May 12 07:10:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 12 May 2006 07:10:59 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Fri, 12 May 2006, Joachim Buechse wrote: > Good day, > > I guess that only a selected few (hi Trent) will be able to answer > this question, but the answer might be interesting for anyone trying > to debug or understand the code. > > Apparently the MonitorThread is started and stopped in > RXTXPort.addEventListener and RXTXPort.removeEventListener. This > would indicate that (originally?) the MonitorThread is only required > when there is an EventListener. However the MonitorThread is also > started in the RXTXPort constructor, which could mean that RXTX won't > work at all if it isn't there. > > It seems to me, that if anyone would add an event listener and later > on remove it, he could potentially wreak the port. Because the second > action would kill the MonitorThread. > > > For the moment I am only trying to understand the role of and idea > behind the MonitorThread. But of course there is a deeper reason thor > my question: > > If the MonitorThread needs to exist anyway, it could be the thread > that cleans up the port (ie calls nativeClose) - this would eliminate > (a further) problem I am seeing with some USB drivers on Mac OSX. > (Close blocks (after releasing the tty, but still) in the USB driver > if the device is "not responding"). > Hi Jaochim Before commapi, rxtx did not support events. You could read, write and change port settings. The MonitorThread was added as an afterthought to support commapi events. So the way things are now his historical spaghetti not a well devised plan. It is my opinion that the MonitorThread should exist as long as the port is open. The odd starting of the thread in the constructor and addEventListener was just to get past the obvious problem of people using the port without adding listeners. -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Fri May 12 07:59:50 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 15:59:50 +0200 Subject: [Rxtx] MonitorThread -> ChangeRequest In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: <2B1E508C-8CEE-4AB7-914D-E7BA25C871A2@buechse.de> In this case I suggest removing the starting/stopping of MonitorThread in addEventListener / removeEventListener. This should not affect existing projects. On 12.05.2006, at 15:10, Trent Jarvi wrote: > It is my opinion that the MonitorThread should exist as long as the > port > is open. The odd starting of the thread in the constructor and > addEventListener was just to get past the obvious problem of people > using > the port without adding listeners. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Fri May 12 11:43:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 19:43:21 +0200 Subject: [Rxtx] Spring Cleaning - some suggestions Message-ID: The current implementation of RXTX contains quite a lot of code that will break if it is used from several threads (especially on a multi processor machine). I think it would be nice to clean this up. I suggest the following changes (which keep the current semantics and should not influence existing projects in a negative way): - InterruptedException will never be ignored or reset - read methods will be protected with a Monitor - write methods will be protected with a (separate) Monitor - close() sets the read and write monitors into a "closed" state which will lead to IOExceptions for any following call to RXTXPort.read/write. - close() will wait a finite amount of time (maybe 500ms) for the release of the read and write monitors after that, it will trigger the closing of the file descriptor to abort any pending read or write. - close() will not call close(file_desc). Instead it will "interrupt" (ie set a flag and then, pthread_kill(ABRT)) the MonitorThread, the MonitorThread will call close(file_desc). - the monitors are properly released in a finally block the try of which starts directly after obtaining the monitor. - finally will not call close(file_desc) it will only "interrupt" the MonitorThread (see above) - the native-code (esp read) does not use SA_RESTART but checks Thread.interrupted() when it receives a SIGNAL (ie system call returns with EINTR or other signalling method). The read/write monitors will be allocated from a factory whose mode can be set to fast/normal/advanced. In fast-mode it will create "non thread safe, non synchronized" pseudo-monitors. In default mode, the monitors will store the owning thread. In "advanced" mode setting the monitors into closed state will "interrupt()" threads which are blocked in a native read/write. {Reasoning close behaviour: Calling close on a file descriptor in Windows unblocks any read() or write() on the same file descriptor with an error. On Solaris < 2.7 and MacOS X however the close() will/ can block - until the read or write have finished:-(( Even the JDK people have trouble with this. I dont know how Linux reacts in this case. The best practice for BSD/Solaris is to send a signal to the thread which will usually unblock the read/write with an EINTR - this however is not guarenteed as it also depends on the device driver. So the only resolution that will certainly not block the thread calling RXTXPort.close() (which will often enough be the AWT event dispatcher or the VM finalizer thread) is to call close(fd) from another thread.} {Reasoning read behaviour: It is rather uncommon to receive a signal while reading or writing - it will happen, but checking Thread.interrupted() when it happens will not degrade performance. The checking of Thread.interrupted() can be handled by returning to Java and potententially reentering into the native code if the thread was not interrupted or by calling back into the VM from the native code. On top of this, many functions like read(byte[]) or read(byte [], int, int) are allowed to return less than the requested amount of data. Only int read() is a bit more tricky. } [Trent: From the code I can tell, that you experimented quite a bit with signals. Do you know if the Java Thread.interrupt() triggers a unix signal on Linux/Solaris? If so, which one?? References: - http://java.sun.com/docs/hotspot/VMOptions.html - http://www.hp.com/products1/unix/java/infolibrary/prog_guide/ signals.html ] On OS X (hotspot client jdk-1.4.2) I did not see any signal propagated to the SELECT of the event_loop/MonitorThread (ie no EINTR) when I call monThread.interrupt(). This is a pitty, but thats the way it is. I simply assume this is true for most system calls. How to handle this? Of course it would be possible to install/ deinstall a specific signal handler before/after every native read and to natively send an ABRT signal if RXTXPort.close is called. A more elegant solution might be to have an additional "signaling" socket which is always included in the SELECT. Or the simplest solution: cap the timeout of the select to 500 ms (the loop around it exists already) after every timeout check the Thread.interrupted() flag. From a performance perspective this should be completely invisible... On the other hand, all write() calls need to be preceeded by a SELECT as well, to avoid running into a blocking write. Best regards, Joachim From lyon at docjava.com Sat May 13 05:54:52 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 13 May 2006 07:54:52 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Dmitry suggests that we acquire an implementation of a serial port reference, use it, then release it (i.e., check it back in). Joachim says that making serial ports thread friendly might be a good idea. This is a good idea. The design pattern that is close to this idea is the "Object Pool Design Pattern". # Object Pool Manage the reuse of objects for a type of object that is expensive to create or only a limited number of a kind of object can be created. It has been described at: http://www.developer.com/java/ent/article.php/626171 and in Marks' book, Patterns in Java, Volume 1. However, the Object Pool is intended to pool objects so that each object is just like every other object. The intent of the Parametric Singleton is to enable others to access the same resource at the same time (as long as the same parameters were used in construction). It sounds like we need a NEW Design Pattern (Oh no, Doug is doing it again!). Yes friends, you got me on a role (roll) :) If you like design patterns, you can thank me later. If you don't like design patterns, blame Dmitry, it was his idea ;) And Dave, thanks for the feedback on Singleton abuse. It has led me to change the way I think about application contexts, which we will see, below. We need (drum roll please): The Parametric Object Pool Design Pattern (POP) By Douglas A. Lyon ABSTRACT The goal of the Parametric Singleton design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values, in a given context. In comparison, the goal of the POP design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values and that only one reference to the class is checked out at a time, in a given context. A context is a namespace for holding identifiers during execution. In Java, A context can be changed in any of several ways. For example, creation of a new class loader, the deserialization of an old POP or the creation of a new process all create a new namespace. The POP Design Pattern combines the Parametric Singleton Design Pattern with the check out mechanism of the Object Pool Design Pattern. This enables unique creation of instances of a class. These instances are cached in a table. When a clients asks for an instance with these parameters, the cache is checked. If the instance is not in the cache it is created. If the instance is available, the clients checks out the instance. A reference is left to the clients that checked out the instance. The POP has the role of creating objects uniquely, from parameters. It also has the role of keeping track of which clients has checked out a given object. This is just like a library keeping track of who borrowed a book. If a resource is left unavailable in a system, a deadlock can occur. Deadlock debugging is facilitated by mapping a resource to the clients that have checked it out. We apply our POP Design Pattern to the retrieval of serial ports. The goal of our system is to make sure that serial ports are checked out to only one client at a time, and that they be checked back in when the client is done. The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. Users are discouraged from calling this the Parametric Object Oriented Pool (POOP). Introduction The intent of the POP Design Pattern is to ensure that a class has only one instance for a given set of parameter values. It also provides a point of access that is global to a given context. The POP uses the Singleton Design Pattern to ensure that there is only one POP, in the given context. The POP DP is responsible for checking out a reference to a given instance, and keeping track of that instance. The instance is responsible for sharing that instance. POP requires that users of the DP implement an interface that enables a recall facility. Thus, if there is a contention for a consumed resource, the deadlock can be resolved in an orderly fashion. Motivation A system cannot tolerate multiple instances of some classes with identical parameters used by different instances at the same time. For example, you cannot have two instances use the same serial port, at the same time. You cannot have two instances that are trying to listen to the same socket connection. You cannot have two instances writing to the same file structure at the same time. Further, once a serial port is checked out by a client, it is assigned to the client. This is like the spin-lock service provided by the operating system, only in the application layer. Naturally, deadlock will occur if a resource is not released, therefore the client of the resource is tracked. Recalling a resource is required for the POP DP by virtue of the implementation of an interface. The policy on how to break a deadlock (by honoring the recall) is application specific. As the operating system is often thought of as the arbiter of consumed resources (i.e., tape drives, serial ports, etc.) we frequently leave it to an operating system implementation to resolve these contention issues. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on naming conventions (which are not well standardized). The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. The POP Design Pattern can take on the role of the peer method mapper that homogenizes the API for different operating environments. That is, it can wrapper the different locking mechanisms used in different operating systems. POP that is responsible for keeping track of the instances created and the client that has checked them out. The POP Design Pattern is implemented using the Singleton Design Pattern. In Java, the POP implementation is declared final, so that it cannot be subclassed. The class also has a private constructor, so that other classes cannot instance it. The new design pattern is called the POP design pattern and it provides a way to check out and create instances with given parameters. Applicability Use the POP Design Pattern when: 1. There must be exactly one instance of a class with the given parameters in a given context. 2. The instances must be accessible to clients from a well-known access point. 3. The instances are reusable. 4. Only one client can check out an instance at a time. Structure Insert UML diagram here. Participants The POP Clients that need instances 1. The POP defines an instance upon request from a client, if, and only if, the instance does not already exist. 2. The POP returns the instance to the client. 3. The POP is responsible for creating unique instances from given parameters. 4. The POP is responsible to recalling instances from clients. Collaborations Clients obtain a reference to a POP instance only through the singleton design pattern. If the POP instance is left in an improper state (e.g., the serial port was left open) it is NOT the role of the POP to close the IO port. However, the POP can be requested to get the instance released. Nor is it the role of the POP Design Pattern to open the port. That role is delegate to some other part of the system. Further, it is the role of the POP Design Pattern to check out resources. However, it is still possible to have, multiple threads that have multiple references to the same resource at the same time. Checkout and resource requests are MUTEX locked (i.e., synchronized). Consequences The POP Design Pattern has several benefits: 1. Controlled access to parametrically defined instances. Since the POP encapsulates its instances, there is some limited control over how and when clients access it. 2. Reduced name space. The POP pattern avoids global variables that store instances created from the same parameter. Implementation Here are implementation issues to consider when using the POP pattern: 1. Unique mapping of parameters. The POP pattern requires that there be a mean to isomorphically map the parameter space into the instance space and back again. 2. Ensure unique instances. The POP pattern makes unique instances from parameters, and it does so only once. 3. Cache instances for fast retrieval. The POP must be able to look up instances, given some set of parameters, and do so from some data structure. That is, there must be enough space to hold references to all the instances the program will need. Also, a mechanism is needed to look up and retrieve the instances quickly enough to satisfy the clients. Sample Code To be written....any volunteers? Thanks! - Doug >I don't think I get it > >On Mar 22, 2006, at 9:36 AM, David Garnier wrote: >>Using the singleton pattern in this case is >>just convenient for the programmer. Problems >>arises >>pretty quickly, especially if you attempt to unit-test your classes. > > >so you're saying that something isn't so good >because you can not test it in the convenient >way? >if that's true, I'm totally disagree >change your test, debug whatever, but if >software is efficient at runtime, works fine and >only problem is some unit test >(which is some kind of framework for testing) >then dump that unit test , dump that unit >framework and make something appropriate to the >software >you're testing > >so if Douglas want to use singletons, what's the problem? >and what do you mean by abusing of singleton usage? > >of course singleton doesn't prevent concurrent >access to the resource across the processes >unless >you're using some OS facility to prevent it, besides >singleton as it was introduced is relevant only >and only inside of the same process >otherwise it's not singleton it's something else >(let's say network singleton: so you have remote >invocation facility >and some factory method that return object created by that facility) > >I don't have any problem with using any kind of singletons. > Parametric Singleton idea (if I understand it >right) could be easily implemented in the >following way: >use a map >populate map with instances of some class and key is your parameter >(you can use lazy population too) > >if somebody ask the key check the value if it's null so resource is taken >if somebody returns the resource put it back to the map > >public synchronized static Object getSomeResource(Object parameter); >public synchronized static void returnResource(Object parameter); > >getSomeResource (inside of the same process) could return null in 2 cases >1. if somebody (from other thread for example) already took that resource >2. if OS API said that resource corresponded to >that parameter (serial port with parameter = 1 >(port #)) >is locked and unavailable; >I'm not sure that in case of serial ports we >even need those Parametric Singletons >(unless lock checking is a very expensive operation) >just ask the OS about availability of that >resource and if it's available give it away >and then OS will lock it and therefore in next >time somebody ask it just answer that resource >is locked >and return null > >for example system has 2 serial ports available >so I ask getResource("tty"); >or I ask getResource("Bluetooth-Modem"); > >and if OS is ok you can give tty or Bluetooth-Modem or both > >no need for any additional pattern I think > >back to the problem >mac os x doesn't recognize locking via files, so >it handles locking via some API >an instance of the singleton in each process >should recognize that resource is locked >(by using that API) that's all >we don't have to make things more complicate >then they are just because there is some nice >design pattern or nice unit test framework or whatever >keep things simple, make them work fast, don't introduce middle layers >unless you have really good reason to do so > >of course I could be entirely wrong, so sorry about that in advance > >thanks > > >Dmitry Markman > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx >Good day, > >I guess that only a selected few (hi Trent) will be able to answer? >this question, but the answer might be interesting for anyone trying? >to debug or understand the code. > >Apparently the MonitorThread is started and stopped in? >RXTXPort.addEventListener and RXTXPort.removeEventListener. This? >would indicate that (originally?) the MonitorThread is only required? >when there is an EventListener. However the MonitorThread is also? >started in the RXTXPort constructor, which could mean that RXTX won't? >work at all if it isn't there. > >It seems to me, that if anyone would add an event listener and later? >on remove it, he could potentially wreak the port. Because the second? >action would kill the MonitorThread. > > >For the moment I am only trying to understand the role of and idea? >behind the MonitorThread. But of course there is a deeper reason thor? >my question: > >If the MonitorThread needs to exist anyway, it could be the thread? >that cleans up the port (ie calls nativeClose) - this would eliminate? >(a further) problem I am seeing with some USB drivers on Mac OSX.? >(Close blocks (after releasing the tty, but still) in the USB driver? >if the device is "not responding"). > >Greetings, >Joachim > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Sat May 13 10:07:37 2006 From: joachim at buechse.de (Joachim Buechse) Date: Sat, 13 May 2006 18:07:37 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Douglas, Looking at the current code, leaves me with the feeling, that there is a lot to do. Defining an API that wraps javax.comm to provide what you describe is certainly possible, but I wonder how much benefit it will actually provide. Personally I think the API defined by javax.comm "request/lock" a port with: cp= new CommunicationPort(identifier) "release" a port with: cp.close(); works quite nice for 99% of the applications. In my experience, the most efficient and elegant implementation is to wrap a port/socket/.. into a business object which declares the remote operations that are possible. Ie "uploadFile", "waitForPrompt", "getSerialNumber", "sendContact", "executeCommand", etc Those methods are then either synchronized or guarded by a monitor. I do not see how your design pattern applied to the port resource would help implementing this. [details start, skip if you agree to the above] When I talked about "thread-safe" I didn't mean several independent "sessions" accessing the port concurrently. I think this is a very rare usage. I believe the most common use case for serial ports today is the control of an external device from a PC running a GUI based application. To implement a clean Swing/AWT-GUI one needs to pass any action that can block to a "worker" thread (else the GUI blocks, the application appears dead). While it is possible to use own prespawned thread that will accept Runnables which operate on the port, this is not very elegant. It is more common to spawn a new thread for every action triggered by the user. Additionally the ABORT of a running operation is often implemented via a port.close() delegated to a different thread. - During the lifetime of a port, it will usually be accessed from several different threads. Instance variables need to be set/read in synchronized regions to guarantee a correct operation based on the Java memory model. - Synchronizing the access is usually handled on the application level (synchronizing the reads/writes is usually useless from the applications view because it is not a transaction mechanism). [details end] I am very open to learn about other scenarios where your proposed design pattern applied to the port resource is beneficial to the application implementor. Best regards, Joachim On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > Dmitry suggests that we acquire an implementation of > a serial port reference, use it, then release it (i.e., check it > back in). > > Joachim says that making serial ports thread friendly might be a > good idea. > > This is a good idea. The design pattern that is close to this idea > is the "Object Pool Design Pattern". > # Object Pool From jredman at ergotech.com Sun May 14 14:28:24 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 14:28:24 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers Message-ID: <446792E8.4000506@ergotech.com> Does anyone know of any work to make RXTX work with Ethernet (telent) Terminal Servers? If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? We've used RXTX with upwards of 100 virtual COM ports on Windows and it works well. Linux is more problematic. It would be good to have an OS independent solution to accesses remote Ethernet serial ports. Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From legolas.w at gmail.com Sun May 14 14:26:34 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:56:34 +0430 Subject: [Rxtx] does any one have a working sample of RXTX and LPT port Message-ID: <4467927A.4000008@gmail.com> Hi Thank you for reading my post does any one has a working sample for RXTX and LPT port ? Thanks From legolas.w at gmail.com Sun May 14 14:27:29 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:57:29 +0430 Subject: [Rxtx] does RXTX support Trigerr on parallel port? Message-ID: <446792B1.4040905@gmail.com> Hi does RXTX support trigger on LPT port ? if so , how i can use it ? Thanks From tjarvi at qbang.org Sun May 14 17:40:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 17:40:59 -0600 (MDT) Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: <446792E8.4000506@ergotech.com> References: <446792E8.4000506@ergotech.com> Message-ID: On Sun, 14 May 2006, Jim Redman wrote: > Does anyone know of any work to make RXTX work with Ethernet (telent) > Terminal Servers? > > If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 > Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? > Hi Jim It appears the author of NVTCom has decided to release the library into the public domain. Integration with rxtx is possible but it would be best to contact the author and find out what his intent is. I would suggest contacting the author with a proposal of what you would like to do and take it from there. We could 'take' public domain software but its better to show respect to the authors and respect their wishes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:10:23 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:10:23 -0600 (MDT) Subject: [Rxtx] does any one have a working sample of RXTX and LPT port In-Reply-To: <4467927A.4000008@gmail.com> References: <4467927A.4000008@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > Thank you for reading my post > does any one has a working sample for RXTX and LPT port ? > Thanks Hi Legolas LPT port support in rxtx is spotty. That means some people have sent in patches for what they do and it works well for them. The original code was not very good. It may have been 3 hours work :/ To get started, Sun has some demo programs with their commapi. With rxtx 2.1 you can change their code from using javax.com to gnu.io and it -should- work. But if it does not you can post here and on bugzilla. There has been more interest lately off the list and maybe there will be enough community resources to get what you need going. If you do get a sample program together, we would gladly put it in the contrib directory so the next person can get things going faster. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:12:12 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:12:12 -0600 (MDT) Subject: [Rxtx] does RXTX support Trigerr on parallel port? In-Reply-To: <446792B1.4040905@gmail.com> References: <446792B1.4040905@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > does RXTX support trigger on LPT port ? > if so , how i can use it ? > Hi Legolas As mentioned in the previous post, rxtx parallel support is not very mature. But if you can point to something that describes the trigger feature, we can probably make sure its there and give a quick code example. -- Trent Jarvi tjarvi at qbang.org From jredman at ergotech.com Sun May 14 22:22:48 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 22:22:48 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: References: <446792E8.4000506@ergotech.com> Message-ID: <44680218.4080008@ergotech.com> Trent, Trent Jarvi wrote: > On Sun, 14 May 2006, Jim Redman wrote: > >> Does anyone know of any work to make RXTX work with Ethernet (telent) >> Terminal Servers? >> >> If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 >> Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? >> > > Hi Jim > > It appears the author of NVTCom has decided to release the library into > the public domain. Integration with rxtx is possible but it would be best > to contact the author and find out what his intent is. > > I would suggest contacting the author with a proposal of what you would > like to do and take it from there. We could 'take' public domain software > but its better to show respect to the authors and respect their wishes. > I sent Marco(?), the author of the library, a note before asking the list - I'll let you know the response. If anyone is already working on it, or has an interest and more time and energy than me, I'd hate to duplicate the efforts. If no one is, and no one objects, maybe I'll see what I can do. Jim > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From Christian.Klemke at t-online.de Mon May 15 02:23:06 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Mon, 15 May 2006 10:23:06 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu><004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: <008a01c677f8$cae18590$02fea8c0@NB600> Hi Trent, Hi Paul, I finally found some time to create a simple patch to enable the optional suppression of version output to the console. It is based on a new system property called "gnu.io.rxtx.NoVersionOutput" which can by set to "true" if necessary. I had some problems accessing CVS, therefore I downloaded the rxtx-2.1-7r2 source archive from ftp.qbang.org (which is linked on the rxtx.org download page) and worked with that release. Please find my proposed patch in the attachment ! Regards, Christian ----- Original Message ----- From: "Trent Jarvi" To: "RXTX Developers and Users" Cc: ""Paul Gettings"" Sent: Friday, May 05, 2006 2:09 PM Subject: Re: [Rxtx] RXTX causing stdout messages > On Fri, 5 May 2006, Christian Klemke wrote: > >> Hi Paul, >> >> I was wondering about the same question some days ago and took a look at >> the >> source files. Unfortunately, I found that you can only get rid of that >> messages by altering and recompiling the Java code. There is a final >> static >> boolean variable called "devel" in the file "RXTXCommDriver.java" which >> is >> set to "true". This constellation causes the output after the native >> libraries have been loaded. No mechanism exists to suppress them >> otherwise >> :-(. >> >> Trent, does that mean that 2.1.7 is still officially a "development" >> version >> ? When will this value be changed to "false" by default ? With 2.1.8 ? It >> would be nice to provide a means to suppress such messages besides that >> static flag (maybe by setting a property called >> "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The >> output can indeed by annoying, especially when used with console >> applications, where the message potentially appears "in the middle" of >> your >> own output. Another possibility would be not to use System.out directly, >> but >> instead some PrintStream field which is initially set to System.out but >> can >> programatically be changed. That would allow for any kind of redirection >> or >> suppression by implementing appropriate user-defined PrintStream >> subclasses >> and making RXTX use that stream. What do you think ? >> > > A patch for using properties would be accepted I'm sure. > > The reason the default is to display the message is not related to the > development state of rxtx anymore. The problem is that people first using > rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. > The message prevents a great deal of email thats easily explained by the > message. > > I question if we should support rxtx 2.0 at all anymore. > > If you post a patch in bugzilla, we'll put it into CVS this weekend. > we'll be going through and doing such things anyhow. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_version_output_patch.diff Type: application/octet-stream Size: 991 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060515/3173c2b6/rxtx_version_output_patch-0398.obj From lyon at docjava.com Mon May 15 06:06:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 May 2006 08:06:21 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Joachim makes several good points. Let me see if I can address some of them below: >Hello Douglas, > >Looking at the current code, leaves me with the feeling, that there? >is a lot to do. Yes! >Defining an API that wraps javax.comm to provide what? >you describe is certainly possible, but I wonder how much benefit it? >will actually provide. > >Personally I think the API defined by javax.comm > >"request/lock" a port with: > cp= new CommunicationPort(identifier) >"release" a port with: > cp.close(); > >works quite nice for 99% of the applications. I don't know what percentage of applications turn off locking, the way that I do in my version of the RXTX lib. I do know that this is not safe practice. I also know that it was motivated by the multi-platform nature of my code and that this was the only way I could make things work, at the time. Java does not appear to have a cross-platform standard for locking resources on various platforms. Each OS appears to have its own standard. The question of who breaks deadlocks and how this is done remains open, as this is not an easy question to resolve. Let me continue, below: > >In my experience, the most efficient and elegant implementation is to? >wrap a port/socket/.. into a business object which declares the? >remote operations that are possible. Ie "uploadFile",? >"waitForPrompt", "getSerialNumber", "sendContact", "executeCommand",? >etc Those methods are then either synchronized or guarded by a? >monitor. I do not see how your design pattern applied to the port? >resource would help implementing this. I have no problem with high-level wrappers that are application specific. That is a very good idea, but orthogonal with respect to the issue of deadlocks. More below: > >[details start, skip if you agree to the above] >When I talked about "thread-safe" I didn't mean several independent? >"sessions" accessing the port concurrently. I think this is a very? >rare usage. That is probably why turning locking off works so well! On the other hand, it is not safe and I shouldn't do it. >I believe the most common use case for serial ports today? >is the control of an external device from a PC running a GUI based? >application. To implement a clean Swing/AWT-GUI one needs to pass any? >action that can block to a "worker" thread (else the GUI blocks, the? >application appears dead). While it is possible to use own prespawned? >thread that will accept Runnables which operate on the port, this is? >not very elegant. It is more common to spawn a new thread for every? >action triggered by the user. Additionally the ABORT of a running? >operation is often implemented via a port.close() delegated to a? >different thread. Here lies the heart of serial port concern. An application opens a serial port and then dies. The application is restarted and finds the port locked. How do we clear the lock? Must the application's user reside in the UUCP group? Must installers of the serial port add users to the UUCP group? Should locking be handled at a high-level of abstraction in an operating system independent way? Should the implementation of the locking mechanism be translated into an API that is dependent on the OS convention? Suppose that we restrict the discussion to serial ports. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on inconsistent naming conventions. Hence my feeling that we need to mirror what is done in other API's; we need a locking toolkit that references peer methods, IMHO. >From the Java programming point of view, the locking API is portable across different platforms, but has, as its implementation, a native peer method that uses the conventions of the underlying OS. This enables portable resource locking (in theory!). Consider, for example: org.apache.commons.transaction.locking with: Interface LockManager at: http://jakarta.apache.org/commons/transaction/apidocs/org/apache/commons/transaction/locking/LockManager.html Or, more recently: java.util.concurrent.locks Interface Lock based on Doug Lea's code: http://kickjava.com/src/EDU/oswego/cs/dl/util/concurrent/ReadWriteLock.java.htm Should we incorporate a clean, portable design into serial port use, one that is consistent with current locking APIs? Basically, a comm port is a resource and resources are typically controlled by managers. Thus, I suggest that we make use of a CommPortManager to help control and centralize serial port usage. The question of how this is done remains open, IMHO, but using core API's like: java.util.concurrent.locks might not be amiss. High-level methods (getAllPorts, getAllSerialPorts, getAllParallelPorts, etc...) might be welcome additions. Basic questions like, "what if a port is in use?" remain open, hence my proposal for the new design pattern. Isn't it the CommPortManager's role to break the deadlock? Cheers! - Doug > >- During the lifetime of a port, it will usually be accessed from? >several different threads. Instance variables need to be set/read in? >synchronized regions to guarantee a correct operation based on the? >Java memory model. >- Synchronizing the access is usually handled on the application? >level (synchronizing the reads/writes is usually useless from the? >applications view because it is not a transaction mechanism). >[details end] > >I am very open to learn about other scenarios where your proposed? >design pattern applied to the port resource is beneficial to the? >application implementor. > >Best regards, >Joachim > >On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > >> Dmitry suggests that we acquire an implementation of >> a serial port reference, use it, then release it (i.e., check it? >> back in). >> > > Joachim says that making serial ports thread friendly might be a? >> good idea. >> >> This is a good idea. The design pattern that is close to this idea >> is the "Object Pool Design Pattern". >> # Object Pool > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Mon May 15 06:58:19 2006 From: joachim at buechse.de (Joachim Buechse) Date: Mon, 15 May 2006 14:58:19 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Doug, I agree fully, that locking of the system resource should be abstracted from the user (programmer). Currently this is already the case, but I agree it might be nice to extract the code into a separate class, which uses platform dependent providers to do its job. What I described in my email was not targeted at allocating the system resource, but at handling an already allocated system resource inside the framework. I agree that it may be possible to combine the two - however, I would suggest to do this in phase2. I can contribute a work over of RXTXPort.java which implements clean internal locking and proper close behavior (which I would call phase 1). I could do this this week. However I strongly believe that there is little sense in trying to do this as a series of patches. It will be closer to a rewrite than to a patch. I have already provided a number of suggested patches via Bugzilla, but this is quite inconvenient (for me). My working copy diverges more and more from the master and hence it gets more and more annoying to provide self contained patches. Best regards, Joachim From tjarvi at qbang.org Mon May 15 08:27:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 May 2006 08:27:51 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Mon, 15 May 2006, Joachim Buechse wrote: > Hello Doug, > > I agree fully, that locking of the system resource should be > abstracted from the user (programmer). Currently this is already the > case, but I agree it might be nice to extract the code into a > separate class, which uses platform dependent providers to do its job. > > What I described in my email was not targeted at allocating the > system resource, but at handling an already allocated system resource > inside the framework. I agree that it may be possible to combine the > two - however, I would suggest to do this in phase2. > > I can contribute a work over of RXTXPort.java which implements clean > internal locking and proper close behavior (which I would call phase > 1). I could do this this week. > > However I strongly believe that there is little sense in trying to do > this as a series of patches. It will be closer to a rewrite than to a > patch. I have already provided a number of suggested patches via > Bugzilla, but this is quite inconvenient (for me). My working copy > diverges more and more from the master and hence it gets more and > more annoying to provide self contained patches. > For methodical testing purposes (which does go on) the incremental patches are better. I'm lagging behind in bugzilla but thats soon to change (this week). It has just been rather chaotic up until now. I moved, purchased a house, and jumped into the fire of a feature freeze timeframe at a new job. btw, we see the Solaris close issues on 2.8 also. 9 and 10 are fine. I'll work towards making those test results public and allow others to run new rxtx code through them. We had the OK at one point but setting up the environment is involved. It isn't just a collection of java classes. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Tue May 16 02:01:47 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:01:47 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] Message-ID: <446986EB.209@willicon.de> Hi, any ideas for my problem? Hans -------- Original-Nachricht -------- Betreff: [Rxtx] Problem under Mac OSX 10.3.9 Datum: Mon, 08 May 2006 18:47:20 +0200 Von: WILLICon Antwort an: RXTX Developers and Users An: RXTX Developers and Users Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/b0741c2b/attachment-0398.html From joachim at buechse.de Tue May 16 02:15:08 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 10:15:08 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: Hello Hans, I am using RXTX on OS X for my own project. I do not see the problem you describe. I had some troubles installing it because the current version uses lock files which is non-standard on OS X. I have created a patched version which I currently use. This version does not need to modify user groups and hence does not need an installer. I just pop it in the application directory. If you send me a link where I can download your OSX installer, I will have a quick look. Regards, Joachim On 16.05.2006, at 10:01, WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we > have some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + > spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + > spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always > the value "false". > I can only get the status, while I open the port and catch the > exception. > > Any ideas? > > Hans > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail at willicon.de Tue May 16 02:26:53 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:26:53 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: References: <446986EB.209@willicon.de> Message-ID: <44698CCD.7050709@willicon.de> Joachim, tanks for the answer. I'll send You a mail. Hans Joachim Buechse schrieb: > Hello Hans, > > I am using RXTX on OS X for my own project. I do not see the problem > you describe. > > I had some troubles installing it because the current version uses > lock files which is non-standard on OS X. I have created a patched > version which I currently use. This version does not need to modify > user groups and hence does not need an installer. I just pop it in > the application directory. If you send me a link where I can download > your OSX installer, I will have a quick look. > > Regards, > Joachim > > On 16.05.2006, at 10:01, WILLICon wrote: > > >> Hi, >> >> any ideas for my problem? >> >> Hans >> >> -------- Original-Nachricht -------- >> Betreff: [Rxtx] Problem under Mac OSX 10.3.9 >> Datum: Mon, 08 May 2006 18:47:20 +0200 >> Von: WILLICon >> Antwort an: RXTX Developers and Users >> An: RXTX Developers and Users >> >> >> Hi, >> >> I use for RXTX for communicate with CyclingComputers. >> >> It works good under Win32, Sloaris and Linux but with Mac OSX we >> have some problems. >> >> My users install the Mac OSX serial lib from the actual binary. >> >> After starting the program, they get this error message: >> >> java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while >> loading gnu.io.RXTXCommDriver >> >> Remember, this error comes only under Mac OSX. >> >> That is the code for the error: >> >> Enumeration portList = CommPortIdentifier.getPortIdentifiers(); >> spInUse = getBundleStr("serialPortInUse"); >> spFree = getBundleStr("serialPortFree"); >> while (portList.hasMoreElements()) { >> CommPortIdentifier portId = (CommPortIdentifier) >> portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (osName != null && osName.startsWith("mac")) { >> if (!portId.getName().startsWith("dev/cu.")) { >> continue; >> } >> } >> if (portId.isCurrentlyOwned()) { >> serialPortNames.add(portId.getName() + " - " + >> spInUse); >> } >> else { >> serialPortNames.add(portId.getName() + " - " + >> spFree); >> } >> } >> } >> if (serialPortNames.size() == 0) { >> serialPortNames.add(getBundleStr("serialPortNotFound")); >> } >> >> BTW: The methode isCurrentlyOwned() is not working. I get always >> the value "false". >> I can only get the status, while I open the port and catch the >> exception. >> >> Any ideas? >> >> Hans >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/948333be/attachment-0398.html From jredman at ergotech.com Tue May 16 07:35:52 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 16 May 2006 07:35:52 -0600 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: <4469D538.6070408@ergotech.com> Hans, I have no direct insight, but would note that what you have is a "NoClassDefFoundError" not a "ClassNotFoundException". So the class javax/comm/CommDriver is found, but one of its dependencies is missing. NoClassDefFoundError are a bigger problem to resolve because you get no indication of the real problem. Jim WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we have > some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > * spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always the > value "false". > I can only get the status, while I open the port and catch the exception. > > Any ideas? > > Hans > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.de Tue May 16 08:01:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 16:01:21 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 In-Reply-To: <4469AFC3.6000002@willicon.de> References: <44698EBC.8000008@willicon.de> <8C5680C4-E2BA-42FF-B221-36E1124FA6A4@buechse.de> <4469AFC3.6000002@willicon.de> Message-ID: <9825A602-D6ED-4C28-BF33-9A7C984FACD5@buechse.de> Hallo Hans, you include RXTX 2.17 in your "bikeXexperience.jar" (2.17 uses Interfaces from gnu.io.* not javax.comm.*). Now inspect your error log closely: The class gnu.io.RXTXCommDriver tries to load javax.comm.CommDriver: this is only the case for RXTX 2.07. I assume, that the user has installed Version 2.07 into one of the java.ext.dirs . The VM always tries to load classes from the "system" path first. The current Mac installer distributed with RXTX in fact installs RXTXcomm.jar and librxtxSerial.jnilib into /Library/Java/Extensions. (I wrote some time ago that I consider this as a bad idea because of potential version conflicts-> thanks for delivering the example). For 2.07 it does so without installing the javax.comm classes it seems. I would recommend that you instruct your users to install version 2.17 only. Until RXTX is changed to use TIOCEXCL instead of lock files, you can hardly avoid the installer, as the user needs to be added to a special group and a lockfile directory needs be created. More precisely you are waiting for: http://bugzilla.qbang.org/show_bug.cgi?id=50 [RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL)] Regards, Joachim -------------- next part -------------- A non-text attachment was scrubbed... Name: log.tiff Type: image/tiff Size: 38394 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/e3e52128/log-0398.tiff -------------- next part -------------- > > Ich verwende RXTX 2.17. Das orginal RXTXcomm.jar ist in > CyclingDataManager.jar enthalten. > From tjarvi at qbang.org Wed May 17 23:18:15 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 May 2006 23:18:15 -0600 (MDT) Subject: [Rxtx] update Message-ID: So we have several patches and these have stacked up. I'd like to thank everyone for being patient. Tests for the most intrusive patches look good so far. I still have to get some bits together on my end but it looks like we can catch everything up in CVS this week. I'll try to post a normal list of what went in by whom with links Saturday. But I'm not seeing anything that raises flags yet. I also think I'll be able to submit a patch for nonstandard baud rates. I have to confirm w32 but I think its going to be a one line fix. I don't know if its bugzilla or people tinkering with patch files before submitting but patches are not applying cleanly. So the patches have to be done by hand. This may make things difficult for people hoping to add other patches on top. I'm trying to make that go well but ... -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Thu May 18 02:23:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 May 2006 10:23:47 +0200 Subject: [Rxtx] update In-Reply-To: References: Message-ID: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Hello Trent, in fact I tinkered with the patches (never used this mechanism before, usually I "communicate" via cvs) ... so sorry for any trouble you had applying them. Basicly I edited the patches to make them self contained. Having the tests run with different speeds on different platforms, may well be an effect of caching. I have seen quite interesting propagation delays for the closing flag on my PowerPC system, which makes me doubt, that the propagation of output_buffer_empty_flag works as it should. Maybe the communication mechanism between the two threads should be replaced by something like pthread_cond_*. Could you describe which problems you see on Solaris/SPARC? I'd be interested to see if they exist on OS X (PowerPC) as well... As you seem to work on the stuff at the moment I would like to suggest the following additions (it looks more than it is, I posted some context to make clear where to apply the change). See the comments in braces for what was changed Greetings, Joachim (1) The end of the drain loop could be: --- report("drain_loop: received EINTR in tcdrain\n"); --- (added "in tcdrain" to make debug output clearer) (2) The start of the drain loop should be: --- for(i=0;;i++) { report_verbose("drain_loop: looping\n"); #if defined(__sun__) /* FIXME: No time to test on all OS's for production */ if( eis->eventloop_interrupted ) { goto end; } if (usleep(5000)) { report("drain_loop: received EINTR"); } #else if (usleep(1000000)) { report("drain_loop: received EINTR"); } #endif /* __sun__ */ --- (added a check for "eis->eventloop_interrupted" before the sleep) (3) The end of interrupt_event_loop could (and maybe should) be: --- #if !defined(TIOCSERGETLSR) && !defined(WIN32) /* make sure that the drainloop unblocks from tcdrain */ pthread_kill(index->drain_tid, SIGABRT); /* TODO use wait/join/SIGCHLD/?? instead of sleep? */ usleep(50 * 1000); /* Under normal conditions, SIGABRT will unblock tcdrain. However a non-responding USB device combined with an unclean driver may still block. This is very ugly because it may block the call to close indefinetly. */ if (index->closing != 1) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); index->closing = 1; } #endif report("interruptEventLoop: interrupted\n"); --- (added some comments and pthread_cancel for resisting drain thread) On 18.05.2006, at 07:18, Trent Jarvi wrote: > > So we have several patches and these have stacked up. I'd like to > thank > everyone for being patient. > > Tests for the most intrusive patches look good so far. I still > have to > get some bits together on my end but it looks like we can catch > everything > up in CVS this week. > > I'll try to post a normal list of what went in by whom with links > Saturday. But I'm not seeing anything that raises flags yet. I also > think I'll be able to submit a patch for nonstandard baud rates. > I have > to confirm w32 but I think its going to be a one line fix. > > I don't know if its bugzilla or people tinkering with patch files > before > submitting but patches are not applying cleanly. So the patches > have to > be done by hand. This may make things difficult for people hoping > to add > other patches on top. I'm trying to make that go well but ... > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu May 18 22:28:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 18 May 2006 22:28:00 -0600 (MDT) Subject: [Rxtx] update In-Reply-To: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> References: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Message-ID: On Thu, 18 May 2006, Joachim Buechse wrote: > Hello Trent, > > in fact I tinkered with the patches (never used this mechanism > before, usually I "communicate" via cvs) ... so sorry for any trouble > you had applying them. Basicly I edited the patches to make them self > contained. I think we are close to moving towards that. > > Having the tests run with different speeds on different platforms, > may well be an effect of caching. I have seen quite interesting > propagation delays for the closing flag on my PowerPC system, which > makes me doubt, that the propagation of output_buffer_empty_flag > works as it should. Maybe the communication mechanism between the two > threads should be replaced by something like pthread_cond_*. Could > you describe which problems you see on Solaris/SPARC? I'd be > interested to see if they exist on OS X (PowerPC) as well... This is interesting. I have seen problems with output buffer empty in applications that require it. I'm trying to get a bug list and or test results open for everyone to see but that may take time. But missed output buffer events ... yep. With Sparc, we have seen a few things. One was a kernel race condition that went away when we reimaged and updated 2.8. RXTX was hanging on close, top showed no cpu use but there was 2 second delays just typing on console. The other is our tests now take ~4 times longer on Solaris. Someone is looking at timing just open, close, read, write, ... to see if they can find where the slowdown is. This happened after solaris 2.8. I'll try to share more when/if there is something interesting. This may well not be solvable in userland. > > As you seem to work on the stuff at the moment I would like to > suggest the following additions (it looks more than it is, I posted > some context to make clear where to apply the change). See the > comments in braces for what was changed I'll take a look. This could all come together Saturday but I also have an event to attend that day. I may not wrap this up until Sunday. -- Trent Jarvi tjarvi at qbang.org From andrewlord at internode.on.net Sun May 21 20:10:02 2006 From: andrewlord at internode.on.net (Andrew Lord) Date: Mon, 22 May 2006 11:40:02 +0930 Subject: [Rxtx] Kernel include files do not match kernel Message-ID: <200605221140.03271.andrewlord@internode.on.net> Hi, I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel 2.6.12-18 with the command: ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include However I get the message: ## checking java.version 1.5.0_06 ## checking os.version 2.6.12-18mdk ## ## WARNING: Kernel include files do not match the current kernel ## ## configure: creating ./config.status etc. Is there a problem with the way I'm specifying the 'include' directory ? If not, how else can I specify the correct directory for the include files please ? Cheers, Andrew From tjarvi at qbang.org Sun May 21 20:31:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 May 2006 20:31:31 -0600 (MDT) Subject: [Rxtx] Kernel include files do not match kernel In-Reply-To: <200605221140.03271.andrewlord@internode.on.net> References: <200605221140.03271.andrewlord@internode.on.net> Message-ID: On Mon, 22 May 2006, Andrew Lord wrote: > Hi, > > I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel > 2.6.12-18 with the command: > > ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk > CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include > > However I get the message: > > ## checking java.version 1.5.0_06 > ## checking os.version 2.6.12-18mdk > ## > ## WARNING: Kernel include files do not match the current kernel > ## > ## configure: creating ./config.status > etc. > > Is there a problem with the way I'm specifying the 'include' directory ? If > not, how else can I specify the correct directory for the include files > please ? > Hi Andrew I'm fairly sure your --with-kernel option does nothing. The CPPFLAGS should do what you want. Maybe put an #error message in /usr/src/linux.../incude/linux/version.h But I don't recall a recent problem with version missmatches. It should work. Distros will even ship include files that don't match versions exactly. In theory it should never matter for users. I used to compile new kernels by hand and really didnt have a distro. I didnt have a seperate package of kernel headers for users (myself). When changing a gateway from linux 1.2.12 to 2.1.77, I would worry about such messages. So if you are doing something that weird, the message may be of use to you. If you just see the message on a distro you installed, it is more than likely harmless. -- Trent Jarvi tjarvi at qbang.org From mrogers at spro.net Mon May 22 14:45:39 2006 From: mrogers at spro.net (Mike Rogers) Date: Mon, 22 May 2006 14:45:39 -0600 Subject: [Rxtx] Sun's CommAPI -- think May? Message-ID: <447222F3.9040302@spro.net> Hi, Any word from Sun about progress towards fixing the Java CommAPI v3 "incompatibilities" so RXTX 2.0 can operate within the framework's namespace (javax.comm)? I recall mention of a May time frame. Thanks, Mike From paul.klissner at sun.com Mon May 22 15:09:27 2006 From: paul.klissner at sun.com (Paul Klissner) Date: Mon, 22 May 2006 14:09:27 -0700 Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <447222F3.9040302@spro.net> References: <447222F3.9040302@spro.net> Message-ID: <44722887.8080308@sun.com> Mike Rogers wrote: > Hi, > > Any word from Sun about progress towards fixing the Java CommAPI v3 > "incompatibilities" so RXTX 2.0 can operate within the framework's > namespace (javax.comm)? I recall mention of a May time frame. > > Thanks, > > Mike > We've had a lot of work come in. This hasn't been the only priority. I'm running behind the plan in addressing this, but will be looking at it again soon. Rather than state a new, I'll just say it is in progress, and not off the table. I'll get this fixed as soon as I can. Good timing for asking as we just started discussing javax.comm plans today, and I'll have some cycles to work on it soon. Paul From yhua537 at cse.unsw.edu.au Mon May 22 16:03:05 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Tue, 23 May 2006 08:03:05 +1000 (EST) Subject: [Rxtx] install rxtx in XP Message-ID: Hi Guys, I am new to serial port programming, and have no experience on programming java in xp, but my project require me to builld a communication link between xp and a UART device. Most of the information in the web site seems for linux only. including the commands such as export and chmod. How do I install rxtx in xp? cheers YiQi Huang From mark at mdsh.com Tue May 23 01:24:20 2006 From: mark at mdsh.com (Mark Himsley) Date: Tue, 23 May 2006 08:24:20 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off , it includes DLLs for Windows and the JAR for Java. Follow the Windows instructions in the INSTALL. ie RXTXcomm.jar goes in \jre\lib\ext (under java) rxtxSerial.dll goes in \jre\bin So, assuming a fairly standard Java install, copy RXTXcomm.jar into C:\Program Files\Java\jre1.5.0_06\lib\ext and copy rxtxSerial.dll into C:\Program Files\Java\jre1.5.0_06\bin Yes, it really is that simple. On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > I am new to serial port programming, and have no experience on > programming java in xp, but my project require me to builld a > communication link between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang -- Mark Himsley From joachim at buechse.de Tue May 23 02:51:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 23 May 2006 10:51:47 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) Unless it is absolutely required you should NOT install RXTX in your global Java Runtime Environment. This will for sure create versioning conflicts - if not now, than in the future, if not on your system than at your clients. Instead put the dll in your application directory and include the RXTXcomm.jar in your classpath. This is much safer and not a bit more complicated. Regards, Joachim On 23.05.2006, at 09:24, Mark Himsley wrote: > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR > for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > >> I am new to serial port programming, and have no experience on >> programming java in xp, but my project require me to builld a >> communication link between xp and a UART device. >> >> Most of the information in the web site seems for linux only. >> including >> the commands such as export and chmod. How do I install rxtx in xp? >> >> cheers >> YiQi Huang > > > > -- > Mark Himsley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tod at todbot.com Tue May 23 03:12:22 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 02:12:22 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I totally agree: do not contaminate the Java installation. I put all the RXTX files in a directory and then change my java invocation to be: % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* Alternatively, use Launch4J to create a double-clickable application and keep the RXTX libraries in the directory of the application. -=tod On May 23, 2006, at 1:51 AM, Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > >> Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off >> , it includes DLLs for Windows and the JAR >> for Java. >> >> Follow the Windows instructions in the INSTALL. >> >> ie >> >> RXTXcomm.jar goes in \jre\lib\ext (under java) >> rxtxSerial.dll goes in \jre\bin >> >> So, assuming a fairly standard Java install, copy RXTXcomm.jar into >> C:\Program Files\Java\jre1.5.0_06\lib\ext >> and copy rxtxSerial.dll into >> C:\Program Files\Java\jre1.5.0_06\bin >> >> Yes, it really is that simple. >> >> >> >> On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: >> >>> I am new to serial port programming, and have no experience on >>> programming java in xp, but my project require me to builld a >>> communication link between xp and a UART device. >>> >>> Most of the information in the web site seems for linux only. >>> including >>> the commands such as export and chmod. How do I install rxtx in xp? >>> >>> cheers >>> YiQi Huang >> >> >> >> -- >> Mark Himsley >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From smontgomery at mediaspansoftware.com Tue May 23 08:46:53 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Tue, 23 May 2006 10:46:53 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: Message-ID: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Joachim and Tod mentioned how to keep the files RXTX requires on Windows XP out of the Java installations - thanks gentlemen! Are there similar suggestions for an RXTX install on OS X? The current "canonical" OS X installation instructions "contaminate the Java installation", to use Tod's words. Our app will run fine under 1.4.2 and 5.0 on OS X, and a lot of users will have both. We've already been burned by the recent switch from 1.4.2 to 5.0 as the platform default. Any suggestions welcomed. From tod at todbot.com Tue May 23 13:27:55 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 12:27:55 -0700 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <9BA0F670-A862-42E7-BB2C-130D775ABDF9@todbot.com> Hi Sean, It depends on how you build and deploy your code. If you're using shell scripts, you can do something like this: #!/bin/sh # pick one JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/ Commands/java #JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/ Commands/java $JAVA -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* That both picks which VM to use and uses the RXTX in the directory called 'rxtxlib'. If you want your shell script to be clever, you could test for the existence of the different 'java' executables and go from there (maybe even use different jar files). I am almost positive all OS X systems with Java 1.5 are guaranteed to also have Java 1.4.2. If you're using Jar Builder or XCode, you can specify which JVM to use and add the extra args in the Info.plist file. The paths specified in the 'java' invocation then are based off of the $JAVAROOT variable that the JavaApplicationStub sets for you. For my app, I've have been compiling two sets of jars, one compiled with 1.4.2 and one with 1.5, but they both run under 1.5. So I have a similar shell script that chooses a different 'javac' depending on the need. -=tod On May 23, 2006, at 7:46 AM, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From yhua537 at cse.unsw.edu.au Tue May 23 11:09:37 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 03:09:37 +1000 (EST) Subject: [Rxtx] install rxtx in XP (Mark Himsley, Joachim Buechse, Tod E. Kurt> In-Reply-To: References: Message-ID: > Message: 8 > Date: Tue, 23 May 2006 08:03:05 +1000 (EST) > From: YiQi Huang > Subject: [Rxtx] install rxtx in XP > To: rxtx at qbang.org > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > Hi Guys, > > I am new to serial port programming, and have no experience on programming > java in xp, but my project require me to builld a communication link > between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang > > > ------------------------------ > > Message: 9 > Date: Tue, 23 May 2006 08:24:20 +0100 > From: Mark Himsley > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=us-ascii; format=flowed > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > ------------------------------ > > Message: 10 > Date: Tue, 23 May 2006 10:51:47 +0200 > From: Joachim Buechse > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > > ------------------------------ > > Message: 11 > Date: Tue, 23 May 2006 02:12:22 -0700 > From: "Tod E. Kurt" > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I totally agree: do not contaminate the Java installation. > > I put all the RXTX files in a directory and then change my java > invocation to be: > > % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* > > Alternatively, use Launch4J to create a double-clickable application > and keep the RXTX libraries in the directory of the application. > > -=tod > > Hi, Thanks guys, I don't know if this is the correct way to reply your mecessage, if wrong, please point out. Thank you for Mark to give the detail instructions and Joachim to point out the cons ot installing in the java directory, and specially thanks for Tod to give the instrection in detail. Sorry to ask another stupid question: I have followed Tod's instruction. Now I think i am ready to start hacking. But where is the RXTX API documentation? Is it the same as using normal java comm API? btw, where could i find some examples to start with? Thanks very much cheers YiQi Huang From tjarvi at qbang.org Tue May 23 16:09:32 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 May 2006 16:09:32 -0600 (MDT) Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <44722887.8080308@sun.com> References: <447222F3.9040302@spro.net> <44722887.8080308@sun.com> Message-ID: > Good timing for asking as we just started discussing javax.comm plans > today, and I'll have some cycles to work on it soon. Hi Paul I assume you mean Sun is discussing plans concerning its own internal actions and there is no community involvment at this point. -- Trent Jarvi tjarvi at qbang.org From yhua537 at cse.unsw.edu.au Tue May 23 22:50:01 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 14:50:01 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } From mmester at sps.edu Tue May 23 22:58:21 2006 From: mmester at sps.edu (Michael Mester) Date: Wed, 24 May 2006 00:58:21 -0400 Subject: [Rxtx] install rxtx in XP References: Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below -----Original Message----- From: rxtx-bounces at qbang.org on behalf of YiQi Huang Sent: Wed 5/24/2006 12:50 AM To: RXTX Developers and Users Subject: Re: [Rxtx] install rxtx in XP Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3950 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060523/b36d0c63/attachment-0398.bin From yhua537 at cse.unsw.edu.au Tue May 23 23:05:50 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 15:05:50 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: Yes, Michael you are right, it should be semicolons, But it still can't find the correct library. On Wed, 24 May 2006, Michael Mester wrote: > I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below > > > -----Original Message----- > From: rxtx-bounces at qbang.org on behalf of YiQi Huang > Sent: Wed 5/24/2006 12:50 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] install rxtx in XP > > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > cheers YiQi Huang From tod at todbot.com Wed May 24 00:01:57 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 23:01:57 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Yes, sorry, classpath entries are semicolon-separated on Windows and colon-separated on everything else. Your example code below is importing the wrong set of classes. It should not "import javax.comm.*", instead it should "import gnu.io.*". When I make that change, your example program compiles. The "javax.comm" package is the one released by Sun, the "gnu.io" package is the RXTX one. You might've seen some discussion that the two will be merged or become compatible, but that hasn't happened yet. -=tod On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > > Yes, Michael you are right, it should be semicolons, But it still > can't > find the correct library. > > On Wed, 24 May 2006, Michael Mester wrote: > >> I believe the entries in the classpath need to be seperated with >> semicolons, not a colon as you have in your command below >> >> >> -----Original Message----- >> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >> Sent: Wed 5/24/2006 12:50 AM >> To: RXTX Developers and Users >> Subject: Re: [Rxtx] install rxtx in XP >> >> Hi, >> >> Sorry guys.I follow Tod's instruction, and here is what i did: >> >> put >> RXTXcomm.jar, >> rxtxParallel.dll, >> rxtxSerial.dll >> in >> C:\RXTX_files >> >> and I got a SimpleRead class attached below, compile it with : >> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >> it still saying "cannot find symbol". >> >> Is there anything I did wrong? Do I need the comm.jar from Sun? >> >> Thanks & regards >> YiQi Huang >> >> >> //////////////////////////////////////////////////////// >> // SimpleRead.java >> //////////////////////////////////////////////////////// >> >> import java.io.*; >> import java.util.*; >> import javax.comm.*; >> >> public class SimpleRead >> implements Runnable, SerialPortEventListener { >> static CommPortIdentifier portId; >> static Enumeration portList; >> InputStream inputStream; >> SerialPort serialPort; >> Thread readThread; >> public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == >> CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals("COM1")) { >> //if (portId.getName().equals("/dev/term/a")) { >> SimpleRead reader = new SimpleRead(); >> } >> } >> } >> } >> public SimpleRead() { >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", >> 2000); >> } catch (PortInUseException e) {} >> try { >> inputStream = serialPort.getInputStream(); >> } catch (IOException e) {} >> try { >> serialPort.addEventListener(this); >> } catch (TooManyListenersException e) {} >> serialPort.notifyOnDataAvailable(true); >> try { >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } catch (UnsupportedCommOperationException e) {} >> readThread = new Thread(this); >> readThread.start(); >> } >> public void run() { >> try { >> Thread.sleep(20000); >> } catch (InterruptedException e) {} >> } >> public void serialEvent(SerialPortEvent event) { >> switch(event.getEventType()) { >> case SerialPortEvent.BI: >> case SerialPortEvent.OE: >> case SerialPortEvent.FE: >> case SerialPortEvent.PE: >> case SerialPortEvent.CD: >> case SerialPortEvent.CTS: >> case SerialPortEvent.DSR: >> case SerialPortEvent.RI: >> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >> break; >> case SerialPortEvent.DATA_AVAILABLE: >> byte[] readBuffer = new byte[20]; >> try { >> while (inputStream.available() > 0) { >> int numBytes = inputStream.read(readBuffer); >> } >> System.out.print(new String(readBuffer)); >> } catch (IOException e) {} >> break; >> } >> } >> } >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > cheers > YiQi Huang > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From joachim at buechse.de Wed May 24 00:10:06 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:10:06 +0200 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Hi Sean, my preferred way of dealing with RXTX on OS X is to include the RXTX classes into my application jar and to put the RXTX lib in the same directory as this jar. To make it even more comfortable, you can include the lib in the jar and have some startup code extract it and write it to a temporary file from which you load it with System.load(). Unfortunately the current version of RXTX for OS X requires tinkering with user groups as it is based on lockfiles - and hence it needs the RXTX OS X installer or you need to duplicated this functionality in your own installer. I have created my own native version which is not based on lockfiles but tty locking (the standard way to do it on OSX). I hope that these patches will be integrated soon into the distribution. Regards, Joachim On 23.05.2006, at 16:46, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Wed May 24 00:16:12 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:16:12 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <7017ECFC-B13E-4806-B321-9FFCAC5830F0@buechse.de> I assume you downloaded rxtx-217 (not 207). Instead of importing javax.comm.* you must import gnu.io.* The classes have the same name, but they are not in the same package. On 24.05.2006, at 06:50, YiQi Huang wrote: > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From yhua537 at cse.unsw.edu.au Wed May 24 00:17:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 16:17:45 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Message-ID: Thanks Tod again, i kept reading "gnu.io.*" as "gun.io.*" last few hours after i read some commons from web. Thanks very much Tod. thanks YiQi Huang On Tue, 23 May 2006, Tod E. Kurt wrote: > Yes, sorry, classpath entries are semicolon-separated on Windows and > colon-separated on everything else. > > Your example code below is importing the wrong set of classes. It > should not "import javax.comm.*", instead it should "import > gnu.io.*". When I make that change, your example program compiles. > The "javax.comm" package is the one released by Sun, the "gnu.io" > package is the RXTX one. You might've seen some discussion that the > two will be merged or become compatible, but that hasn't happened yet. > > -=tod > > > On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > >> >> Yes, Michael you are right, it should be semicolons, But it still >> can't >> find the correct library. >> >> On Wed, 24 May 2006, Michael Mester wrote: >> >>> I believe the entries in the classpath need to be seperated with >>> semicolons, not a colon as you have in your command below >>> >>> >>> -----Original Message----- >>> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >>> Sent: Wed 5/24/2006 12:50 AM >>> To: RXTX Developers and Users >>> Subject: Re: [Rxtx] install rxtx in XP >>> >>> Hi, >>> >>> Sorry guys.I follow Tod's instruction, and here is what i did: >>> >>> put >>> RXTXcomm.jar, >>> rxtxParallel.dll, >>> rxtxSerial.dll >>> in >>> C:\RXTX_files >>> >>> and I got a SimpleRead class attached below, compile it with : >>> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >>> it still saying "cannot find symbol". >>> >>> Is there anything I did wrong? Do I need the comm.jar from Sun? >>> >>> Thanks & regards >>> YiQi Huang >>> >>> >>> //////////////////////////////////////////////////////// >>> // SimpleRead.java >>> //////////////////////////////////////////////////////// >>> >>> import java.io.*; >>> import java.util.*; >>> import javax.comm.*; >>> >>> public class SimpleRead >>> implements Runnable, SerialPortEventListener { >>> static CommPortIdentifier portId; >>> static Enumeration portList; >>> InputStream inputStream; >>> SerialPort serialPort; >>> Thread readThread; >>> public static void main(String[] args) { >>> portList = CommPortIdentifier.getPortIdentifiers(); >>> while (portList.hasMoreElements()) { >>> portId = (CommPortIdentifier) portList.nextElement(); >>> if (portId.getPortType() == >>> CommPortIdentifier.PORT_SERIAL) { >>> if (portId.getName().equals("COM1")) { >>> //if (portId.getName().equals("/dev/term/a")) { >>> SimpleRead reader = new SimpleRead(); >>> } >>> } >>> } >>> } >>> public SimpleRead() { >>> try { >>> serialPort = (SerialPort) portId.open("SimpleReadApp", >>> 2000); >>> } catch (PortInUseException e) {} >>> try { >>> inputStream = serialPort.getInputStream(); >>> } catch (IOException e) {} >>> try { >>> serialPort.addEventListener(this); >>> } catch (TooManyListenersException e) {} >>> serialPort.notifyOnDataAvailable(true); >>> try { >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, >>> SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> } catch (UnsupportedCommOperationException e) {} >>> readThread = new Thread(this); >>> readThread.start(); >>> } >>> public void run() { >>> try { >>> Thread.sleep(20000); >>> } catch (InterruptedException e) {} >>> } >>> public void serialEvent(SerialPortEvent event) { >>> switch(event.getEventType()) { >>> case SerialPortEvent.BI: >>> case SerialPortEvent.OE: >>> case SerialPortEvent.FE: >>> case SerialPortEvent.PE: >>> case SerialPortEvent.CD: >>> case SerialPortEvent.CTS: >>> case SerialPortEvent.DSR: >>> case SerialPortEvent.RI: >>> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >>> break; >>> case SerialPortEvent.DATA_AVAILABLE: >>> byte[] readBuffer = new byte[20]; >>> try { >>> while (inputStream.available() > 0) { >>> int numBytes = inputStream.read(readBuffer); >>> } >>> System.out.print(new String(readBuffer)); >>> } catch (IOException e) {} >>> break; >>> } >>> } >>> } >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> >> cheers >> YiQi Huang >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From smontgomery at mediaspansoftware.com Wed May 24 10:24:13 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 12:24:13 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: Tod & Joachim, Thanks for the info, that's very helpful. I'll give that a whirl when I move to rxtx 2.1. I'm still using the older 2.0.7 version for now (don't ask), which probably requires the Sun comm.jar, javax.comm.properties and librxtxSerial.jnilib to be in very specific places in each jvm's file hierarchy. From tjarvi at qbang.org Wed May 24 11:59:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 11:59:16 -0600 (MDT) Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: On Wed, 24 May 2006, Sean Montgomery wrote: > Tod & Joachim, > > Thanks for the info, that's very helpful. I'll give that a whirl > when I move to rxtx 2.1. I'm still using the older 2.0.7 version for > now (don't ask), which probably requires the Sun comm.jar, > javax.comm.properties and librxtxSerial.jnilib to be in very specific > places in each jvm's file hierarchy. > You will need comm.jar from Sun then. It must be Sun's version 2.* or older for Linux or Solaris. I assume they have this in download archives. The default offering from Sun is version 3.0. This version currently does not support rxtx. The older version will probably be fine for your needs. -- Trent Jarvi tjarvi at qbang.org From smontgomery at mediaspansoftware.com Wed May 24 12:19:06 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 14:19:06 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: <3939EFB8-11E1-4E3E-A684-5B3C525577CD@mediaspansoftware.com> Yup, that's right, thanks Trent. I've been using these files for quite a while now. Thanks for bringing it up. I almost didn't mention using 2.0.7 because I didn't want to give any new members of the list the wrong idea! :-) On May 24, 2006, at 1:59 PM, Trent Jarvi wrote: > On Wed, 24 May 2006, Sean Montgomery wrote: > >> Tod & Joachim, >> >> Thanks for the info, that's very helpful. I'll give that a whirl >> when I move to rxtx 2.1. I'm still using the older 2.0.7 version for >> now (don't ask), which probably requires the Sun comm.jar, >> javax.comm.properties and librxtxSerial.jnilib to be in very specific >> places in each jvm's file hierarchy. >> > > You will need comm.jar from Sun then. It must be Sun's version 2.* or > older for Linux or Solaris. I assume they have this in download > archives. > > The default offering from Sun is version 3.0. This version > currently does > not support rxtx. > > The older version will probably be fine for your needs. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mark at mdsh.com Wed May 24 15:55:46 2006 From: mark at mdsh.com (Mark Himsley) Date: Wed, 24 May 2006 22:55:46 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <37B0FC4B1F3237321F093ABE@MacMini.local> On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) That's no problem. BUT, do note that the instructions I elaborated on are in the INSTALL file within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone please update the INSTALL file? > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > > , it includes DLLs for Windows and the JAR > > for Java. > > > > Follow the Windows instructions in the INSTALL. > > > > ie > > > > RXTXcomm.jar goes in \jre\lib\ext (under java) > > rxtxSerial.dll goes in \jre\bin > > > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > > C:\Program Files\Java\jre1.5.0_06\lib\ext > > and copy rxtxSerial.dll into > > C:\Program Files\Java\jre1.5.0_06\bin > > > > Yes, it really is that simple. > > > > > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > > > >> I am new to serial port programming, and have no experience on > >> programming java in xp, but my project require me to builld a > >> communication link between xp and a UART device. > >> > >> Most of the information in the web site seems for linux only. > >> including > >> the commands such as export and chmod. How do I install rxtx in xp? > >> > >> cheers > >> YiQi Huang > > > > > > > > -- > > Mark Himsley > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Mark Himsley From tjarvi at qbang.org Wed May 24 16:41:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 16:41:46 -0600 (MDT) Subject: [Rxtx] install rxtx in XP In-Reply-To: <37B0FC4B1F3237321F093ABE@MacMini.local> References: <37B0FC4B1F3237321F093ABE@MacMini.local> Message-ID: On Wed, 24 May 2006, Mark Himsley wrote: > > > On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > >> I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > That's no problem. > > BUT, do note that the instructions I elaborated on are in the INSTALL file > within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone > please update the INSTALL file? > > The INSTALL file may be updated by anyone at anytime. http://rxtx.qbang.org/wiki/index.php/Installation We are moving it to the wiki so end users may put the type of answers they would like to see in. Sometimes it's best if developers don't give what appears to be cryptic answers. You can even put in that jre/lib/ext is not the right place but you don't understand the classpath solution mentioned on the mail-list and then we know what to add. -- Trent Jarvi tjarvi at qbang.org From stramit at gmail.com Wed May 24 21:45:31 2006 From: stramit at gmail.com (Tim Cooper) Date: Thu, 25 May 2006 13:45:31 +1000 Subject: [Rxtx] Accessing Virtual Com Port Message-ID: Hi, I have to develop an application that talks to a virtual com port (in this case com3) which translates any messages sent across a USB cable to a micro. Using C++ I can talk to this com port and I know that it is configured, present, and working. For the application that I am trying to write I want to use RXTX for the communication. My problem is that the configured virtual port (in windows) is not showing up when I do an enumeration over the available ports. The output I get is (com 3 is not present) : Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 PORT FOUND: COM1 PORT FOUND: LPT1 Is there anything that I need to do to make com3 available to RXTX and my application? Timothy Cooper -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060524/c5591648/attachment-0398.html From antonio.luis at iscte.pt Thu May 25 01:39:13 2006 From: antonio.luis at iscte.pt (=?ISO-8859-1?Q?Ant=F3nio_Lopes?=) Date: Thu, 25 May 2006 08:39:13 +0100 Subject: [Rxtx] RXTX on Pocket PC Message-ID: <44755F21.8060103@iscte.pt> Hello everyone, I've been using RXTX to communicate with serial ports in Windows and it's been quite successful. However, I'm now considering porting my application from Windows to Pocket PC but I can't seem to find the RXTX binaries (*.jar and *.dll) to use in Pocket PC. I've been "digging" on the mailing list's archives and also on the web and I can't find these anywhere. Can anyone in this mailing list give me some pointers on this? Where can I find the necessary files and basic installation instructions? Thanks very much for your help. I very much appreciate any help that you can provide me. Regards, -- Ant?nio Lopes @contact: antonio.luis at iscte.pt @work: ADETTI - ISCTE @web: http://antonio.lopes.googlepages.com/home From doug at dupreeinc.com Fri May 26 15:45:50 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Fri, 26 May 2006 14:45:50 -0700 Subject: [Rxtx] rxtx slow startup Message-ID: <4477770E.9010400@dupreeinc.com> Hello, I hope there are people still reading this mailing list. The archive appeared to not have anything new after 4/2005. I was using the commapi from sun for a project where a java application reads data from test equipment connected to the serial port. I had to upgrade the ftdi vcp driver on my pc and the old sun commapi no longer works with hardware flow control. as an experiment I replaced the javax.com with gnu.io in the SerialDemo.java project that was included with the commapi. This compiled fine using JBuilder 2006 and JRE 1.5.0_05. RXTX also works with the latest ftdi drivers so life is wonderful again... almost... When using the commapi jar the SerialDemo program starts in about 1 second on my system. Using the RXTX jar it takes over 56 seconds to start. Has anyone else seen this problem? Is there a workaround to get the startup performance close to the old commapi? The last thing printed to the console before this delay is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks for your time! Doug From yhua537 at cse.unsw.edu.au Sat May 27 05:46:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 21:46:45 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <4477770E.9010400@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> Message-ID: hi Doug The archive hasn't been update for a long time, But people certainly still reading the list. I don't have enough experience to help on your problem, but without any detail about what your problem doing during that 56 seconds, it is hard to target the your question, I think. cheers YiQi On Fri, 26 May 2006, Doug Thistlethwaite wrote: > Hello, > > I hope there are people still reading this mailing list. The archive > appeared to not have anything new after 4/2005. > > I was using the commapi from sun for a project where a java application > reads data from test equipment connected to the serial port. I had to > upgrade the ftdi vcp driver on my pc and the old sun commapi no longer > works with hardware flow control. as an experiment I replaced the > javax.com with gnu.io in the SerialDemo.java project that was included > with the commapi. This compiled fine using JBuilder 2006 and JRE > 1.5.0_05. RXTX also works with the latest ftdi drivers so life is > wonderful again... almost... > > When using the commapi jar the SerialDemo program starts in about 1 > second on my system. Using the RXTX jar it takes over 56 seconds to > start. Has anyone else seen this problem? Is there a workaround to get > the startup performance close to the old commapi? > > The last thing printed to the console before this delay is: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Thanks for your time! > > Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------- Just a student, Still a student ------------------------------- From yhua537 at cse.unsw.edu.au Sat May 27 06:04:26 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 22:04:26 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: Sorry, I don't think you could understand what I mean .I mean this: Without any detail about what your program is doing during that 56 seconds, it is hard for anyone to target the problem. On Sat, 27 May 2006, YiQi Huang wrote: > hi Doug > > The archive hasn't been update for a long time, But people certainly still > reading the list. > > I don't have enough experience to help on your problem, but without any > detail about what your problem doing during that 56 seconds, it is hard to > target the your question, I think. > > cheers > YiQi > > On Fri, 26 May 2006, Doug Thistlethwaite wrote: > >> Hello, >> >> I hope there are people still reading this mailing list. The archive >> appeared to not have anything new after 4/2005. >> >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From jredman at ergotech.com Sat May 27 08:32:02 2006 From: jredman at ergotech.com (Jim Redman) Date: Sat, 27 May 2006 08:32:02 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: <447862E2.4080506@ergotech.com> Doug, Since you mentioned it, we have a system that is also seems slow. From memory (I don't have one of the slow systems around), I'm not sure that it's consistent, it seems that sometimes it may take longer than others. Since it's part of the bootup it hasn't raised a flag and I haven't researched it. The same code runs much faster on other systems, so now you've got me wondering what's different. The slow system boots DSL (http://www.damnsmalllinux.org/) from a compact flash. FC4 is on my desktop where I haven't noticed a slow down. I think that the rxtx code is the same in both cases with lock files disabled. The slow system has a bunch of serial ports defined, including 4 USB serial ports that do not exist - they are not plugged in. Any clues in there? Jim > On Fri, 26 May 2006, Doug Thistlethwaite wrote: >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Sat May 27 10:41:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 May 2006 10:41:54 -0600 (MDT) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447862E2.4080506@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: On Sat, 27 May 2006, Jim Redman wrote: > Doug, > > Since you mentioned it, we have a system that is also seems slow. From > memory (I don't have one of the slow systems around), I'm not sure that > it's consistent, it seems that sometimes it may take longer than others. > Since it's part of the bootup it hasn't raised a flag and I haven't > researched it. > > The same code runs much faster on other systems, so now you've got me > wondering what's different. > > The slow system boots DSL (http://www.damnsmalllinux.org/) from a > compact flash. FC4 is on my desktop where I haven't noticed a slow > down. I think that the rxtx code is the same in both cases with lock > files disabled. > > The slow system has a bunch of serial ports defined, including 4 USB > serial ports that do not exist - they are not plugged in. > > Any clues in there? > rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. When it does this, it will try to open each port and do a timed out read. most systems will not have entries in device if the port is not there. But some minimal systems will just put all the device files there in case hardware is added. The list of devices scanned used to be ~10-20 times longer than it is today. That was getting very slow. I suspect moving the device files not used to a backup directory would increase the enumeration. I'll look into why the mail-list archive is not updating. The last update was about when I thought I 'fixed' the cron jobs. I probably didn't actually fix it but rather moved the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon May 29 19:46:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 May 2006 19:46:47 -0600 (MDT) Subject: [Rxtx] Mail-List Archives are updating. Message-ID: It was pointed out earlier that the archive is dated. This was a missing crontab entry. The list is currently archived by the week on the web page. It is updated once a day. So every 7 days it starts a new link and updates it daily. I've been limited in what I could do while my cable modem was disconnected this last week. rxtx.org is something I do on my own time. The patches and credits will be comming next. Many of these can be seen in bugzilla right now. -- Trent Jarvi tjarvi at qbang.org From doug at dupreeinc.com Tue May 30 11:18:41 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 10:18:41 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: <447C7E71.4080204@dupreeinc.com> Trent, YiQi, and Jim: Thanks to all for the replies and information! I am just back from a long weekend and I am now trying to figure out what I was doing! :) As for more information. First off, this example is being run under windows XP. I am developing test equipment that communicates with a java application via a serial port. I have been using the commapi for several years and have not had a problem. Recently, I have started a design modification that will replace the RS232 connection with a USB port. I am using the ftdi module for prototyping and I discovered that their virtual com port driver was not compatible with the commapi that Sun released. It turns out that it has problems with hardware flow control ( it works on incoming but not outgoing communications). The way I figured this out was by experimenting with the SerialDemo that was included with the Sum commapi. One nice thing about this example is it has the ability to set incoming and outgoing flow control independently. After I installed RXTX into my JBuilder 2006 IDE, I just replaced all all instances of javax.comm with gnu.io and it compiled and runs without a hitch (except for the slow startup). I Paused the JBuilder IDE during this long pause and the last few entries in the stack trace are: testRead() : -1, gnu.io.RXTXCommDriver registerValidPorts() : 255, gnu.io.RXTXCommDriver registerScannedPorts() : 777, gnu.io.RXTXCommDriver This was all initiated by the following call in the programs init routine: Enumeration en = CommPortIdentifier.getPortIdentifiers(); After looking at this, My guess is that Trent is correct in that the delay is in scanning for ports. I guess one solution would be to not scan for ports, though it would be nice to detect what is available on the system. Is there any way to reduce the number of ports scanned by this function in windows XP? Thanks again for your time, Doug Trent Jarvi wrote: >On Sat, 27 May 2006, Jim Redman wrote: > > > >>Doug, >> >>Since you mentioned it, we have a system that is also seems slow. From >>memory (I don't have one of the slow systems around), I'm not sure that >>it's consistent, it seems that sometimes it may take longer than others. >>Since it's part of the bootup it hasn't raised a flag and I haven't >>researched it. >> >>The same code runs much faster on other systems, so now you've got me >>wondering what's different. >> >>The slow system boots DSL (http://www.damnsmalllinux.org/) from a >>compact flash. FC4 is on my desktop where I haven't noticed a slow >>down. I think that the rxtx code is the same in both cases with lock >>files disabled. >> >>The slow system has a bunch of serial ports defined, including 4 USB >>serial ports that do not exist - they are not plugged in. >> >>Any clues in there? >> >> >> > >rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. > >When it does this, it will try to open each port and do a timed out read. >most systems will not have entries in device if the port is not there. >But some minimal systems will just put all the device files there in case >hardware is added. > >The list of devices scanned used to be ~10-20 times longer than it is >today. That was getting very slow. > >I suspect moving the device files not used to a backup directory would >increase the enumeration. > >I'll look into why the mail-list archive is not updating. The last update >was about when I thought I 'fixed' the cron jobs. I probably didn't >actually fix it but rather moved the problem. > >-- >Trent Jarvi >tjarvi at qbang.org > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/86796453/attachment-0395.html From doug at dupreeinc.com Tue May 30 14:36:09 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 13:36:09 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447C7E71.4080204@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com> Message-ID: <447CACB9.1000801@dupreeinc.com> Hello all, I also notice this pause (not as long however) when I call: CommPortIdentifier.getPortIdentifier(PortName); I would think that if I supply the name of the port, it would not have to go through the same discovery process. If you have any ideas of how to get rid of this startup delay, I would really appreciate it. Thanks, Doug Doug Thistlethwaite wrote: > Trent, YiQi, and Jim: > > Thanks to all for the replies and information! I am just back from a > long weekend and I am now trying to figure out what I was doing! :) > > As for more information. First off, this example is being run under > windows XP. I am developing test equipment that communicates with a > java application via a serial port. I have been using the commapi for > several years and have not had a problem. Recently, I have started a > design modification that will replace the RS232 connection with a USB > port. I am using the ftdi module for prototyping and I discovered > that their virtual com port driver was not compatible with the commapi > that Sun released. It turns out that it has problems with hardware > flow control ( it works on incoming but not outgoing communications). > The way I figured this out was by experimenting with the SerialDemo > that was included with the Sum commapi. One nice thing about this > example is it has the ability to set incoming and outgoing flow > control independently. > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup). > > I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are: > > testRead() : -1, gnu.io.RXTXCommDriver > registerValidPorts() : 255, gnu.io.RXTXCommDriver > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > This was all initiated by the following call in the programs init routine: > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > After looking at this, My guess is that Trent is correct in that the > delay is in scanning for ports. I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system. Is there any way to reduce the number of ports scanned by > this function in windows XP? > > Thanks again for your time, > > Doug > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/edaa5c3c/attachment-0395.html From lynn at swcp.com Tue May 30 15:07:18 2006 From: lynn at swcp.com (lynn@swcp.com) Date: Tue, 30 May 2006 21:07:18 -0000 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CACB9.1000801@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: *IF* the name of the port is supplied, we might want to use the preferences mechanism (java.util.prefs) where we could have previously saved the info for the port. We could do a quick check to see that things have not changed before using it. If things have changed (or never been defined) we would do a full port scan and save detected ports in the preferences. This way if the hardware is not changed, you only pay the time penalty one time. just an idea... Lynn Doug Thistlethwaite said: > This is a multi-part message in MIME format. > --------------070808020900080005070500 > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > Content-Transfer-Encoding: 7bit > > Hello all, > > I also notice this pause (not as long however) when I call: > > CommPortIdentifier.getPortIdentifier(PortName); > > I would think that if I supply the name of the port, it would not have > to go through the same discovery process. If you have any ideas of how > to get rid of this startup delay, I would really appreciate it. > > Thanks, > > Doug > > Doug Thistlethwaite wrote: > > > Trent, YiQi, and Jim: > > > > Thanks to all for the replies and information! I am just back from a > > long weekend and I am now trying to figure out what I was doing! :) > > > > As for more information. First off, this example is being run under > > windows XP. I am developing test equipment that communicates with a > > java application via a serial port. I have been using the commapi for > > several years and have not had a problem. Recently, I have started a > > design modification that will replace the RS232 connection with a USB > > port. I am using the ftdi module for prototyping and I discovered > > that their virtual com port driver was not compatible with the commapi > > that Sun released. It turns out that it has problems with hardware > > flow control ( it works on incoming but not outgoing communications). > > The way I figured this out was by experimenting with the SerialDemo > > that was included with the Sum commapi. One nice thing about this > > example is it has the ability to set incoming and outgoing flow > > control independently. > > > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > > all instances of javax.comm with gnu.io and it compiled and runs > > without a hitch (except for the slow startup). > > > > I Paused the JBuilder IDE during this long pause and the last few > > entries in the stack trace are: > > > > testRead() : -1, gnu.io.RXTXCommDriver > > registerValidPorts() : 255, gnu.io.RXTXCommDriver > > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > > > This was all initiated by the following call in the programs init routine: > > > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > > > After looking at this, My guess is that Trent is correct in that the > > delay is in scanning for ports. I guess one solution would be to not > > scan for ports, though it would be nice to detect what is available on > > the system. Is there any way to reduce the number of ports scanned by > > this function in windows XP? > > > > Thanks again for your time, > > > > Doug > > > > --------------070808020900080005070500 > Content-Type: text/html; charset=ISO-8859-1 > Content-Transfer-Encoding: 7bit > > > > > > > > > Hello all,
>
> I also notice this pause (not as long however) when I call:
>
>          CommPortIdentifier.getPortIdentifier(PortName);
>
> I would think that if I supply the name of the port, it would not have > to go through the same discovery process.  If you have any ideas of how > to get rid of this startup delay, I would really appreciate it.
>
> Thanks,
>
> Doug
>
> Doug Thistlethwaite wrote: >
> > Trent, YiQi, and Jim:
>
> Thanks to all for the replies and information!  I am just back from a > long weekend and I am now trying to figure out what I was doing! :)
>
> As for more information.  First off, this example is being run under > windows XP.  I am developing test equipment that communicates with a > java application via a serial port.  I have been using the commapi for > several years and have not had a problem.  Recently, I have started a > design modification that will replace the RS232 connection with a USB > port.  I am using the ftdi module for prototyping and I discovered that > their virtual com port driver was not compatible with the commapi that > Sun released.  It turns out that it has problems with hardware flow > control ( it works on incoming but not outgoing communications).  The > way I figured this out was by experimenting with the SerialDemo that > was included with the Sum commapi.  One nice thing about this example > is it has the ability to set incoming and outgoing flow control > independently.
>
> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup).
>
> I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are:
>
> testRead() : -1, gnu.io.RXTXCommDriver
> registerValidPorts() : 255, gnu.io.RXTXCommDriver
> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>
> This was all initiated by the following call in the programs init > routine:
>
> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>
> After looking at this,  My guess is that Trent is correct in that the > delay is in scanning for ports.  I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system.  Is there any way to reduce the number of ports scanned by > this function in windows XP? 
>
> Thanks again for your time,
>
> Doug
>
>
> > > > --------------070808020900080005070500-- > -- From jredman at ergotech.com Tue May 30 15:42:35 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 30 May 2006 15:42:35 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: <447CBC4B.2080206@ergotech.com> Lynn, If I understand your idea correctly, I don't think that this would work well for, say, USB ports since these can be easily added/removed by the end user. Jim lynn at swcp.com wrote: > *IF* the name of the port is supplied, we might want to use the preferences > mechanism (java.util.prefs) where we could have previously saved the info for > the port. We could do a quick check to see that things have not changed > before using it. If things have changed (or never been defined) we would do a > full port scan and save detected ports in the preferences. > > This way if the hardware is not changed, you only pay the time penalty one time. > > just an idea... > Lynn > > > Doug Thistlethwaite said: > >> This is a multi-part message in MIME format. >> --------------070808020900080005070500 >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >> Content-Transfer-Encoding: 7bit >> >> Hello all, >> >> I also notice this pause (not as long however) when I call: >> >> CommPortIdentifier.getPortIdentifier(PortName); >> >> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process. If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it. >> >> Thanks, >> >> Doug >> >> Doug Thistlethwaite wrote: >> >>> Trent, YiQi, and Jim: >>> >>> Thanks to all for the replies and information! I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :) >>> >>> As for more information. First off, this example is being run under >>> windows XP. I am developing test equipment that communicates with a >>> java application via a serial port. I have been using the commapi for >>> several years and have not had a problem. Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port. I am using the ftdi module for prototyping and I discovered >>> that their virtual com port driver was not compatible with the commapi >>> that Sun released. It turns out that it has problems with hardware >>> flow control ( it works on incoming but not outgoing communications). >>> The way I figured this out was by experimenting with the SerialDemo >>> that was included with the Sum commapi. One nice thing about this >>> example is it has the ability to set incoming and outgoing flow >>> control independently. >>> >>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup). >>> >>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are: >>> >>> testRead() : -1, gnu.io.RXTXCommDriver >>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>> >>> This was all initiated by the following call in the programs init routine: >>> >>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>> >>> After looking at this, My guess is that Trent is correct in that the >>> delay is in scanning for ports. I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system. Is there any way to reduce the number of ports scanned by >>> this function in windows XP? >>> >>> Thanks again for your time, >>> >>> Doug >>> >> --------------070808020900080005070500 >> Content-Type: text/html; charset=ISO-8859-1 >> Content-Transfer-Encoding: 7bit >> >> >> >> >> >> >> >> >> Hello all,
>>
>> I also notice this pause (not as long however) when I call:
>>
>>         >  CommPortIdentifier.getPortIdentifier(PortName);
>>
>> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process.  If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it.
>>
>> Thanks,
>>
>> Doug
>>
>> Doug Thistlethwaite wrote: >>
>> >> Trent, YiQi, and Jim:
>>
>> Thanks to all for the replies and information!  I am just back from a >> long weekend and I am now trying to figure out what I was doing! :)
>>
>> As for more information.  First off, this example is being run under >> windows XP.  I am developing test equipment that communicates with a >> java application via a serial port.  I have been using the commapi for >> several years and have not had a problem.  Recently, I have started a >> design modification that will replace the RS232 connection with a USB >> port.  I am using the ftdi module for prototyping and I discovered that >> their virtual com port driver was not compatible with the commapi that >> Sun released.  It turns out that it has problems with hardware flow >> control ( it works on incoming but not outgoing communications).  The >> way I figured this out was by experimenting with the SerialDemo that >> was included with the Sum commapi.  One nice thing about this example >> is it has the ability to set incoming and outgoing flow control >> independently.
>>
>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >> all instances of javax.comm with gnu.io and it compiled and runs >> without a hitch (except for the slow startup).
>>
>> I Paused the JBuilder IDE during this long pause and the last few >> entries in the stack trace are:
>>
>> testRead() : -1, gnu.io.RXTXCommDriver
>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>
>> This was all initiated by the following call in the programs init >> routine:
>>
>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>
>> After looking at this,  My guess is that Trent is correct in that the >> delay is in scanning for ports.  I guess one solution would be to not >> scan for ports, though it would be nice to detect what is available on >> the system.  Is there any way to reduce the number of ports scanned by >> this function in windows XP? 
>>
>> Thanks again for your time,
>>
>> Doug
>>
>>
>> >> >> >> --------------070808020900080005070500-- >> > > > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From yhua537 at cse.unsw.edu.au Tue May 30 18:10:23 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 31 May 2006 10:10:23 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CBC4B.2080206@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: Doug, In the SerialDemo, it allow us to save the parameters into a file, and use it when your program start up. Would this help? YiQi On Tue, 30 May 2006, Jim Redman wrote: > Lynn, > > If I understand your idea correctly, I don't think that this would work > well for, say, USB ports since these can be easily added/removed by the > end user. > > Jim > > lynn at swcp.com wrote: >> *IF* the name of the port is supplied, we might want to use the preferences >> mechanism (java.util.prefs) where we could have previously saved the info for >> the port. We could do a quick check to see that things have not changed >> before using it. If things have changed (or never been defined) we would do a >> full port scan and save detected ports in the preferences. >> >> This way if the hardware is not changed, you only pay the time penalty one time. >> >> just an idea... >> Lynn >> >> >> Doug Thistlethwaite said: >> >>> This is a multi-part message in MIME format. >>> --------------070808020900080005070500 >>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>> Content-Transfer-Encoding: 7bit >>> >>> Hello all, >>> >>> I also notice this pause (not as long however) when I call: >>> >>> CommPortIdentifier.getPortIdentifier(PortName); >>> >>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process. If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it. >>> >>> Thanks, >>> >>> Doug >>> >>> Doug Thistlethwaite wrote: >>> >>>> Trent, YiQi, and Jim: >>>> >>>> Thanks to all for the replies and information! I am just back from a >>>> long weekend and I am now trying to figure out what I was doing! :) >>>> >>>> As for more information. First off, this example is being run under >>>> windows XP. I am developing test equipment that communicates with a >>>> java application via a serial port. I have been using the commapi for >>>> several years and have not had a problem. Recently, I have started a >>>> design modification that will replace the RS232 connection with a USB >>>> port. I am using the ftdi module for prototyping and I discovered >>>> that their virtual com port driver was not compatible with the commapi >>>> that Sun released. It turns out that it has problems with hardware >>>> flow control ( it works on incoming but not outgoing communications). >>>> The way I figured this out was by experimenting with the SerialDemo >>>> that was included with the Sum commapi. One nice thing about this >>>> example is it has the ability to set incoming and outgoing flow >>>> control independently. >>>> >>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>> all instances of javax.comm with gnu.io and it compiled and runs >>>> without a hitch (except for the slow startup). >>>> >>>> I Paused the JBuilder IDE during this long pause and the last few >>>> entries in the stack trace are: >>>> >>>> testRead() : -1, gnu.io.RXTXCommDriver >>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>> >>>> This was all initiated by the following call in the programs init routine: >>>> >>>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>> >>>> After looking at this, My guess is that Trent is correct in that the >>>> delay is in scanning for ports. I guess one solution would be to not >>>> scan for ports, though it would be nice to detect what is available on >>>> the system. Is there any way to reduce the number of ports scanned by >>>> this function in windows XP? >>>> >>>> Thanks again for your time, >>>> >>>> Doug >>>> >>> --------------070808020900080005070500 >>> Content-Type: text/html; charset=ISO-8859-1 >>> Content-Transfer-Encoding: 7bit >>> >>> >>> >>> >>> >>> >>> >>> >>> Hello all,
>>>
>>> I also notice this pause (not as long however) when I call:
>>>
>>>         >>  CommPortIdentifier.getPortIdentifier(PortName);
>>>
>>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process.  If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it.
>>>
>>> Thanks,
>>>
>>> Doug
>>>
>>> Doug Thistlethwaite wrote: >>>
>>> >>> Trent, YiQi, and Jim:
>>>
>>> Thanks to all for the replies and information!  I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :)
>>>
>>> As for more information.  First off, this example is being run under >>> windows XP.  I am developing test equipment that communicates with a >>> java application via a serial port.  I have been using the commapi for >>> several years and have not had a problem.  Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port.  I am using the ftdi module for prototyping and I discovered that >>> their virtual com port driver was not compatible with the commapi that >>> Sun released.  It turns out that it has problems with hardware flow >>> control ( it works on incoming but not outgoing communications).  The >>> way I figured this out was by experimenting with the SerialDemo that >>> was included with the Sum commapi.  One nice thing about this example >>> is it has the ability to set incoming and outgoing flow control >>> independently.
>>>
>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup).
>>>
>>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are:
>>>
>>> testRead() : -1, gnu.io.RXTXCommDriver
>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>
>>> This was all initiated by the following call in the programs init >>> routine:
>>>
>>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>
>>> After looking at this,  My guess is that Trent is correct in that the >>> delay is in scanning for ports.  I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system.  Is there any way to reduce the number of ports scanned by >>> this function in windows XP? 
>>>
>>> Thanks again for your time,
>>>
>>> Doug
>>>
>>>
>>> >>> >>> >>> --------------070808020900080005070500-- >>> >> >> >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From halbleib at rechnerbetriebsgruppe.de Wed May 31 02:06:16 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 10:06:16 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp Message-ID: <447D4E78.30302@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, I getting an error while reloading my app in tomcat. At the first start everything runs well, but if i reload mit webapp by tomcat manager i get the following error. java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader Is there a possibility to unload the native library rxtxSerial.dll? thx for all help! regards tom -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 b8FT80HQ1xlbDLnRecDANCc= =heb1 -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 02:52:17 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 10:52:17 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D4E78.30302@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> Message-ID: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Hello Tom, To the best of my knowledge it is impossible to unload native libraries once loaded into the JVM. The exception you see stems from the fact, that Tomcat creates a new classloader when you "reload" the weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar is loaded from the session class loader. Try to add RXTXComm.jar to your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. Regards, Joachim On 31.05.2006, at 10:06, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 > b8FT80HQ1xlbDLnRecDANCc= > =heb1 > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From halbleib at rechnerbetriebsgruppe.de Wed May 31 03:28:35 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 11:28:35 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Message-ID: <447D61C3.1030807@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Joachim, I'm still not getting it. How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml-file? Perhaps web.xml? Regards, Tom Joachim Buechse schrieb: > Hello Tom, > > To the best of my knowledge it is impossible to unload native > libraries once loaded into the JVM. The exception you see stems from > the fact, that Tomcat creates a new classloader when you "reload" the > weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar > is loaded from the session class loader. Try to add RXTXComm.jar to > your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. > > Regards, > Joachim > > On 31.05.2006, at 10:06, Tom Halbleib wrote: > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL tzNy+/0iIUfkYYgt1+UT1ko= =pkpY -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 04:03:42 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 12:03:42 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D61C3.1030807@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> <447D61C3.1030807@rechnerbetriebsgruppe.de> Message-ID: -Xbootclasspath/a: is a start option to the java vm. Google is your friend in finding how to modfiy it and what it means: tomcat modifying bootclasspath Regards, Joachim On 31.05.2006, at 11:28, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Joachim, > > I'm still not getting it. > How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml- > file? > Perhaps web.xml? > > Regards, > Tom > > Joachim Buechse schrieb: >> Hello Tom, >> >> To the best of my knowledge it is impossible to unload native >> libraries once loaded into the JVM. The exception you see stems from >> the fact, that Tomcat creates a new classloader when you "reload" the >> weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar >> is loaded from the session class loader. Try to add RXTXComm.jar to >> your bootlclasspath (-Xbootclasspath/a:) and the problem should go >> away. >> >> Regards, >> Joachim >> >> On 31.05.2006, at 10:06, Tom Halbleib wrote: >> >> Hi all, >> >> I getting an error while reloading my app in tomcat. At the first >> start >> everything runs well, but if i reload mit webapp by tomcat manager >> i get >> the following error. >> >> java.lang.UnsatisfiedLinkError: Native Library >> C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in >> another classloader thrown while loading gnu.io.RXTXCommDriver >> Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: >> Native >> Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already >> loaded >> in another classloader >> >> >> Is there a possibility to unload the native library rxtxSerial.dll? >> >> thx for all help! >> >> regards >> >> tom > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL > tzNy+/0iIUfkYYgt1+UT1ko= > =pkpY > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From impakt01 at optusnet.com.au Wed May 31 06:55:42 2006 From: impakt01 at optusnet.com.au (Daren) Date: Wed, 31 May 2006 22:55:42 +1000 Subject: [Rxtx] (no subject) Message-ID: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/ade7ad37/attachment-0395.html From doug at dupreeinc.com Wed May 31 10:19:19 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 31 May 2006 09:19:19 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: <447DC207.3070702@dupreeinc.com> I am not sure what you are saying. The Save parameters menu option saves the current settings (baud, data bits, etc.). The long pause (~60 seconds) is when the application first starts (before loading the saved parameters). This does bring up a question, though I hate this type of kludge approach to getting this library to work... What exactly is a PortIdentifier? Is it always the same? If I stored the results from "CommPortIdentifier.getPortIdentifier(PortName);" in a file, could I use this the next time the program is executed? In this case I am using a virtual com port driver to connect to the device through a USB port. Doug YiQi Huang wrote: >Doug, > >In the SerialDemo, it allow us to save the parameters into a file, and use >it when your program start up. Would this help? > >YiQi > >On Tue, 30 May 2006, Jim Redman wrote: > > > >>Lynn, >> >>If I understand your idea correctly, I don't think that this would work >>well for, say, USB ports since these can be easily added/removed by the >>end user. >> >>Jim >> >>lynn at swcp.com wrote: >> >> >>>*IF* the name of the port is supplied, we might want to use the preferences >>>mechanism (java.util.prefs) where we could have previously saved the info for >>>the port. We could do a quick check to see that things have not changed >>>before using it. If things have changed (or never been defined) we would do a >>>full port scan and save detected ports in the preferences. >>> >>>This way if the hardware is not changed, you only pay the time penalty one time. >>> >>>just an idea... >>>Lynn >>> >>> >>>Doug Thistlethwaite said: >>> >>> >>> >>>>This is a multi-part message in MIME format. >>>>--------------070808020900080005070500 >>>>Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>>>Content-Transfer-Encoding: 7bit >>>> >>>>Hello all, >>>> >>>>I also notice this pause (not as long however) when I call: >>>> >>>> CommPortIdentifier.getPortIdentifier(PortName); >>>> >>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process. If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it. >>>> >>>>Thanks, >>>> >>>>Doug >>>> >>>>Doug Thistlethwaite wrote: >>>> >>>> >>>> >>>>>Trent, YiQi, and Jim: >>>>> >>>>>Thanks to all for the replies and information! I am just back from a >>>>>long weekend and I am now trying to figure out what I was doing! :) >>>>> >>>>>As for more information. First off, this example is being run under >>>>>windows XP. I am developing test equipment that communicates with a >>>>>java application via a serial port. I have been using the commapi for >>>>>several years and have not had a problem. Recently, I have started a >>>>>design modification that will replace the RS232 connection with a USB >>>>>port. I am using the ftdi module for prototyping and I discovered >>>>>that their virtual com port driver was not compatible with the commapi >>>>>that Sun released. It turns out that it has problems with hardware >>>>>flow control ( it works on incoming but not outgoing communications). >>>>>The way I figured this out was by experimenting with the SerialDemo >>>>>that was included with the Sum commapi. One nice thing about this >>>>>example is it has the ability to set incoming and outgoing flow >>>>>control independently. >>>>> >>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>>without a hitch (except for the slow startup). >>>>> >>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>>entries in the stack trace are: >>>>> >>>>>testRead() : -1, gnu.io.RXTXCommDriver >>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>>> >>>>>This was all initiated by the following call in the programs init routine: >>>>> >>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>>> >>>>>After looking at this, My guess is that Trent is correct in that the >>>>>delay is in scanning for ports. I guess one solution would be to not >>>>>scan for ports, though it would be nice to detect what is available on >>>>>the system. Is there any way to reduce the number of ports scanned by >>>>>this function in windows XP? >>>>> >>>>>Thanks again for your time, >>>>> >>>>>Doug >>>>> >>>>> >>>>> >>>>--------------070808020900080005070500 >>>>Content-Type: text/html; charset=ISO-8859-1 >>>>Content-Transfer-Encoding: 7bit >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>>Hello all,
>>>>
>>>>I also notice this pause (not as long however) when I call:
>>>>
>>>>        >>>> >>>> >>> CommPortIdentifier.getPortIdentifier(PortName);
>>> >>> >>>>
>>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process.  If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it.
>>>>
>>>>Thanks,
>>>>
>>>>Doug
>>>>
>>>>Doug Thistlethwaite wrote: >>>>
>>>> >>>>Trent, YiQi, and Jim:
>>>>
>>>>Thanks to all for the replies and information!  I am just back from a >>>>long weekend and I am now trying to figure out what I was doing! :)
>>>>
>>>>As for more information.  First off, this example is being run under >>>>windows XP.  I am developing test equipment that communicates with a >>>>java application via a serial port.  I have been using the commapi for >>>>several years and have not had a problem.  Recently, I have started a >>>>design modification that will replace the RS232 connection with a USB >>>>port.  I am using the ftdi module for prototyping and I discovered that >>>>their virtual com port driver was not compatible with the commapi that >>>>Sun released.  It turns out that it has problems with hardware flow >>>>control ( it works on incoming but not outgoing communications).  The >>>>way I figured this out was by experimenting with the SerialDemo that >>>>was included with the Sum commapi.  One nice thing about this example >>>>is it has the ability to set incoming and outgoing flow control >>>>independently.
>>>>
>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>without a hitch (except for the slow startup).
>>>>
>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>entries in the stack trace are:
>>>>
>>>>testRead() : -1, gnu.io.RXTXCommDriver
>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>>
>>>>This was all initiated by the following call in the programs init >>>>routine:
>>>>
>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>>
>>>>After looking at this,  My guess is that Trent is correct in that the >>>>delay is in scanning for ports.  I guess one solution would be to not >>>>scan for ports, though it would be nice to detect what is available on >>>>the system.  Is there any way to reduce the number of ports scanned by >>>>this function in windows XP? 
>>>>
>>>>Thanks again for your time,
>>>>
>>>>Doug
>>>>
>>>>
>>>> >>>> >>>> >>>>--------------070808020900080005070500-- >>>> >>>> >>>> >>> >>> >>> >>-- >>Jim Redman >>(505) 662 5156 x85 >>http://www.ergotech.com >>_______________________________________________ >>Rxtx mailing list >>Rxtx at qbang.org >>http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > >cheers >YiQi Huang >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/61d4d4c9/attachment-0394.html From impakt01 at optusnet.com.au Wed May 31 17:02:54 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 09:02:54 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Message-ID: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Hi all, I downloaded 2.1.7-pre16 and managed to build it and get it going. I made the changes as suggested by Peter Smith in an old post, by adding his code to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. Still not working, it opens the port at 9600 according to portmon.exe . Has anyone managed to get this going at a custom rate? Here is the post I'm referring to: http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 Thanks, Daren ________________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Daren Sent: Wednesday, 31 May 2006 10:56 PM To: rxtx at qbang.org Subject: [Rxtx] (no subject) Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren From tjarvi at qbang.org Wed May 31 21:44:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 May 2006 21:44:01 -0600 (MDT) Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> References: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Message-ID: On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org From impakt01 at optusnet.com.au Wed May 31 22:06:04 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 14:06:04 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: Message-ID: <200606010406.k51464X2010447@mail03.syd.optusnet.com.au> Trent, I have managed to successfully open the port at this speed using Realterm (available on sourceforge). From memory this uses DLPortIO. Using portmon.exe with realterm, even there it says that the port has opened at 1953. I changed termios.c:560 to dcb->BaudRate = 1953 ; and it still opens the port at 9600. Daren -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Thursday, 1 June 2006 1:44 PM To: RXTX Developers and Users Subject: Re: [Rxtx] custom baud rate win32 On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From smontgomery at mediaspansoftware.com Mon May 1 09:52:28 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 11:52:28 -0400 Subject: [Rxtx] RXTX, Java COMM and Windows Server 2003 on x64 experiences? Message-ID: Just wondering if anybody here has had to deploy RXTX or the javax.comm on Windows Server 2003 machines running on x64 (i.e. Xeon EM64T) and would like to relate how things went. From Sun's site, the Supported System Configurations pages give the options for that system: Java 5.0: - 32-bit Java 5.0 running on the OS in the 32-bit mode - 64-bit Java 5.0 running on the OS in the 64-bit native mode Java 1.4.2: - no options listed for EM64T processors, but potentially the standard 32-bit Java 1.4.2 could run on the OS in 32-bit mode? I guess the two main points of failure would be 1) the JVM itself and 2) the jni components. Make that three: there's gotta be hardware vendor driver support for the OS in the various modes, too. Guess I better go look at Keyspan's website... Thanks in advance for any info anyone might be able to provide. From smontgomery at mediaspansoftware.com Mon May 1 10:18:33 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 12:18:33 -0400 Subject: [Rxtx] Mailing list archive out of date? Message-ID: The mailing list archive at: http://mailman.qbang.org/pipermail/rxtx/ only shows emails through the end of March. Is there a new archive somewhere else? Didn't see anything mentioned on the wiki. From p.cain at phasefale.com.au Mon May 1 22:33:09 2006 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 02 May 2006 14:33:09 +1000 Subject: [Rxtx] RXTX and the Linux kernel. Message-ID: <4456E105.5080106@phasefale.com.au> Hi, First off the problem I am having isn't caused by RXTX itself but I'm hoping someone out there may have some knowledge that may help me. Background: I have an application monitoring a control system through a standard PC serial port which I talk to with rxtx-2.0.5. The application runs on RedHat7.3 kernel version 2.4.18 using Java 1.4. This configuration has been in use for several years and has proved to be stable. But it has become necessary for me to upgrade the OS but I'm running into problems with the serial communications. Its not that the comms don't work on the new OS (its never that simple) the comms work for a variable period of time (sometimes several hours) and then just stop, nothing on the data lines and control lines all indicate that data could flow. The new OS is Ubuntu 5.10 running kernel version 2.6.12. I have installed the OS and software on a PC and had it perform ok, then install the new OS and same software on the very same hardware and experienced the problems of them comms stopping. In the new OS I'm using Java5 to run the app but since I have experience the problem I reverted back to Java1.4 which didn't fix the problem. I've moved the app to a different system RedHat FC3 running 2.6.14 had experienced the problem. Not wanting to go through all the thing I have tried but I have established that it seems to be the 2.6 versions of the kernel that seem to be the problem and not an individual distribution of Linux. I should point out that I am using the same jar and library files for each java and OS combination. So I'm just wondering if anyone has had or heard of problems similar to these ? Or perhaps might know of what changed in the Linux serial driver (something I'm having a hard time establishing). I'm starting to run low on ideas of what to try so any help would be much appreciated. -- Peter Cain Senior Programmer Phasefale Pty Ltd From tjarvi at qbang.org Wed May 3 07:31:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 May 2006 07:31:00 -0600 (MDT) Subject: [Rxtx] Re: Concering ircomm and RXTX In-Reply-To: References: Message-ID: On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From legolas.w at gmail.com Wed May 3 08:46:23 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 19:16:23 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <4458C23F.2000003@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From legolas.w at gmail.com Wed May 3 13:10:57 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 23:40:57 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <44590041.80706@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From Lars.Hennig at wow-portal.com Thu May 4 00:39:15 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Thu, 4 May 2006 08:39:15 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: Message-ID: Hi, I could not find any solution. I therefore decided to to my own native implementation. Allthough it only supports the functions I need, it works pretty well now for me. I think the main problem there is the use of a wrong Windows API function and not setting an timeout. Regards, Lars Hennig W?rth Online World GmbH Tel. (0049)7181-258183 Mob. (0049)160-3522889 Fax. (0049)7940-153299 Lars.Hennig at wow-portal.com Gesendet von: rxtx-bounces at qbang.org 09.04.2006 10:42 Bitte antworten zu RXTX Developers and Users An d.herwald at dsh-elektronik.de, RXTX Developers and Users Kopie Thema Re: [Rxtx] USB Serialport - disconnection problems WV Proj./Teilpr.: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/7b39f374/attachment-0399.html From Pawan.Kharbanda at dot.state.co.us Thu May 4 11:00:58 2006 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Thu, 4 May 2006 11:00:58 -0600 Subject: [Rxtx] Dangling Lock Files Message-ID: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Hi, I have been using RXTX API's for the Serial Communication for quite some time now and for some of the devices we are opening and closing the connection every 2 minutes. This works great for few days and then suddenly I start seeing some "Port in Use Exception" and I see that the Lock files are still in the /var/lock folder after manually removing the lock files it works good for few hours and I see the same problem again. Can somebody explain me the scenarios why I am seeing the dangling Lock files? I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise Servers. Thanks Pawan Kharbanda -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/ba0e9261/attachment-0399.html From tjarvi at qbang.org Thu May 4 14:10:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:10:30 -0600 (MDT) Subject: [Rxtx] Dangling Lock Files In-Reply-To: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> References: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Message-ID: On Thu, 4 May 2006, Kharbanda, Pawan wrote: > Hi, > I have been using RXTX API's for the Serial Communication for quite > some time now and for some of the devices we are opening and closing the > connection every 2 minutes. This works great for few days and then > suddenly I start seeing some "Port in Use Exception" and I see that the > Lock files are still in the /var/lock folder after manually removing the > lock files it works good for few hours and I see the same problem again. > Can somebody explain me the scenarios why I am seeing the dangling Lock > files? > > I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise > Servers. Hi Pawan The next time it happens, look in the lockfile. There will be a pid. ps aux |grep 'pid' I think you will see that the application is still running for some reason. RXTX does a kill -0 on the pid to see if its alive. If not, it will remove the lockfile. So I suspect the previous program did not exit as you expected. -- Trent Jarvi tjarvi at qbang.org From Scott.Hughes at dalsemi.com Thu May 4 14:23:11 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 4 May 2006 15:23:11 -0500 Subject: [Rxtx] Wiki instructions... Message-ID: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire demo apps, when I stumbled across this tip on the wiki to add yourself to the uucp group: It may be simpler to just run usermod -G uucp jarvi Taken from: http://rxtx.qbang.org/wiki/index.php/Installation This does not work as advertised. I should have read the man page for usermod before I tried that out. If there are any groups which are not listed after the -G switch, the user is removed from those groups. On Ubuntu, this is bad... I removed myself from the Admin group, which removed my sudo priviledges. Ubuntu has no root account, so I've disabled the only account which could fix it. Anyone know of a good workaround? Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor From tjarvi at qbang.org Thu May 4 14:32:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:32:09 -0600 (MDT) Subject: [Rxtx] Wiki instructions... In-Reply-To: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> Message-ID: On Thu, 4 May 2006, Scott Hughes wrote: > I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire > demo apps, when I stumbled across this tip on the wiki to add yourself to > the uucp group: > > It may be simpler to just run > > usermod -G uucp jarvi > > Taken from: > http://rxtx.qbang.org/wiki/index.php/Installation > > This does not work as advertised. I should have read the man page for > usermod before I tried that out. If there are any groups which are not > listed after the -G switch, the user is removed from those groups. On > Ubuntu, this is bad... I removed myself from the Admin group, which removed > my sudo priviledges. Ubuntu has no root account, so I've disabled the only > account which could fix it. > > Anyone know of a good workaround? > Yikes This will get your permissions back: in grub/lilo/.. pass the following option to the kernel init=/bin/sh You are now root. when it boots, mount -o remount,rw / add yourself to the groups, reboot to get normal init going. Thats about all I can think of without sudo/root. -- Trent Jarvi tjarvi at qbang.org From Gettings at earth.utah.edu Thu May 4 14:41:22 2006 From: Gettings at earth.utah.edu (Paul Gettings) Date: Thu, 4 May 2006 14:41:22 -0600 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <20060504204122.GA6534@earth.utah.edu> When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get messages on stdout from the JVM: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 As the only change was the version of RXTX (from 2.1.6), I am unsure why the messages suddenly appeared. Anyone know how to get rid of them? Thanks. -- 101 USES FOR A DEAD MICROPROCESSOR (23) Dead cat brush From mmester at sps.edu Mon May 1 21:22:28 2006 From: mmester at sps.edu (Michael Mester) Date: Mon, 1 May 2006 23:22:28 -0400 Subject: [Rxtx] Windows PortInUseException Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> I'm trying to get simple serial communication going with RxTx under Windows XP. I can enumerate the ports fine, but I always run into problems when I try to open one. I get a PortInUseException, but the owner application is "Unknown" and the port is never open. I've tried this on several different systems and all of them give the same behavior. The only thing I can thiunk of that might be causing the problem is that fact that I had to put the serial .dll file in system32 instead of the reccommended folder, because it didn't work in the folder the documentation gives. The library loads fine, though, so I'm not sure whether that makes sense, and I don't know how to fix it anyway. Any help is greatly appreciated. Below is the output of the program, right up to the PortInUseException and the NullPointerException it causes (because the serial port object is not instantiated). C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI Starting GPSTalkerGUI... Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 gnu.io.PortInUseException: Unknown Application Exception in thread "main" java.lang.NullPointerException at GPSTalkerGUI.(GPSTalkerGUI.java:102) at GPSTalkerGUI.main(GPSTalkerGUI.java:161) Again, thank you very much for any help you can give. From lshellman at qwest.net Wed May 3 01:38:34 2006 From: lshellman at qwest.net (Lucious Shellman) Date: Wed, 03 May 2006 01:38:34 -0600 Subject: [Rxtx] Help needed: Project using parallel port Message-ID: <1146641914.8337.14.camel@localhost.localdomain> I was looking for a way to access the parallel port on a PC using Java. Searching the Internet, I came across this site (rxtx.org). What I am trying to do is detect logic levels from a TTL logic IC on the parallel port. I am not trying to do classic parallel port communication. I just want to detect whether a line(s) is (are) high or low. I am using Windows 98. Can rxtx be used to do this? If yes, is there a tutorial for using rxtx posted on the Internet that someone can direct me to. If you need more information, feel free to e-mail me. Unfortunately for me, I need the information ASAP. Thanks. lshellman at qwest.net From webmaster at egyhelp.com Wed May 3 18:43:39 2006 From: webmaster at egyhelp.com (Mohamed Samy) Date: Thu, 4 May 2006 02:43:39 +0200 Subject: [Rxtx] RE: Concering ircomm and RXTX In-Reply-To: Message-ID: <20060503184362.SM01044@Geek> Hey, I issue the command "modprobe ircomm-tty" yet no ttyircomm appears, while the ircomm appear by "modprobe ircomm" so forgive me but I am bit lost. Even searching google for the keyword "ttyircomm" only returns 3 matches. So any way I can start the ttyircomm???? Thanks a lot. -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Wednesday, May 03, 2006 3:31 PM To: Mohamed Samy; rxtx at qbang.org Cc: taj at www.linux.org.uk Subject: Re: Concering ircomm and RXTX On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 4 15:49:49 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 15:49:49 -0600 (MDT) Subject: [Rxtx] Windows PortInUseException In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> Message-ID: On Mon, 1 May 2006, Michael Mester wrote: > > I'm trying to get simple serial communication going with RxTx under > Windows XP. I can enumerate the ports fine, but I always run into > problems when I try to open one. I get a PortInUseException, but the > owner application is "Unknown" and the port is never open. I've tried > this on several different systems and all of them give the same > behavior. The only thing I can thiunk of that might be causing the > problem is that fact that I had to put the serial .dll file in system32 > instead of the reccommended folder, because it didn't work in the folder > the documentation gives. The library loads fine, though, so I'm not sure > whether that makes sense, and I don't know how to fix it anyway. Any > help is greatly appreciated. Below is the output of the program, right > up to the PortInUseException and the NullPointerException it causes > (because the serial port object is not instantiated). > > C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI > Starting GPSTalkerGUI... > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > gnu.io.PortInUseException: Unknown Application > Exception in thread "main" java.lang.NullPointerException > at GPSTalkerGUI.(GPSTalkerGUI.java:102) > at GPSTalkerGUI.main(GPSTalkerGUI.java:161) > Perhaps you are trying to open the port twice in your code? rxtx does open the ports, do a timed out read and then close the ports during enumeration. I think the port is being opened fine. The Unknown Application is always reported. On linux, there is some code that finds the actual application but on windows, its always unknown. If the port enumeration is returning the ports you expect, rxtx has opened the port and closed it with success. The port should open. There is also example code in the contrib directory that comes with rxtx source that has examples you can modify to work. -- Trent Jarvi tjarvi at qbang.org From Christian.Klemke at t-online.de Thu May 4 23:37:23 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Fri, 5 May 2006 07:37:23 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu> Message-ID: <004f01c67005$fc72fee0$016a10ac@NB600> Hi Paul, I was wondering about the same question some days ago and took a look at the source files. Unfortunately, I found that you can only get rid of that messages by altering and recompiling the Java code. There is a final static boolean variable called "devel" in the file "RXTXCommDriver.java" which is set to "true". This constellation causes the output after the native libraries have been loaded. No mechanism exists to suppress them otherwise :-(. Trent, does that mean that 2.1.7 is still officially a "development" version ? When will this value be changed to "false" by default ? With 2.1.8 ? It would be nice to provide a means to suppress such messages besides that static flag (maybe by setting a property called "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The output can indeed by annoying, especially when used with console applications, where the message potentially appears "in the middle" of your own output. Another possibility would be not to use System.out directly, but instead some PrintStream field which is initially set to System.out but can programatically be changed. That would allow for any kind of redirection or suppression by implementing appropriate user-defined PrintStream subclasses and making RXTX use that stream. What do you think ? Best regards, Christian ----- Original Message ----- From: "Paul Gettings" To: Sent: Thursday, May 04, 2006 10:41 PM Subject: [Rxtx] RXTX causing stdout messages > When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get > messages on stdout from the JVM: > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > As the only change was the version of RXTX (from 2.1.6), I am unsure > why the messages suddenly appeared. Anyone know how to get rid of > them? > > Thanks. > > -- > 101 USES FOR A DEAD MICROPROCESSOR > (23) Dead cat brush > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri May 5 06:09:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 06:09:46 -0600 (MDT) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <004f01c67005$fc72fee0$016a10ac@NB600> References: <20060504204122.GA6534@earth.utah.edu> <004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: On Fri, 5 May 2006, Christian Klemke wrote: > Hi Paul, > > I was wondering about the same question some days ago and took a look at the > source files. Unfortunately, I found that you can only get rid of that > messages by altering and recompiling the Java code. There is a final static > boolean variable called "devel" in the file "RXTXCommDriver.java" which is > set to "true". This constellation causes the output after the native > libraries have been loaded. No mechanism exists to suppress them otherwise > :-(. > > Trent, does that mean that 2.1.7 is still officially a "development" version > ? When will this value be changed to "false" by default ? With 2.1.8 ? It > would be nice to provide a means to suppress such messages besides that > static flag (maybe by setting a property called > "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The > output can indeed by annoying, especially when used with console > applications, where the message potentially appears "in the middle" of your > own output. Another possibility would be not to use System.out directly, but > instead some PrintStream field which is initially set to System.out but can > programatically be changed. That would allow for any kind of redirection or > suppression by implementing appropriate user-defined PrintStream subclasses > and making RXTX use that stream. What do you think ? > A patch for using properties would be accepted I'm sure. The reason the default is to display the message is not related to the development state of rxtx anymore. The problem is that people first using rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. The message prevents a great deal of email thats easily explained by the message. I question if we should support rxtx 2.0 at all anymore. If you post a patch in bugzilla, we'll put it into CVS this weekend. we'll be going through and doing such things anyhow. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri May 5 13:23:56 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 13:23:56 -0600 (MDT) Subject: [Rxtx] How to read from RxTx parallel port in Win XP In-Reply-To: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> References: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> Message-ID: On Thu, 27 Apr 2006, Worsley, Bob (Development Engineer) wrote: > I'm sorry if this is a dumb question, but I didn't find the answer in > the archives. > > I'm using the RxTx binaries for Windows on a reasonably current notebook > PC running Windows XP. I can send stuff to a printer on the parallel > port (LPT1), but I can't get anything back. > > I wrote a class that has the methods listed below. I write some data to > the printer with the "write" method and then try to read a response > using the "read" method, but I never get any data. I'd greatly > appreciate any help you can give! > > Bob Worsley > bobwoyid2 at yahoo.com > > > > > private ParallelPort parallelPort = null; > private RXTXCommDriver parallelPortDriver = null; > > > public boolean initialize() throws IOException { > if (parallelPort != null) { > return false; // Already initialized > } > > // Create the parallel port; > parallelPortDriver = new RXTXCommDriver(); > parallelPort = > (ParallelPort)parallelPortDriver.getCommPort(address, > CommPortIdentifier.PORT_PARALLEL); > > // Set the parallel port parameters. > try { > parallelPort.enableReceiveTimeout(READ_TIMEOUT); > parallelPort.disableReceiveFraming(); > parallelPort.disableReceiveThreshold(); > //parallelPort.setMode(mode); !!!!errors > } catch (UnsupportedCommOperationException e) { > throw (new IOException("Parallel port with address '" + > address > + "' cannot be configured as specified")); > } > > return true; > } > > > > public void write(final byte[] bytes) throws IOException { > initialize(); > while (busyReading) { > Thread.yield(); > } > busyWriting = true; > if (bytes.length < 1) { > return; > } > OutputStream outputStream = parallelPort.getOutputStream(); > outputStream.write(bytes); > outputStream.flush(); > outputStream.close(); > Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); > busyWriting = false; > } > > > public byte[] read() throws IOException { > > // Read up to MAX_BYTES bytes. > initialize(); > while (busyWriting) { > Thread.yield(); > } > busyReading = true; > byte[] buff = new byte[MAX_BYTES_READ]; > InputStream inputStream = parallelPort.getInputStream(); > // This read blocks until input data is available > int bytesRead = inputStream.read(buff); > inputStream.close(); > // If no data read, create empty array > if (bytesRead == -1) { > bytesRead = 0; > } > byte[] deviceBytes = new byte[bytesRead]; > System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); > if (bytesRead > 0) { > Debug.p("PPIOP.read - got data: '" + new > String(deviceBytes) + "'"); > } > busyReading = false; > return deviceBytes; > } > Hi Bob I've only used rxtx to test a hello world page printing but there are others that have used it. PPIOP? hmm what is this? :) The rxtx parallel support is behind the serial support but should be OK. As you note, the setting of modes is not supported. rxtx uses what is provided when the port is open. Are your asserting the pin for the printer being online? I suspect what often happens is people try to just use the data pins but the C API rxtx uses wants the printer to be online. There should be some posts relating to this in the rxtx mail-list archive. Some APIs are probably reading and writing from the port address (also suggested in your code as something you are looking at). RXTX currently uses a higher level C/C++ API for port access. This can still work if the API thinks the 'printer' is there. -- Trent Jarvi tjarvi at qbang.org From agrodellic at gmail.com Sat May 6 08:39:40 2006 From: agrodellic at gmail.com (Leigh Stewart) Date: Sat, 6 May 2006 10:39:40 -0400 Subject: [Rxtx] sun commapi 3 Message-ID: I think I read here: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html that rxtx-2.0 is basically fracked for now? Does anyone know of a workaround? ie can i somehow get an older version of sun's comm api and use that (not easy to find)? i mean 2.0 must be working for someone...how is it being tested. 2.1 isnt working for me....im getting nasty native exceptions etc, which is why im so set on 2.0... any ideas? From tjarvi at qbang.org Sun May 7 15:40:27 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 7 May 2006 15:40:27 -0600 (MDT) Subject: [Rxtx] sun commapi 3 In-Reply-To: References: Message-ID: On Sat, 6 May 2006, Leigh Stewart wrote: > > 2.1 isnt working for me....im getting nasty native exceptions etc, > which is why im so set on 2.0... any ideas? > Hi Leigh What native exceptions are you seeing? Which OS? The native code is almost identical between rxtx 2.0 and 2.1. Only the names have been changed to protect the inocent. :) ie: javax_comm_... vs gnu_io_... So the odds are very likely that even if you do find commapi 2.0 and get it installed, you will run into the same error. It would be better to just find and fix the problem. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Mon May 8 10:47:20 2006 From: mail at willicon.de (WILLICon) Date: Mon, 08 May 2006 18:47:20 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 Message-ID: <445F7618.3070303@willicon.de> Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/ef37e8ec/attachment-0399.html From tjarvi at qbang.org Mon May 8 16:14:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 May 2006 16:14:51 -0600 (MDT) Subject: [Rxtx] Screenshot of Application using RXTX (fwd) Message-ID: Just though someone may end up searching for 0x0D and 0x0A. Here are the details from his system. SuSE Linux 10.0 (x86_64) Kernel 2.6.13-15.8 j2se 1.4.2_11 (i586) Sun: comm3.0_u1 rxtx: rxtx-2.1-7 ---------- Forwarded message ---------- Date: Sat, 6 May 2006 20:01:46 +0200 From: Michael Poppitz To: taj at www.linux.org.uk Subject: Screenshot of Application using RXTX Hi Trent, the rxtx package works like a charm. Sun's package seemed to replace all 0x0D with 0x0A in received data on my Linux box, which is really annoying when transfering binary data. But rxtx came and saved the day - and turned out to be a lot more convenient as it does not require a configuration file. I use it for connecting to a home made logic analyzer. (http://www.sump.org/projects/analyzer/) Thanks for your great job, Michael -------------- next part -------------- A non-text attachment was scrubbed... Name: la_client.png Type: image/png Size: 16592 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/45494fbb/la_client-0399.png From tjarvi at qbang.org Tue May 9 14:56:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 May 2006 14:56:05 -0600 (MDT) Subject: [Rxtx] RXTX javax.comm: which one to install? In-Reply-To: <20060509161742.43547.qmail@web53814.mail.yahoo.com> References: <20060509161742.43547.qmail@web53814.mail.yahoo.com> Message-ID: On Tue, 9 May 2006, Adenilson Cavalcanti wrote: > Dear Trent Jarvi > > I'm trying to write a small Java app running in linux that interfaces with a device connected to serial port. > > I do have some questions about RXTX and javax.comm state of affairs, since I'm new to Java programming (used to program in plain old C writting to devices using termios and open/write/read syscalls, but this is another story). > > I ask you the favor to clarify this issues (if possible...): > > a) Sun offers to download a file (comm3.0_u1_PUTAUNIXVERSION.zip) which does contain .so files. Does it work out of box? > > b) Case negative, its there that we should use 'librxtx*.so' provided by your site? > > c) Sun's comm3 API version does work with which version of rxtx? > > I already searched google and read documentation available in rxtx site ("Java Comm Serial API How-to") but still have this issues unsolved. Any help will be appreciated. > > Best regards > > Adenilson Hi Adenilson, RXTX does not currently support javax.comm in Sun's CommAPI 3.0. I would recommend using package gnu.io provided by rxtx 2.1. -- Trent Jarvi tjarvi at qbang.org From chris.develder at intec.ugent.be Wed May 10 08:45:40 2006 From: chris.develder at intec.ugent.be (Chris Develder) Date: Wed, 10 May 2006 16:45:40 +0200 Subject: [Rxtx] rxtx troubles on ARM Message-ID: <4461FC94.6040909@intec.ugent.be> Hi all, Sorry to bother you, but I don't seem to get RXTX working on an ARM processor (xscale ixp 425, big endian). I managed to crosscompile the rxtx libs and moved it over to the ARM. Using jamvm (which is the only open source java VM we got working on the ARM), I get the following error result when running SimpleRead from Sun's javax.comm examples (commapi\examples\Simple\SimpleRead) -- see bottom of mail for complete output: "java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver" However, output shows that the RXTXCommDriver code is accessible (cf. debug and devel output of lib versions). So it doesn't seem to be a missing lib/jar issue. The error happens before RXTXCommDriver.initialize() is called, since the first line there is System.out.println("RXTXCommDriver:initialize()"); Any ideas? Cheers, Chris ---------------------------- [root at xxx(ttyp1) /work/cdvelder/xscale/test]# jamvm -Djava.library.path=/work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/jre/lib/arm -classpath /work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/lib/ext/RXTXcomm.jar:./comm.jar:. SimpleRead RXTXCommDriver {} Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTXCommDriver: Jar version = RXTX-2.1-7 native lib Version = RXTX-2.1-7 java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver gnu/io/RXTXCommDriver at javax.comm.CommPortIdentifier.loadDriver (CommPortIdentifier.java:239) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:109) at SimpleRead.main (Unknown Source) java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive (Native Method) at com.sun.comm.Portmapping.registerCommPorts (Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase (Portmapping.java:100) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:138) at SimpleRead.main (Unknown Source) From joachim at buechse.de Fri May 12 00:44:48 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 08:44:48 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) Message-ID: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Good day, I guess that only a selected few (hi Trent) will be able to answer this question, but the answer might be interesting for anyone trying to debug or understand the code. Apparently the MonitorThread is started and stopped in RXTXPort.addEventListener and RXTXPort.removeEventListener. This would indicate that (originally?) the MonitorThread is only required when there is an EventListener. However the MonitorThread is also started in the RXTXPort constructor, which could mean that RXTX won't work at all if it isn't there. It seems to me, that if anyone would add an event listener and later on remove it, he could potentially wreak the port. Because the second action would kill the MonitorThread. For the moment I am only trying to understand the role of and idea behind the MonitorThread. But of course there is a deeper reason thor my question: If the MonitorThread needs to exist anyway, it could be the thread that cleans up the port (ie calls nativeClose) - this would eliminate (a further) problem I am seeing with some USB drivers on Mac OSX. (Close blocks (after releasing the tty, but still) in the USB driver if the device is "not responding"). Greetings, Joachim From tjarvi at qbang.org Fri May 12 07:10:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 12 May 2006 07:10:59 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Fri, 12 May 2006, Joachim Buechse wrote: > Good day, > > I guess that only a selected few (hi Trent) will be able to answer > this question, but the answer might be interesting for anyone trying > to debug or understand the code. > > Apparently the MonitorThread is started and stopped in > RXTXPort.addEventListener and RXTXPort.removeEventListener. This > would indicate that (originally?) the MonitorThread is only required > when there is an EventListener. However the MonitorThread is also > started in the RXTXPort constructor, which could mean that RXTX won't > work at all if it isn't there. > > It seems to me, that if anyone would add an event listener and later > on remove it, he could potentially wreak the port. Because the second > action would kill the MonitorThread. > > > For the moment I am only trying to understand the role of and idea > behind the MonitorThread. But of course there is a deeper reason thor > my question: > > If the MonitorThread needs to exist anyway, it could be the thread > that cleans up the port (ie calls nativeClose) - this would eliminate > (a further) problem I am seeing with some USB drivers on Mac OSX. > (Close blocks (after releasing the tty, but still) in the USB driver > if the device is "not responding"). > Hi Jaochim Before commapi, rxtx did not support events. You could read, write and change port settings. The MonitorThread was added as an afterthought to support commapi events. So the way things are now his historical spaghetti not a well devised plan. It is my opinion that the MonitorThread should exist as long as the port is open. The odd starting of the thread in the constructor and addEventListener was just to get past the obvious problem of people using the port without adding listeners. -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Fri May 12 07:59:50 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 15:59:50 +0200 Subject: [Rxtx] MonitorThread -> ChangeRequest In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: <2B1E508C-8CEE-4AB7-914D-E7BA25C871A2@buechse.de> In this case I suggest removing the starting/stopping of MonitorThread in addEventListener / removeEventListener. This should not affect existing projects. On 12.05.2006, at 15:10, Trent Jarvi wrote: > It is my opinion that the MonitorThread should exist as long as the > port > is open. The odd starting of the thread in the constructor and > addEventListener was just to get past the obvious problem of people > using > the port without adding listeners. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Fri May 12 11:43:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 19:43:21 +0200 Subject: [Rxtx] Spring Cleaning - some suggestions Message-ID: The current implementation of RXTX contains quite a lot of code that will break if it is used from several threads (especially on a multi processor machine). I think it would be nice to clean this up. I suggest the following changes (which keep the current semantics and should not influence existing projects in a negative way): - InterruptedException will never be ignored or reset - read methods will be protected with a Monitor - write methods will be protected with a (separate) Monitor - close() sets the read and write monitors into a "closed" state which will lead to IOExceptions for any following call to RXTXPort.read/write. - close() will wait a finite amount of time (maybe 500ms) for the release of the read and write monitors after that, it will trigger the closing of the file descriptor to abort any pending read or write. - close() will not call close(file_desc). Instead it will "interrupt" (ie set a flag and then, pthread_kill(ABRT)) the MonitorThread, the MonitorThread will call close(file_desc). - the monitors are properly released in a finally block the try of which starts directly after obtaining the monitor. - finally will not call close(file_desc) it will only "interrupt" the MonitorThread (see above) - the native-code (esp read) does not use SA_RESTART but checks Thread.interrupted() when it receives a SIGNAL (ie system call returns with EINTR or other signalling method). The read/write monitors will be allocated from a factory whose mode can be set to fast/normal/advanced. In fast-mode it will create "non thread safe, non synchronized" pseudo-monitors. In default mode, the monitors will store the owning thread. In "advanced" mode setting the monitors into closed state will "interrupt()" threads which are blocked in a native read/write. {Reasoning close behaviour: Calling close on a file descriptor in Windows unblocks any read() or write() on the same file descriptor with an error. On Solaris < 2.7 and MacOS X however the close() will/ can block - until the read or write have finished:-(( Even the JDK people have trouble with this. I dont know how Linux reacts in this case. The best practice for BSD/Solaris is to send a signal to the thread which will usually unblock the read/write with an EINTR - this however is not guarenteed as it also depends on the device driver. So the only resolution that will certainly not block the thread calling RXTXPort.close() (which will often enough be the AWT event dispatcher or the VM finalizer thread) is to call close(fd) from another thread.} {Reasoning read behaviour: It is rather uncommon to receive a signal while reading or writing - it will happen, but checking Thread.interrupted() when it happens will not degrade performance. The checking of Thread.interrupted() can be handled by returning to Java and potententially reentering into the native code if the thread was not interrupted or by calling back into the VM from the native code. On top of this, many functions like read(byte[]) or read(byte [], int, int) are allowed to return less than the requested amount of data. Only int read() is a bit more tricky. } [Trent: From the code I can tell, that you experimented quite a bit with signals. Do you know if the Java Thread.interrupt() triggers a unix signal on Linux/Solaris? If so, which one?? References: - http://java.sun.com/docs/hotspot/VMOptions.html - http://www.hp.com/products1/unix/java/infolibrary/prog_guide/ signals.html ] On OS X (hotspot client jdk-1.4.2) I did not see any signal propagated to the SELECT of the event_loop/MonitorThread (ie no EINTR) when I call monThread.interrupt(). This is a pitty, but thats the way it is. I simply assume this is true for most system calls. How to handle this? Of course it would be possible to install/ deinstall a specific signal handler before/after every native read and to natively send an ABRT signal if RXTXPort.close is called. A more elegant solution might be to have an additional "signaling" socket which is always included in the SELECT. Or the simplest solution: cap the timeout of the select to 500 ms (the loop around it exists already) after every timeout check the Thread.interrupted() flag. From a performance perspective this should be completely invisible... On the other hand, all write() calls need to be preceeded by a SELECT as well, to avoid running into a blocking write. Best regards, Joachim From lyon at docjava.com Sat May 13 05:54:52 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 13 May 2006 07:54:52 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Dmitry suggests that we acquire an implementation of a serial port reference, use it, then release it (i.e., check it back in). Joachim says that making serial ports thread friendly might be a good idea. This is a good idea. The design pattern that is close to this idea is the "Object Pool Design Pattern". # Object Pool Manage the reuse of objects for a type of object that is expensive to create or only a limited number of a kind of object can be created. It has been described at: http://www.developer.com/java/ent/article.php/626171 and in Marks' book, Patterns in Java, Volume 1. However, the Object Pool is intended to pool objects so that each object is just like every other object. The intent of the Parametric Singleton is to enable others to access the same resource at the same time (as long as the same parameters were used in construction). It sounds like we need a NEW Design Pattern (Oh no, Doug is doing it again!). Yes friends, you got me on a role (roll) :) If you like design patterns, you can thank me later. If you don't like design patterns, blame Dmitry, it was his idea ;) And Dave, thanks for the feedback on Singleton abuse. It has led me to change the way I think about application contexts, which we will see, below. We need (drum roll please): The Parametric Object Pool Design Pattern (POP) By Douglas A. Lyon ABSTRACT The goal of the Parametric Singleton design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values, in a given context. In comparison, the goal of the POP design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values and that only one reference to the class is checked out at a time, in a given context. A context is a namespace for holding identifiers during execution. In Java, A context can be changed in any of several ways. For example, creation of a new class loader, the deserialization of an old POP or the creation of a new process all create a new namespace. The POP Design Pattern combines the Parametric Singleton Design Pattern with the check out mechanism of the Object Pool Design Pattern. This enables unique creation of instances of a class. These instances are cached in a table. When a clients asks for an instance with these parameters, the cache is checked. If the instance is not in the cache it is created. If the instance is available, the clients checks out the instance. A reference is left to the clients that checked out the instance. The POP has the role of creating objects uniquely, from parameters. It also has the role of keeping track of which clients has checked out a given object. This is just like a library keeping track of who borrowed a book. If a resource is left unavailable in a system, a deadlock can occur. Deadlock debugging is facilitated by mapping a resource to the clients that have checked it out. We apply our POP Design Pattern to the retrieval of serial ports. The goal of our system is to make sure that serial ports are checked out to only one client at a time, and that they be checked back in when the client is done. The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. Users are discouraged from calling this the Parametric Object Oriented Pool (POOP). Introduction The intent of the POP Design Pattern is to ensure that a class has only one instance for a given set of parameter values. It also provides a point of access that is global to a given context. The POP uses the Singleton Design Pattern to ensure that there is only one POP, in the given context. The POP DP is responsible for checking out a reference to a given instance, and keeping track of that instance. The instance is responsible for sharing that instance. POP requires that users of the DP implement an interface that enables a recall facility. Thus, if there is a contention for a consumed resource, the deadlock can be resolved in an orderly fashion. Motivation A system cannot tolerate multiple instances of some classes with identical parameters used by different instances at the same time. For example, you cannot have two instances use the same serial port, at the same time. You cannot have two instances that are trying to listen to the same socket connection. You cannot have two instances writing to the same file structure at the same time. Further, once a serial port is checked out by a client, it is assigned to the client. This is like the spin-lock service provided by the operating system, only in the application layer. Naturally, deadlock will occur if a resource is not released, therefore the client of the resource is tracked. Recalling a resource is required for the POP DP by virtue of the implementation of an interface. The policy on how to break a deadlock (by honoring the recall) is application specific. As the operating system is often thought of as the arbiter of consumed resources (i.e., tape drives, serial ports, etc.) we frequently leave it to an operating system implementation to resolve these contention issues. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on naming conventions (which are not well standardized). The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. The POP Design Pattern can take on the role of the peer method mapper that homogenizes the API for different operating environments. That is, it can wrapper the different locking mechanisms used in different operating systems. POP that is responsible for keeping track of the instances created and the client that has checked them out. The POP Design Pattern is implemented using the Singleton Design Pattern. In Java, the POP implementation is declared final, so that it cannot be subclassed. The class also has a private constructor, so that other classes cannot instance it. The new design pattern is called the POP design pattern and it provides a way to check out and create instances with given parameters. Applicability Use the POP Design Pattern when: 1. There must be exactly one instance of a class with the given parameters in a given context. 2. The instances must be accessible to clients from a well-known access point. 3. The instances are reusable. 4. Only one client can check out an instance at a time. Structure Insert UML diagram here. Participants The POP Clients that need instances 1. The POP defines an instance upon request from a client, if, and only if, the instance does not already exist. 2. The POP returns the instance to the client. 3. The POP is responsible for creating unique instances from given parameters. 4. The POP is responsible to recalling instances from clients. Collaborations Clients obtain a reference to a POP instance only through the singleton design pattern. If the POP instance is left in an improper state (e.g., the serial port was left open) it is NOT the role of the POP to close the IO port. However, the POP can be requested to get the instance released. Nor is it the role of the POP Design Pattern to open the port. That role is delegate to some other part of the system. Further, it is the role of the POP Design Pattern to check out resources. However, it is still possible to have, multiple threads that have multiple references to the same resource at the same time. Checkout and resource requests are MUTEX locked (i.e., synchronized). Consequences The POP Design Pattern has several benefits: 1. Controlled access to parametrically defined instances. Since the POP encapsulates its instances, there is some limited control over how and when clients access it. 2. Reduced name space. The POP pattern avoids global variables that store instances created from the same parameter. Implementation Here are implementation issues to consider when using the POP pattern: 1. Unique mapping of parameters. The POP pattern requires that there be a mean to isomorphically map the parameter space into the instance space and back again. 2. Ensure unique instances. The POP pattern makes unique instances from parameters, and it does so only once. 3. Cache instances for fast retrieval. The POP must be able to look up instances, given some set of parameters, and do so from some data structure. That is, there must be enough space to hold references to all the instances the program will need. Also, a mechanism is needed to look up and retrieve the instances quickly enough to satisfy the clients. Sample Code To be written....any volunteers? Thanks! - Doug >I don't think I get it > >On Mar 22, 2006, at 9:36 AM, David Garnier wrote: >>Using the singleton pattern in this case is >>just convenient for the programmer. Problems >>arises >>pretty quickly, especially if you attempt to unit-test your classes. > > >so you're saying that something isn't so good >because you can not test it in the convenient >way? >if that's true, I'm totally disagree >change your test, debug whatever, but if >software is efficient at runtime, works fine and >only problem is some unit test >(which is some kind of framework for testing) >then dump that unit test , dump that unit >framework and make something appropriate to the >software >you're testing > >so if Douglas want to use singletons, what's the problem? >and what do you mean by abusing of singleton usage? > >of course singleton doesn't prevent concurrent >access to the resource across the processes >unless >you're using some OS facility to prevent it, besides >singleton as it was introduced is relevant only >and only inside of the same process >otherwise it's not singleton it's something else >(let's say network singleton: so you have remote >invocation facility >and some factory method that return object created by that facility) > >I don't have any problem with using any kind of singletons. > Parametric Singleton idea (if I understand it >right) could be easily implemented in the >following way: >use a map >populate map with instances of some class and key is your parameter >(you can use lazy population too) > >if somebody ask the key check the value if it's null so resource is taken >if somebody returns the resource put it back to the map > >public synchronized static Object getSomeResource(Object parameter); >public synchronized static void returnResource(Object parameter); > >getSomeResource (inside of the same process) could return null in 2 cases >1. if somebody (from other thread for example) already took that resource >2. if OS API said that resource corresponded to >that parameter (serial port with parameter = 1 >(port #)) >is locked and unavailable; >I'm not sure that in case of serial ports we >even need those Parametric Singletons >(unless lock checking is a very expensive operation) >just ask the OS about availability of that >resource and if it's available give it away >and then OS will lock it and therefore in next >time somebody ask it just answer that resource >is locked >and return null > >for example system has 2 serial ports available >so I ask getResource("tty"); >or I ask getResource("Bluetooth-Modem"); > >and if OS is ok you can give tty or Bluetooth-Modem or both > >no need for any additional pattern I think > >back to the problem >mac os x doesn't recognize locking via files, so >it handles locking via some API >an instance of the singleton in each process >should recognize that resource is locked >(by using that API) that's all >we don't have to make things more complicate >then they are just because there is some nice >design pattern or nice unit test framework or whatever >keep things simple, make them work fast, don't introduce middle layers >unless you have really good reason to do so > >of course I could be entirely wrong, so sorry about that in advance > >thanks > > >Dmitry Markman > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx >Good day, > >I guess that only a selected few (hi Trent) will be able to answer? >this question, but the answer might be interesting for anyone trying? >to debug or understand the code. > >Apparently the MonitorThread is started and stopped in? >RXTXPort.addEventListener and RXTXPort.removeEventListener. This? >would indicate that (originally?) the MonitorThread is only required? >when there is an EventListener. However the MonitorThread is also? >started in the RXTXPort constructor, which could mean that RXTX won't? >work at all if it isn't there. > >It seems to me, that if anyone would add an event listener and later? >on remove it, he could potentially wreak the port. Because the second? >action would kill the MonitorThread. > > >For the moment I am only trying to understand the role of and idea? >behind the MonitorThread. But of course there is a deeper reason thor? >my question: > >If the MonitorThread needs to exist anyway, it could be the thread? >that cleans up the port (ie calls nativeClose) - this would eliminate? >(a further) problem I am seeing with some USB drivers on Mac OSX.? >(Close blocks (after releasing the tty, but still) in the USB driver? >if the device is "not responding"). > >Greetings, >Joachim > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Sat May 13 10:07:37 2006 From: joachim at buechse.de (Joachim Buechse) Date: Sat, 13 May 2006 18:07:37 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Douglas, Looking at the current code, leaves me with the feeling, that there is a lot to do. Defining an API that wraps javax.comm to provide what you describe is certainly possible, but I wonder how much benefit it will actually provide. Personally I think the API defined by javax.comm "request/lock" a port with: cp= new CommunicationPort(identifier) "release" a port with: cp.close(); works quite nice for 99% of the applications. In my experience, the most efficient and elegant implementation is to wrap a port/socket/.. into a business object which declares the remote operations that are possible. Ie "uploadFile", "waitForPrompt", "getSerialNumber", "sendContact", "executeCommand", etc Those methods are then either synchronized or guarded by a monitor. I do not see how your design pattern applied to the port resource would help implementing this. [details start, skip if you agree to the above] When I talked about "thread-safe" I didn't mean several independent "sessions" accessing the port concurrently. I think this is a very rare usage. I believe the most common use case for serial ports today is the control of an external device from a PC running a GUI based application. To implement a clean Swing/AWT-GUI one needs to pass any action that can block to a "worker" thread (else the GUI blocks, the application appears dead). While it is possible to use own prespawned thread that will accept Runnables which operate on the port, this is not very elegant. It is more common to spawn a new thread for every action triggered by the user. Additionally the ABORT of a running operation is often implemented via a port.close() delegated to a different thread. - During the lifetime of a port, it will usually be accessed from several different threads. Instance variables need to be set/read in synchronized regions to guarantee a correct operation based on the Java memory model. - Synchronizing the access is usually handled on the application level (synchronizing the reads/writes is usually useless from the applications view because it is not a transaction mechanism). [details end] I am very open to learn about other scenarios where your proposed design pattern applied to the port resource is beneficial to the application implementor. Best regards, Joachim On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > Dmitry suggests that we acquire an implementation of > a serial port reference, use it, then release it (i.e., check it > back in). > > Joachim says that making serial ports thread friendly might be a > good idea. > > This is a good idea. The design pattern that is close to this idea > is the "Object Pool Design Pattern". > # Object Pool From jredman at ergotech.com Sun May 14 14:28:24 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 14:28:24 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers Message-ID: <446792E8.4000506@ergotech.com> Does anyone know of any work to make RXTX work with Ethernet (telent) Terminal Servers? If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? We've used RXTX with upwards of 100 virtual COM ports on Windows and it works well. Linux is more problematic. It would be good to have an OS independent solution to accesses remote Ethernet serial ports. Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From legolas.w at gmail.com Sun May 14 14:26:34 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:56:34 +0430 Subject: [Rxtx] does any one have a working sample of RXTX and LPT port Message-ID: <4467927A.4000008@gmail.com> Hi Thank you for reading my post does any one has a working sample for RXTX and LPT port ? Thanks From legolas.w at gmail.com Sun May 14 14:27:29 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:57:29 +0430 Subject: [Rxtx] does RXTX support Trigerr on parallel port? Message-ID: <446792B1.4040905@gmail.com> Hi does RXTX support trigger on LPT port ? if so , how i can use it ? Thanks From tjarvi at qbang.org Sun May 14 17:40:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 17:40:59 -0600 (MDT) Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: <446792E8.4000506@ergotech.com> References: <446792E8.4000506@ergotech.com> Message-ID: On Sun, 14 May 2006, Jim Redman wrote: > Does anyone know of any work to make RXTX work with Ethernet (telent) > Terminal Servers? > > If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 > Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? > Hi Jim It appears the author of NVTCom has decided to release the library into the public domain. Integration with rxtx is possible but it would be best to contact the author and find out what his intent is. I would suggest contacting the author with a proposal of what you would like to do and take it from there. We could 'take' public domain software but its better to show respect to the authors and respect their wishes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:10:23 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:10:23 -0600 (MDT) Subject: [Rxtx] does any one have a working sample of RXTX and LPT port In-Reply-To: <4467927A.4000008@gmail.com> References: <4467927A.4000008@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > Thank you for reading my post > does any one has a working sample for RXTX and LPT port ? > Thanks Hi Legolas LPT port support in rxtx is spotty. That means some people have sent in patches for what they do and it works well for them. The original code was not very good. It may have been 3 hours work :/ To get started, Sun has some demo programs with their commapi. With rxtx 2.1 you can change their code from using javax.com to gnu.io and it -should- work. But if it does not you can post here and on bugzilla. There has been more interest lately off the list and maybe there will be enough community resources to get what you need going. If you do get a sample program together, we would gladly put it in the contrib directory so the next person can get things going faster. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:12:12 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:12:12 -0600 (MDT) Subject: [Rxtx] does RXTX support Trigerr on parallel port? In-Reply-To: <446792B1.4040905@gmail.com> References: <446792B1.4040905@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > does RXTX support trigger on LPT port ? > if so , how i can use it ? > Hi Legolas As mentioned in the previous post, rxtx parallel support is not very mature. But if you can point to something that describes the trigger feature, we can probably make sure its there and give a quick code example. -- Trent Jarvi tjarvi at qbang.org From jredman at ergotech.com Sun May 14 22:22:48 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 22:22:48 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: References: <446792E8.4000506@ergotech.com> Message-ID: <44680218.4080008@ergotech.com> Trent, Trent Jarvi wrote: > On Sun, 14 May 2006, Jim Redman wrote: > >> Does anyone know of any work to make RXTX work with Ethernet (telent) >> Terminal Servers? >> >> If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 >> Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? >> > > Hi Jim > > It appears the author of NVTCom has decided to release the library into > the public domain. Integration with rxtx is possible but it would be best > to contact the author and find out what his intent is. > > I would suggest contacting the author with a proposal of what you would > like to do and take it from there. We could 'take' public domain software > but its better to show respect to the authors and respect their wishes. > I sent Marco(?), the author of the library, a note before asking the list - I'll let you know the response. If anyone is already working on it, or has an interest and more time and energy than me, I'd hate to duplicate the efforts. If no one is, and no one objects, maybe I'll see what I can do. Jim > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From Christian.Klemke at t-online.de Mon May 15 02:23:06 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Mon, 15 May 2006 10:23:06 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu><004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: <008a01c677f8$cae18590$02fea8c0@NB600> Hi Trent, Hi Paul, I finally found some time to create a simple patch to enable the optional suppression of version output to the console. It is based on a new system property called "gnu.io.rxtx.NoVersionOutput" which can by set to "true" if necessary. I had some problems accessing CVS, therefore I downloaded the rxtx-2.1-7r2 source archive from ftp.qbang.org (which is linked on the rxtx.org download page) and worked with that release. Please find my proposed patch in the attachment ! Regards, Christian ----- Original Message ----- From: "Trent Jarvi" To: "RXTX Developers and Users" Cc: ""Paul Gettings"" Sent: Friday, May 05, 2006 2:09 PM Subject: Re: [Rxtx] RXTX causing stdout messages > On Fri, 5 May 2006, Christian Klemke wrote: > >> Hi Paul, >> >> I was wondering about the same question some days ago and took a look at >> the >> source files. Unfortunately, I found that you can only get rid of that >> messages by altering and recompiling the Java code. There is a final >> static >> boolean variable called "devel" in the file "RXTXCommDriver.java" which >> is >> set to "true". This constellation causes the output after the native >> libraries have been loaded. No mechanism exists to suppress them >> otherwise >> :-(. >> >> Trent, does that mean that 2.1.7 is still officially a "development" >> version >> ? When will this value be changed to "false" by default ? With 2.1.8 ? It >> would be nice to provide a means to suppress such messages besides that >> static flag (maybe by setting a property called >> "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The >> output can indeed by annoying, especially when used with console >> applications, where the message potentially appears "in the middle" of >> your >> own output. Another possibility would be not to use System.out directly, >> but >> instead some PrintStream field which is initially set to System.out but >> can >> programatically be changed. That would allow for any kind of redirection >> or >> suppression by implementing appropriate user-defined PrintStream >> subclasses >> and making RXTX use that stream. What do you think ? >> > > A patch for using properties would be accepted I'm sure. > > The reason the default is to display the message is not related to the > development state of rxtx anymore. The problem is that people first using > rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. > The message prevents a great deal of email thats easily explained by the > message. > > I question if we should support rxtx 2.0 at all anymore. > > If you post a patch in bugzilla, we'll put it into CVS this weekend. > we'll be going through and doing such things anyhow. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_version_output_patch.diff Type: application/octet-stream Size: 991 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060515/3173c2b6/rxtx_version_output_patch-0399.obj From lyon at docjava.com Mon May 15 06:06:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 May 2006 08:06:21 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Joachim makes several good points. Let me see if I can address some of them below: >Hello Douglas, > >Looking at the current code, leaves me with the feeling, that there? >is a lot to do. Yes! >Defining an API that wraps javax.comm to provide what? >you describe is certainly possible, but I wonder how much benefit it? >will actually provide. > >Personally I think the API defined by javax.comm > >"request/lock" a port with: > cp= new CommunicationPort(identifier) >"release" a port with: > cp.close(); > >works quite nice for 99% of the applications. I don't know what percentage of applications turn off locking, the way that I do in my version of the RXTX lib. I do know that this is not safe practice. I also know that it was motivated by the multi-platform nature of my code and that this was the only way I could make things work, at the time. Java does not appear to have a cross-platform standard for locking resources on various platforms. Each OS appears to have its own standard. The question of who breaks deadlocks and how this is done remains open, as this is not an easy question to resolve. Let me continue, below: > >In my experience, the most efficient and elegant implementation is to? >wrap a port/socket/.. into a business object which declares the? >remote operations that are possible. Ie "uploadFile",? >"waitForPrompt", "getSerialNumber", "sendContact", "executeCommand",? >etc Those methods are then either synchronized or guarded by a? >monitor. I do not see how your design pattern applied to the port? >resource would help implementing this. I have no problem with high-level wrappers that are application specific. That is a very good idea, but orthogonal with respect to the issue of deadlocks. More below: > >[details start, skip if you agree to the above] >When I talked about "thread-safe" I didn't mean several independent? >"sessions" accessing the port concurrently. I think this is a very? >rare usage. That is probably why turning locking off works so well! On the other hand, it is not safe and I shouldn't do it. >I believe the most common use case for serial ports today? >is the control of an external device from a PC running a GUI based? >application. To implement a clean Swing/AWT-GUI one needs to pass any? >action that can block to a "worker" thread (else the GUI blocks, the? >application appears dead). While it is possible to use own prespawned? >thread that will accept Runnables which operate on the port, this is? >not very elegant. It is more common to spawn a new thread for every? >action triggered by the user. Additionally the ABORT of a running? >operation is often implemented via a port.close() delegated to a? >different thread. Here lies the heart of serial port concern. An application opens a serial port and then dies. The application is restarted and finds the port locked. How do we clear the lock? Must the application's user reside in the UUCP group? Must installers of the serial port add users to the UUCP group? Should locking be handled at a high-level of abstraction in an operating system independent way? Should the implementation of the locking mechanism be translated into an API that is dependent on the OS convention? Suppose that we restrict the discussion to serial ports. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on inconsistent naming conventions. Hence my feeling that we need to mirror what is done in other API's; we need a locking toolkit that references peer methods, IMHO. >From the Java programming point of view, the locking API is portable across different platforms, but has, as its implementation, a native peer method that uses the conventions of the underlying OS. This enables portable resource locking (in theory!). Consider, for example: org.apache.commons.transaction.locking with: Interface LockManager at: http://jakarta.apache.org/commons/transaction/apidocs/org/apache/commons/transaction/locking/LockManager.html Or, more recently: java.util.concurrent.locks Interface Lock based on Doug Lea's code: http://kickjava.com/src/EDU/oswego/cs/dl/util/concurrent/ReadWriteLock.java.htm Should we incorporate a clean, portable design into serial port use, one that is consistent with current locking APIs? Basically, a comm port is a resource and resources are typically controlled by managers. Thus, I suggest that we make use of a CommPortManager to help control and centralize serial port usage. The question of how this is done remains open, IMHO, but using core API's like: java.util.concurrent.locks might not be amiss. High-level methods (getAllPorts, getAllSerialPorts, getAllParallelPorts, etc...) might be welcome additions. Basic questions like, "what if a port is in use?" remain open, hence my proposal for the new design pattern. Isn't it the CommPortManager's role to break the deadlock? Cheers! - Doug > >- During the lifetime of a port, it will usually be accessed from? >several different threads. Instance variables need to be set/read in? >synchronized regions to guarantee a correct operation based on the? >Java memory model. >- Synchronizing the access is usually handled on the application? >level (synchronizing the reads/writes is usually useless from the? >applications view because it is not a transaction mechanism). >[details end] > >I am very open to learn about other scenarios where your proposed? >design pattern applied to the port resource is beneficial to the? >application implementor. > >Best regards, >Joachim > >On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > >> Dmitry suggests that we acquire an implementation of >> a serial port reference, use it, then release it (i.e., check it? >> back in). >> > > Joachim says that making serial ports thread friendly might be a? >> good idea. >> >> This is a good idea. The design pattern that is close to this idea >> is the "Object Pool Design Pattern". >> # Object Pool > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Mon May 15 06:58:19 2006 From: joachim at buechse.de (Joachim Buechse) Date: Mon, 15 May 2006 14:58:19 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Doug, I agree fully, that locking of the system resource should be abstracted from the user (programmer). Currently this is already the case, but I agree it might be nice to extract the code into a separate class, which uses platform dependent providers to do its job. What I described in my email was not targeted at allocating the system resource, but at handling an already allocated system resource inside the framework. I agree that it may be possible to combine the two - however, I would suggest to do this in phase2. I can contribute a work over of RXTXPort.java which implements clean internal locking and proper close behavior (which I would call phase 1). I could do this this week. However I strongly believe that there is little sense in trying to do this as a series of patches. It will be closer to a rewrite than to a patch. I have already provided a number of suggested patches via Bugzilla, but this is quite inconvenient (for me). My working copy diverges more and more from the master and hence it gets more and more annoying to provide self contained patches. Best regards, Joachim From tjarvi at qbang.org Mon May 15 08:27:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 May 2006 08:27:51 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Mon, 15 May 2006, Joachim Buechse wrote: > Hello Doug, > > I agree fully, that locking of the system resource should be > abstracted from the user (programmer). Currently this is already the > case, but I agree it might be nice to extract the code into a > separate class, which uses platform dependent providers to do its job. > > What I described in my email was not targeted at allocating the > system resource, but at handling an already allocated system resource > inside the framework. I agree that it may be possible to combine the > two - however, I would suggest to do this in phase2. > > I can contribute a work over of RXTXPort.java which implements clean > internal locking and proper close behavior (which I would call phase > 1). I could do this this week. > > However I strongly believe that there is little sense in trying to do > this as a series of patches. It will be closer to a rewrite than to a > patch. I have already provided a number of suggested patches via > Bugzilla, but this is quite inconvenient (for me). My working copy > diverges more and more from the master and hence it gets more and > more annoying to provide self contained patches. > For methodical testing purposes (which does go on) the incremental patches are better. I'm lagging behind in bugzilla but thats soon to change (this week). It has just been rather chaotic up until now. I moved, purchased a house, and jumped into the fire of a feature freeze timeframe at a new job. btw, we see the Solaris close issues on 2.8 also. 9 and 10 are fine. I'll work towards making those test results public and allow others to run new rxtx code through them. We had the OK at one point but setting up the environment is involved. It isn't just a collection of java classes. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Tue May 16 02:01:47 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:01:47 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] Message-ID: <446986EB.209@willicon.de> Hi, any ideas for my problem? Hans -------- Original-Nachricht -------- Betreff: [Rxtx] Problem under Mac OSX 10.3.9 Datum: Mon, 08 May 2006 18:47:20 +0200 Von: WILLICon Antwort an: RXTX Developers and Users An: RXTX Developers and Users Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/b0741c2b/attachment-0399.html From joachim at buechse.de Tue May 16 02:15:08 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 10:15:08 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: Hello Hans, I am using RXTX on OS X for my own project. I do not see the problem you describe. I had some troubles installing it because the current version uses lock files which is non-standard on OS X. I have created a patched version which I currently use. This version does not need to modify user groups and hence does not need an installer. I just pop it in the application directory. If you send me a link where I can download your OSX installer, I will have a quick look. Regards, Joachim On 16.05.2006, at 10:01, WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we > have some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + > spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + > spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always > the value "false". > I can only get the status, while I open the port and catch the > exception. > > Any ideas? > > Hans > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail at willicon.de Tue May 16 02:26:53 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:26:53 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: References: <446986EB.209@willicon.de> Message-ID: <44698CCD.7050709@willicon.de> Joachim, tanks for the answer. I'll send You a mail. Hans Joachim Buechse schrieb: > Hello Hans, > > I am using RXTX on OS X for my own project. I do not see the problem > you describe. > > I had some troubles installing it because the current version uses > lock files which is non-standard on OS X. I have created a patched > version which I currently use. This version does not need to modify > user groups and hence does not need an installer. I just pop it in > the application directory. If you send me a link where I can download > your OSX installer, I will have a quick look. > > Regards, > Joachim > > On 16.05.2006, at 10:01, WILLICon wrote: > > >> Hi, >> >> any ideas for my problem? >> >> Hans >> >> -------- Original-Nachricht -------- >> Betreff: [Rxtx] Problem under Mac OSX 10.3.9 >> Datum: Mon, 08 May 2006 18:47:20 +0200 >> Von: WILLICon >> Antwort an: RXTX Developers and Users >> An: RXTX Developers and Users >> >> >> Hi, >> >> I use for RXTX for communicate with CyclingComputers. >> >> It works good under Win32, Sloaris and Linux but with Mac OSX we >> have some problems. >> >> My users install the Mac OSX serial lib from the actual binary. >> >> After starting the program, they get this error message: >> >> java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while >> loading gnu.io.RXTXCommDriver >> >> Remember, this error comes only under Mac OSX. >> >> That is the code for the error: >> >> Enumeration portList = CommPortIdentifier.getPortIdentifiers(); >> spInUse = getBundleStr("serialPortInUse"); >> spFree = getBundleStr("serialPortFree"); >> while (portList.hasMoreElements()) { >> CommPortIdentifier portId = (CommPortIdentifier) >> portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (osName != null && osName.startsWith("mac")) { >> if (!portId.getName().startsWith("dev/cu.")) { >> continue; >> } >> } >> if (portId.isCurrentlyOwned()) { >> serialPortNames.add(portId.getName() + " - " + >> spInUse); >> } >> else { >> serialPortNames.add(portId.getName() + " - " + >> spFree); >> } >> } >> } >> if (serialPortNames.size() == 0) { >> serialPortNames.add(getBundleStr("serialPortNotFound")); >> } >> >> BTW: The methode isCurrentlyOwned() is not working. I get always >> the value "false". >> I can only get the status, while I open the port and catch the >> exception. >> >> Any ideas? >> >> Hans >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/948333be/attachment-0399.html From jredman at ergotech.com Tue May 16 07:35:52 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 16 May 2006 07:35:52 -0600 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: <4469D538.6070408@ergotech.com> Hans, I have no direct insight, but would note that what you have is a "NoClassDefFoundError" not a "ClassNotFoundException". So the class javax/comm/CommDriver is found, but one of its dependencies is missing. NoClassDefFoundError are a bigger problem to resolve because you get no indication of the real problem. Jim WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we have > some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > * spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always the > value "false". > I can only get the status, while I open the port and catch the exception. > > Any ideas? > > Hans > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.de Tue May 16 08:01:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 16:01:21 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 In-Reply-To: <4469AFC3.6000002@willicon.de> References: <44698EBC.8000008@willicon.de> <8C5680C4-E2BA-42FF-B221-36E1124FA6A4@buechse.de> <4469AFC3.6000002@willicon.de> Message-ID: <9825A602-D6ED-4C28-BF33-9A7C984FACD5@buechse.de> Hallo Hans, you include RXTX 2.17 in your "bikeXexperience.jar" (2.17 uses Interfaces from gnu.io.* not javax.comm.*). Now inspect your error log closely: The class gnu.io.RXTXCommDriver tries to load javax.comm.CommDriver: this is only the case for RXTX 2.07. I assume, that the user has installed Version 2.07 into one of the java.ext.dirs . The VM always tries to load classes from the "system" path first. The current Mac installer distributed with RXTX in fact installs RXTXcomm.jar and librxtxSerial.jnilib into /Library/Java/Extensions. (I wrote some time ago that I consider this as a bad idea because of potential version conflicts-> thanks for delivering the example). For 2.07 it does so without installing the javax.comm classes it seems. I would recommend that you instruct your users to install version 2.17 only. Until RXTX is changed to use TIOCEXCL instead of lock files, you can hardly avoid the installer, as the user needs to be added to a special group and a lockfile directory needs be created. More precisely you are waiting for: http://bugzilla.qbang.org/show_bug.cgi?id=50 [RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL)] Regards, Joachim -------------- next part -------------- A non-text attachment was scrubbed... Name: log.tiff Type: image/tiff Size: 38394 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/e3e52128/log-0399.tiff -------------- next part -------------- > > Ich verwende RXTX 2.17. Das orginal RXTXcomm.jar ist in > CyclingDataManager.jar enthalten. > From tjarvi at qbang.org Wed May 17 23:18:15 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 May 2006 23:18:15 -0600 (MDT) Subject: [Rxtx] update Message-ID: So we have several patches and these have stacked up. I'd like to thank everyone for being patient. Tests for the most intrusive patches look good so far. I still have to get some bits together on my end but it looks like we can catch everything up in CVS this week. I'll try to post a normal list of what went in by whom with links Saturday. But I'm not seeing anything that raises flags yet. I also think I'll be able to submit a patch for nonstandard baud rates. I have to confirm w32 but I think its going to be a one line fix. I don't know if its bugzilla or people tinkering with patch files before submitting but patches are not applying cleanly. So the patches have to be done by hand. This may make things difficult for people hoping to add other patches on top. I'm trying to make that go well but ... -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Thu May 18 02:23:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 May 2006 10:23:47 +0200 Subject: [Rxtx] update In-Reply-To: References: Message-ID: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Hello Trent, in fact I tinkered with the patches (never used this mechanism before, usually I "communicate" via cvs) ... so sorry for any trouble you had applying them. Basicly I edited the patches to make them self contained. Having the tests run with different speeds on different platforms, may well be an effect of caching. I have seen quite interesting propagation delays for the closing flag on my PowerPC system, which makes me doubt, that the propagation of output_buffer_empty_flag works as it should. Maybe the communication mechanism between the two threads should be replaced by something like pthread_cond_*. Could you describe which problems you see on Solaris/SPARC? I'd be interested to see if they exist on OS X (PowerPC) as well... As you seem to work on the stuff at the moment I would like to suggest the following additions (it looks more than it is, I posted some context to make clear where to apply the change). See the comments in braces for what was changed Greetings, Joachim (1) The end of the drain loop could be: --- report("drain_loop: received EINTR in tcdrain\n"); --- (added "in tcdrain" to make debug output clearer) (2) The start of the drain loop should be: --- for(i=0;;i++) { report_verbose("drain_loop: looping\n"); #if defined(__sun__) /* FIXME: No time to test on all OS's for production */ if( eis->eventloop_interrupted ) { goto end; } if (usleep(5000)) { report("drain_loop: received EINTR"); } #else if (usleep(1000000)) { report("drain_loop: received EINTR"); } #endif /* __sun__ */ --- (added a check for "eis->eventloop_interrupted" before the sleep) (3) The end of interrupt_event_loop could (and maybe should) be: --- #if !defined(TIOCSERGETLSR) && !defined(WIN32) /* make sure that the drainloop unblocks from tcdrain */ pthread_kill(index->drain_tid, SIGABRT); /* TODO use wait/join/SIGCHLD/?? instead of sleep? */ usleep(50 * 1000); /* Under normal conditions, SIGABRT will unblock tcdrain. However a non-responding USB device combined with an unclean driver may still block. This is very ugly because it may block the call to close indefinetly. */ if (index->closing != 1) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); index->closing = 1; } #endif report("interruptEventLoop: interrupted\n"); --- (added some comments and pthread_cancel for resisting drain thread) On 18.05.2006, at 07:18, Trent Jarvi wrote: > > So we have several patches and these have stacked up. I'd like to > thank > everyone for being patient. > > Tests for the most intrusive patches look good so far. I still > have to > get some bits together on my end but it looks like we can catch > everything > up in CVS this week. > > I'll try to post a normal list of what went in by whom with links > Saturday. But I'm not seeing anything that raises flags yet. I also > think I'll be able to submit a patch for nonstandard baud rates. > I have > to confirm w32 but I think its going to be a one line fix. > > I don't know if its bugzilla or people tinkering with patch files > before > submitting but patches are not applying cleanly. So the patches > have to > be done by hand. This may make things difficult for people hoping > to add > other patches on top. I'm trying to make that go well but ... > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu May 18 22:28:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 18 May 2006 22:28:00 -0600 (MDT) Subject: [Rxtx] update In-Reply-To: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> References: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Message-ID: On Thu, 18 May 2006, Joachim Buechse wrote: > Hello Trent, > > in fact I tinkered with the patches (never used this mechanism > before, usually I "communicate" via cvs) ... so sorry for any trouble > you had applying them. Basicly I edited the patches to make them self > contained. I think we are close to moving towards that. > > Having the tests run with different speeds on different platforms, > may well be an effect of caching. I have seen quite interesting > propagation delays for the closing flag on my PowerPC system, which > makes me doubt, that the propagation of output_buffer_empty_flag > works as it should. Maybe the communication mechanism between the two > threads should be replaced by something like pthread_cond_*. Could > you describe which problems you see on Solaris/SPARC? I'd be > interested to see if they exist on OS X (PowerPC) as well... This is interesting. I have seen problems with output buffer empty in applications that require it. I'm trying to get a bug list and or test results open for everyone to see but that may take time. But missed output buffer events ... yep. With Sparc, we have seen a few things. One was a kernel race condition that went away when we reimaged and updated 2.8. RXTX was hanging on close, top showed no cpu use but there was 2 second delays just typing on console. The other is our tests now take ~4 times longer on Solaris. Someone is looking at timing just open, close, read, write, ... to see if they can find where the slowdown is. This happened after solaris 2.8. I'll try to share more when/if there is something interesting. This may well not be solvable in userland. > > As you seem to work on the stuff at the moment I would like to > suggest the following additions (it looks more than it is, I posted > some context to make clear where to apply the change). See the > comments in braces for what was changed I'll take a look. This could all come together Saturday but I also have an event to attend that day. I may not wrap this up until Sunday. -- Trent Jarvi tjarvi at qbang.org From andrewlord at internode.on.net Sun May 21 20:10:02 2006 From: andrewlord at internode.on.net (Andrew Lord) Date: Mon, 22 May 2006 11:40:02 +0930 Subject: [Rxtx] Kernel include files do not match kernel Message-ID: <200605221140.03271.andrewlord@internode.on.net> Hi, I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel 2.6.12-18 with the command: ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include However I get the message: ## checking java.version 1.5.0_06 ## checking os.version 2.6.12-18mdk ## ## WARNING: Kernel include files do not match the current kernel ## ## configure: creating ./config.status etc. Is there a problem with the way I'm specifying the 'include' directory ? If not, how else can I specify the correct directory for the include files please ? Cheers, Andrew From tjarvi at qbang.org Sun May 21 20:31:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 May 2006 20:31:31 -0600 (MDT) Subject: [Rxtx] Kernel include files do not match kernel In-Reply-To: <200605221140.03271.andrewlord@internode.on.net> References: <200605221140.03271.andrewlord@internode.on.net> Message-ID: On Mon, 22 May 2006, Andrew Lord wrote: > Hi, > > I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel > 2.6.12-18 with the command: > > ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk > CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include > > However I get the message: > > ## checking java.version 1.5.0_06 > ## checking os.version 2.6.12-18mdk > ## > ## WARNING: Kernel include files do not match the current kernel > ## > ## configure: creating ./config.status > etc. > > Is there a problem with the way I'm specifying the 'include' directory ? If > not, how else can I specify the correct directory for the include files > please ? > Hi Andrew I'm fairly sure your --with-kernel option does nothing. The CPPFLAGS should do what you want. Maybe put an #error message in /usr/src/linux.../incude/linux/version.h But I don't recall a recent problem with version missmatches. It should work. Distros will even ship include files that don't match versions exactly. In theory it should never matter for users. I used to compile new kernels by hand and really didnt have a distro. I didnt have a seperate package of kernel headers for users (myself). When changing a gateway from linux 1.2.12 to 2.1.77, I would worry about such messages. So if you are doing something that weird, the message may be of use to you. If you just see the message on a distro you installed, it is more than likely harmless. -- Trent Jarvi tjarvi at qbang.org From mrogers at spro.net Mon May 22 14:45:39 2006 From: mrogers at spro.net (Mike Rogers) Date: Mon, 22 May 2006 14:45:39 -0600 Subject: [Rxtx] Sun's CommAPI -- think May? Message-ID: <447222F3.9040302@spro.net> Hi, Any word from Sun about progress towards fixing the Java CommAPI v3 "incompatibilities" so RXTX 2.0 can operate within the framework's namespace (javax.comm)? I recall mention of a May time frame. Thanks, Mike From paul.klissner at sun.com Mon May 22 15:09:27 2006 From: paul.klissner at sun.com (Paul Klissner) Date: Mon, 22 May 2006 14:09:27 -0700 Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <447222F3.9040302@spro.net> References: <447222F3.9040302@spro.net> Message-ID: <44722887.8080308@sun.com> Mike Rogers wrote: > Hi, > > Any word from Sun about progress towards fixing the Java CommAPI v3 > "incompatibilities" so RXTX 2.0 can operate within the framework's > namespace (javax.comm)? I recall mention of a May time frame. > > Thanks, > > Mike > We've had a lot of work come in. This hasn't been the only priority. I'm running behind the plan in addressing this, but will be looking at it again soon. Rather than state a new, I'll just say it is in progress, and not off the table. I'll get this fixed as soon as I can. Good timing for asking as we just started discussing javax.comm plans today, and I'll have some cycles to work on it soon. Paul From yhua537 at cse.unsw.edu.au Mon May 22 16:03:05 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Tue, 23 May 2006 08:03:05 +1000 (EST) Subject: [Rxtx] install rxtx in XP Message-ID: Hi Guys, I am new to serial port programming, and have no experience on programming java in xp, but my project require me to builld a communication link between xp and a UART device. Most of the information in the web site seems for linux only. including the commands such as export and chmod. How do I install rxtx in xp? cheers YiQi Huang From mark at mdsh.com Tue May 23 01:24:20 2006 From: mark at mdsh.com (Mark Himsley) Date: Tue, 23 May 2006 08:24:20 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off , it includes DLLs for Windows and the JAR for Java. Follow the Windows instructions in the INSTALL. ie RXTXcomm.jar goes in \jre\lib\ext (under java) rxtxSerial.dll goes in \jre\bin So, assuming a fairly standard Java install, copy RXTXcomm.jar into C:\Program Files\Java\jre1.5.0_06\lib\ext and copy rxtxSerial.dll into C:\Program Files\Java\jre1.5.0_06\bin Yes, it really is that simple. On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > I am new to serial port programming, and have no experience on > programming java in xp, but my project require me to builld a > communication link between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang -- Mark Himsley From joachim at buechse.de Tue May 23 02:51:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 23 May 2006 10:51:47 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) Unless it is absolutely required you should NOT install RXTX in your global Java Runtime Environment. This will for sure create versioning conflicts - if not now, than in the future, if not on your system than at your clients. Instead put the dll in your application directory and include the RXTXcomm.jar in your classpath. This is much safer and not a bit more complicated. Regards, Joachim On 23.05.2006, at 09:24, Mark Himsley wrote: > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR > for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > >> I am new to serial port programming, and have no experience on >> programming java in xp, but my project require me to builld a >> communication link between xp and a UART device. >> >> Most of the information in the web site seems for linux only. >> including >> the commands such as export and chmod. How do I install rxtx in xp? >> >> cheers >> YiQi Huang > > > > -- > Mark Himsley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tod at todbot.com Tue May 23 03:12:22 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 02:12:22 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I totally agree: do not contaminate the Java installation. I put all the RXTX files in a directory and then change my java invocation to be: % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* Alternatively, use Launch4J to create a double-clickable application and keep the RXTX libraries in the directory of the application. -=tod On May 23, 2006, at 1:51 AM, Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > >> Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off >> , it includes DLLs for Windows and the JAR >> for Java. >> >> Follow the Windows instructions in the INSTALL. >> >> ie >> >> RXTXcomm.jar goes in \jre\lib\ext (under java) >> rxtxSerial.dll goes in \jre\bin >> >> So, assuming a fairly standard Java install, copy RXTXcomm.jar into >> C:\Program Files\Java\jre1.5.0_06\lib\ext >> and copy rxtxSerial.dll into >> C:\Program Files\Java\jre1.5.0_06\bin >> >> Yes, it really is that simple. >> >> >> >> On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: >> >>> I am new to serial port programming, and have no experience on >>> programming java in xp, but my project require me to builld a >>> communication link between xp and a UART device. >>> >>> Most of the information in the web site seems for linux only. >>> including >>> the commands such as export and chmod. How do I install rxtx in xp? >>> >>> cheers >>> YiQi Huang >> >> >> >> -- >> Mark Himsley >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From smontgomery at mediaspansoftware.com Tue May 23 08:46:53 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Tue, 23 May 2006 10:46:53 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: Message-ID: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Joachim and Tod mentioned how to keep the files RXTX requires on Windows XP out of the Java installations - thanks gentlemen! Are there similar suggestions for an RXTX install on OS X? The current "canonical" OS X installation instructions "contaminate the Java installation", to use Tod's words. Our app will run fine under 1.4.2 and 5.0 on OS X, and a lot of users will have both. We've already been burned by the recent switch from 1.4.2 to 5.0 as the platform default. Any suggestions welcomed. From tod at todbot.com Tue May 23 13:27:55 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 12:27:55 -0700 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <9BA0F670-A862-42E7-BB2C-130D775ABDF9@todbot.com> Hi Sean, It depends on how you build and deploy your code. If you're using shell scripts, you can do something like this: #!/bin/sh # pick one JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/ Commands/java #JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/ Commands/java $JAVA -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* That both picks which VM to use and uses the RXTX in the directory called 'rxtxlib'. If you want your shell script to be clever, you could test for the existence of the different 'java' executables and go from there (maybe even use different jar files). I am almost positive all OS X systems with Java 1.5 are guaranteed to also have Java 1.4.2. If you're using Jar Builder or XCode, you can specify which JVM to use and add the extra args in the Info.plist file. The paths specified in the 'java' invocation then are based off of the $JAVAROOT variable that the JavaApplicationStub sets for you. For my app, I've have been compiling two sets of jars, one compiled with 1.4.2 and one with 1.5, but they both run under 1.5. So I have a similar shell script that chooses a different 'javac' depending on the need. -=tod On May 23, 2006, at 7:46 AM, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From yhua537 at cse.unsw.edu.au Tue May 23 11:09:37 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 03:09:37 +1000 (EST) Subject: [Rxtx] install rxtx in XP (Mark Himsley, Joachim Buechse, Tod E. Kurt> In-Reply-To: References: Message-ID: > Message: 8 > Date: Tue, 23 May 2006 08:03:05 +1000 (EST) > From: YiQi Huang > Subject: [Rxtx] install rxtx in XP > To: rxtx at qbang.org > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > Hi Guys, > > I am new to serial port programming, and have no experience on programming > java in xp, but my project require me to builld a communication link > between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang > > > ------------------------------ > > Message: 9 > Date: Tue, 23 May 2006 08:24:20 +0100 > From: Mark Himsley > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=us-ascii; format=flowed > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > ------------------------------ > > Message: 10 > Date: Tue, 23 May 2006 10:51:47 +0200 > From: Joachim Buechse > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > > ------------------------------ > > Message: 11 > Date: Tue, 23 May 2006 02:12:22 -0700 > From: "Tod E. Kurt" > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I totally agree: do not contaminate the Java installation. > > I put all the RXTX files in a directory and then change my java > invocation to be: > > % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* > > Alternatively, use Launch4J to create a double-clickable application > and keep the RXTX libraries in the directory of the application. > > -=tod > > Hi, Thanks guys, I don't know if this is the correct way to reply your mecessage, if wrong, please point out. Thank you for Mark to give the detail instructions and Joachim to point out the cons ot installing in the java directory, and specially thanks for Tod to give the instrection in detail. Sorry to ask another stupid question: I have followed Tod's instruction. Now I think i am ready to start hacking. But where is the RXTX API documentation? Is it the same as using normal java comm API? btw, where could i find some examples to start with? Thanks very much cheers YiQi Huang From tjarvi at qbang.org Tue May 23 16:09:32 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 May 2006 16:09:32 -0600 (MDT) Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <44722887.8080308@sun.com> References: <447222F3.9040302@spro.net> <44722887.8080308@sun.com> Message-ID: > Good timing for asking as we just started discussing javax.comm plans > today, and I'll have some cycles to work on it soon. Hi Paul I assume you mean Sun is discussing plans concerning its own internal actions and there is no community involvment at this point. -- Trent Jarvi tjarvi at qbang.org From yhua537 at cse.unsw.edu.au Tue May 23 22:50:01 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 14:50:01 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } From mmester at sps.edu Tue May 23 22:58:21 2006 From: mmester at sps.edu (Michael Mester) Date: Wed, 24 May 2006 00:58:21 -0400 Subject: [Rxtx] install rxtx in XP References: Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below -----Original Message----- From: rxtx-bounces at qbang.org on behalf of YiQi Huang Sent: Wed 5/24/2006 12:50 AM To: RXTX Developers and Users Subject: Re: [Rxtx] install rxtx in XP Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3950 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060523/b36d0c63/attachment-0399.bin From yhua537 at cse.unsw.edu.au Tue May 23 23:05:50 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 15:05:50 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: Yes, Michael you are right, it should be semicolons, But it still can't find the correct library. On Wed, 24 May 2006, Michael Mester wrote: > I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below > > > -----Original Message----- > From: rxtx-bounces at qbang.org on behalf of YiQi Huang > Sent: Wed 5/24/2006 12:50 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] install rxtx in XP > > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > cheers YiQi Huang From tod at todbot.com Wed May 24 00:01:57 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 23:01:57 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Yes, sorry, classpath entries are semicolon-separated on Windows and colon-separated on everything else. Your example code below is importing the wrong set of classes. It should not "import javax.comm.*", instead it should "import gnu.io.*". When I make that change, your example program compiles. The "javax.comm" package is the one released by Sun, the "gnu.io" package is the RXTX one. You might've seen some discussion that the two will be merged or become compatible, but that hasn't happened yet. -=tod On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > > Yes, Michael you are right, it should be semicolons, But it still > can't > find the correct library. > > On Wed, 24 May 2006, Michael Mester wrote: > >> I believe the entries in the classpath need to be seperated with >> semicolons, not a colon as you have in your command below >> >> >> -----Original Message----- >> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >> Sent: Wed 5/24/2006 12:50 AM >> To: RXTX Developers and Users >> Subject: Re: [Rxtx] install rxtx in XP >> >> Hi, >> >> Sorry guys.I follow Tod's instruction, and here is what i did: >> >> put >> RXTXcomm.jar, >> rxtxParallel.dll, >> rxtxSerial.dll >> in >> C:\RXTX_files >> >> and I got a SimpleRead class attached below, compile it with : >> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >> it still saying "cannot find symbol". >> >> Is there anything I did wrong? Do I need the comm.jar from Sun? >> >> Thanks & regards >> YiQi Huang >> >> >> //////////////////////////////////////////////////////// >> // SimpleRead.java >> //////////////////////////////////////////////////////// >> >> import java.io.*; >> import java.util.*; >> import javax.comm.*; >> >> public class SimpleRead >> implements Runnable, SerialPortEventListener { >> static CommPortIdentifier portId; >> static Enumeration portList; >> InputStream inputStream; >> SerialPort serialPort; >> Thread readThread; >> public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == >> CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals("COM1")) { >> //if (portId.getName().equals("/dev/term/a")) { >> SimpleRead reader = new SimpleRead(); >> } >> } >> } >> } >> public SimpleRead() { >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", >> 2000); >> } catch (PortInUseException e) {} >> try { >> inputStream = serialPort.getInputStream(); >> } catch (IOException e) {} >> try { >> serialPort.addEventListener(this); >> } catch (TooManyListenersException e) {} >> serialPort.notifyOnDataAvailable(true); >> try { >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } catch (UnsupportedCommOperationException e) {} >> readThread = new Thread(this); >> readThread.start(); >> } >> public void run() { >> try { >> Thread.sleep(20000); >> } catch (InterruptedException e) {} >> } >> public void serialEvent(SerialPortEvent event) { >> switch(event.getEventType()) { >> case SerialPortEvent.BI: >> case SerialPortEvent.OE: >> case SerialPortEvent.FE: >> case SerialPortEvent.PE: >> case SerialPortEvent.CD: >> case SerialPortEvent.CTS: >> case SerialPortEvent.DSR: >> case SerialPortEvent.RI: >> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >> break; >> case SerialPortEvent.DATA_AVAILABLE: >> byte[] readBuffer = new byte[20]; >> try { >> while (inputStream.available() > 0) { >> int numBytes = inputStream.read(readBuffer); >> } >> System.out.print(new String(readBuffer)); >> } catch (IOException e) {} >> break; >> } >> } >> } >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > cheers > YiQi Huang > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From joachim at buechse.de Wed May 24 00:10:06 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:10:06 +0200 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Hi Sean, my preferred way of dealing with RXTX on OS X is to include the RXTX classes into my application jar and to put the RXTX lib in the same directory as this jar. To make it even more comfortable, you can include the lib in the jar and have some startup code extract it and write it to a temporary file from which you load it with System.load(). Unfortunately the current version of RXTX for OS X requires tinkering with user groups as it is based on lockfiles - and hence it needs the RXTX OS X installer or you need to duplicated this functionality in your own installer. I have created my own native version which is not based on lockfiles but tty locking (the standard way to do it on OSX). I hope that these patches will be integrated soon into the distribution. Regards, Joachim On 23.05.2006, at 16:46, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Wed May 24 00:16:12 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:16:12 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <7017ECFC-B13E-4806-B321-9FFCAC5830F0@buechse.de> I assume you downloaded rxtx-217 (not 207). Instead of importing javax.comm.* you must import gnu.io.* The classes have the same name, but they are not in the same package. On 24.05.2006, at 06:50, YiQi Huang wrote: > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From yhua537 at cse.unsw.edu.au Wed May 24 00:17:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 16:17:45 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Message-ID: Thanks Tod again, i kept reading "gnu.io.*" as "gun.io.*" last few hours after i read some commons from web. Thanks very much Tod. thanks YiQi Huang On Tue, 23 May 2006, Tod E. Kurt wrote: > Yes, sorry, classpath entries are semicolon-separated on Windows and > colon-separated on everything else. > > Your example code below is importing the wrong set of classes. It > should not "import javax.comm.*", instead it should "import > gnu.io.*". When I make that change, your example program compiles. > The "javax.comm" package is the one released by Sun, the "gnu.io" > package is the RXTX one. You might've seen some discussion that the > two will be merged or become compatible, but that hasn't happened yet. > > -=tod > > > On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > >> >> Yes, Michael you are right, it should be semicolons, But it still >> can't >> find the correct library. >> >> On Wed, 24 May 2006, Michael Mester wrote: >> >>> I believe the entries in the classpath need to be seperated with >>> semicolons, not a colon as you have in your command below >>> >>> >>> -----Original Message----- >>> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >>> Sent: Wed 5/24/2006 12:50 AM >>> To: RXTX Developers and Users >>> Subject: Re: [Rxtx] install rxtx in XP >>> >>> Hi, >>> >>> Sorry guys.I follow Tod's instruction, and here is what i did: >>> >>> put >>> RXTXcomm.jar, >>> rxtxParallel.dll, >>> rxtxSerial.dll >>> in >>> C:\RXTX_files >>> >>> and I got a SimpleRead class attached below, compile it with : >>> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >>> it still saying "cannot find symbol". >>> >>> Is there anything I did wrong? Do I need the comm.jar from Sun? >>> >>> Thanks & regards >>> YiQi Huang >>> >>> >>> //////////////////////////////////////////////////////// >>> // SimpleRead.java >>> //////////////////////////////////////////////////////// >>> >>> import java.io.*; >>> import java.util.*; >>> import javax.comm.*; >>> >>> public class SimpleRead >>> implements Runnable, SerialPortEventListener { >>> static CommPortIdentifier portId; >>> static Enumeration portList; >>> InputStream inputStream; >>> SerialPort serialPort; >>> Thread readThread; >>> public static void main(String[] args) { >>> portList = CommPortIdentifier.getPortIdentifiers(); >>> while (portList.hasMoreElements()) { >>> portId = (CommPortIdentifier) portList.nextElement(); >>> if (portId.getPortType() == >>> CommPortIdentifier.PORT_SERIAL) { >>> if (portId.getName().equals("COM1")) { >>> //if (portId.getName().equals("/dev/term/a")) { >>> SimpleRead reader = new SimpleRead(); >>> } >>> } >>> } >>> } >>> public SimpleRead() { >>> try { >>> serialPort = (SerialPort) portId.open("SimpleReadApp", >>> 2000); >>> } catch (PortInUseException e) {} >>> try { >>> inputStream = serialPort.getInputStream(); >>> } catch (IOException e) {} >>> try { >>> serialPort.addEventListener(this); >>> } catch (TooManyListenersException e) {} >>> serialPort.notifyOnDataAvailable(true); >>> try { >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, >>> SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> } catch (UnsupportedCommOperationException e) {} >>> readThread = new Thread(this); >>> readThread.start(); >>> } >>> public void run() { >>> try { >>> Thread.sleep(20000); >>> } catch (InterruptedException e) {} >>> } >>> public void serialEvent(SerialPortEvent event) { >>> switch(event.getEventType()) { >>> case SerialPortEvent.BI: >>> case SerialPortEvent.OE: >>> case SerialPortEvent.FE: >>> case SerialPortEvent.PE: >>> case SerialPortEvent.CD: >>> case SerialPortEvent.CTS: >>> case SerialPortEvent.DSR: >>> case SerialPortEvent.RI: >>> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >>> break; >>> case SerialPortEvent.DATA_AVAILABLE: >>> byte[] readBuffer = new byte[20]; >>> try { >>> while (inputStream.available() > 0) { >>> int numBytes = inputStream.read(readBuffer); >>> } >>> System.out.print(new String(readBuffer)); >>> } catch (IOException e) {} >>> break; >>> } >>> } >>> } >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> >> cheers >> YiQi Huang >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From smontgomery at mediaspansoftware.com Wed May 24 10:24:13 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 12:24:13 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: Tod & Joachim, Thanks for the info, that's very helpful. I'll give that a whirl when I move to rxtx 2.1. I'm still using the older 2.0.7 version for now (don't ask), which probably requires the Sun comm.jar, javax.comm.properties and librxtxSerial.jnilib to be in very specific places in each jvm's file hierarchy. From tjarvi at qbang.org Wed May 24 11:59:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 11:59:16 -0600 (MDT) Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: On Wed, 24 May 2006, Sean Montgomery wrote: > Tod & Joachim, > > Thanks for the info, that's very helpful. I'll give that a whirl > when I move to rxtx 2.1. I'm still using the older 2.0.7 version for > now (don't ask), which probably requires the Sun comm.jar, > javax.comm.properties and librxtxSerial.jnilib to be in very specific > places in each jvm's file hierarchy. > You will need comm.jar from Sun then. It must be Sun's version 2.* or older for Linux or Solaris. I assume they have this in download archives. The default offering from Sun is version 3.0. This version currently does not support rxtx. The older version will probably be fine for your needs. -- Trent Jarvi tjarvi at qbang.org From smontgomery at mediaspansoftware.com Wed May 24 12:19:06 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 14:19:06 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: <3939EFB8-11E1-4E3E-A684-5B3C525577CD@mediaspansoftware.com> Yup, that's right, thanks Trent. I've been using these files for quite a while now. Thanks for bringing it up. I almost didn't mention using 2.0.7 because I didn't want to give any new members of the list the wrong idea! :-) On May 24, 2006, at 1:59 PM, Trent Jarvi wrote: > On Wed, 24 May 2006, Sean Montgomery wrote: > >> Tod & Joachim, >> >> Thanks for the info, that's very helpful. I'll give that a whirl >> when I move to rxtx 2.1. I'm still using the older 2.0.7 version for >> now (don't ask), which probably requires the Sun comm.jar, >> javax.comm.properties and librxtxSerial.jnilib to be in very specific >> places in each jvm's file hierarchy. >> > > You will need comm.jar from Sun then. It must be Sun's version 2.* or > older for Linux or Solaris. I assume they have this in download > archives. > > The default offering from Sun is version 3.0. This version > currently does > not support rxtx. > > The older version will probably be fine for your needs. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mark at mdsh.com Wed May 24 15:55:46 2006 From: mark at mdsh.com (Mark Himsley) Date: Wed, 24 May 2006 22:55:46 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <37B0FC4B1F3237321F093ABE@MacMini.local> On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) That's no problem. BUT, do note that the instructions I elaborated on are in the INSTALL file within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone please update the INSTALL file? > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > > , it includes DLLs for Windows and the JAR > > for Java. > > > > Follow the Windows instructions in the INSTALL. > > > > ie > > > > RXTXcomm.jar goes in \jre\lib\ext (under java) > > rxtxSerial.dll goes in \jre\bin > > > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > > C:\Program Files\Java\jre1.5.0_06\lib\ext > > and copy rxtxSerial.dll into > > C:\Program Files\Java\jre1.5.0_06\bin > > > > Yes, it really is that simple. > > > > > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > > > >> I am new to serial port programming, and have no experience on > >> programming java in xp, but my project require me to builld a > >> communication link between xp and a UART device. > >> > >> Most of the information in the web site seems for linux only. > >> including > >> the commands such as export and chmod. How do I install rxtx in xp? > >> > >> cheers > >> YiQi Huang > > > > > > > > -- > > Mark Himsley > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Mark Himsley From tjarvi at qbang.org Wed May 24 16:41:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 16:41:46 -0600 (MDT) Subject: [Rxtx] install rxtx in XP In-Reply-To: <37B0FC4B1F3237321F093ABE@MacMini.local> References: <37B0FC4B1F3237321F093ABE@MacMini.local> Message-ID: On Wed, 24 May 2006, Mark Himsley wrote: > > > On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > >> I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > That's no problem. > > BUT, do note that the instructions I elaborated on are in the INSTALL file > within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone > please update the INSTALL file? > > The INSTALL file may be updated by anyone at anytime. http://rxtx.qbang.org/wiki/index.php/Installation We are moving it to the wiki so end users may put the type of answers they would like to see in. Sometimes it's best if developers don't give what appears to be cryptic answers. You can even put in that jre/lib/ext is not the right place but you don't understand the classpath solution mentioned on the mail-list and then we know what to add. -- Trent Jarvi tjarvi at qbang.org From stramit at gmail.com Wed May 24 21:45:31 2006 From: stramit at gmail.com (Tim Cooper) Date: Thu, 25 May 2006 13:45:31 +1000 Subject: [Rxtx] Accessing Virtual Com Port Message-ID: Hi, I have to develop an application that talks to a virtual com port (in this case com3) which translates any messages sent across a USB cable to a micro. Using C++ I can talk to this com port and I know that it is configured, present, and working. For the application that I am trying to write I want to use RXTX for the communication. My problem is that the configured virtual port (in windows) is not showing up when I do an enumeration over the available ports. The output I get is (com 3 is not present) : Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 PORT FOUND: COM1 PORT FOUND: LPT1 Is there anything that I need to do to make com3 available to RXTX and my application? Timothy Cooper -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060524/c5591648/attachment-0399.html From antonio.luis at iscte.pt Thu May 25 01:39:13 2006 From: antonio.luis at iscte.pt (=?ISO-8859-1?Q?Ant=F3nio_Lopes?=) Date: Thu, 25 May 2006 08:39:13 +0100 Subject: [Rxtx] RXTX on Pocket PC Message-ID: <44755F21.8060103@iscte.pt> Hello everyone, I've been using RXTX to communicate with serial ports in Windows and it's been quite successful. However, I'm now considering porting my application from Windows to Pocket PC but I can't seem to find the RXTX binaries (*.jar and *.dll) to use in Pocket PC. I've been "digging" on the mailing list's archives and also on the web and I can't find these anywhere. Can anyone in this mailing list give me some pointers on this? Where can I find the necessary files and basic installation instructions? Thanks very much for your help. I very much appreciate any help that you can provide me. Regards, -- Ant?nio Lopes @contact: antonio.luis at iscte.pt @work: ADETTI - ISCTE @web: http://antonio.lopes.googlepages.com/home From doug at dupreeinc.com Fri May 26 15:45:50 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Fri, 26 May 2006 14:45:50 -0700 Subject: [Rxtx] rxtx slow startup Message-ID: <4477770E.9010400@dupreeinc.com> Hello, I hope there are people still reading this mailing list. The archive appeared to not have anything new after 4/2005. I was using the commapi from sun for a project where a java application reads data from test equipment connected to the serial port. I had to upgrade the ftdi vcp driver on my pc and the old sun commapi no longer works with hardware flow control. as an experiment I replaced the javax.com with gnu.io in the SerialDemo.java project that was included with the commapi. This compiled fine using JBuilder 2006 and JRE 1.5.0_05. RXTX also works with the latest ftdi drivers so life is wonderful again... almost... When using the commapi jar the SerialDemo program starts in about 1 second on my system. Using the RXTX jar it takes over 56 seconds to start. Has anyone else seen this problem? Is there a workaround to get the startup performance close to the old commapi? The last thing printed to the console before this delay is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks for your time! Doug From yhua537 at cse.unsw.edu.au Sat May 27 05:46:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 21:46:45 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <4477770E.9010400@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> Message-ID: hi Doug The archive hasn't been update for a long time, But people certainly still reading the list. I don't have enough experience to help on your problem, but without any detail about what your problem doing during that 56 seconds, it is hard to target the your question, I think. cheers YiQi On Fri, 26 May 2006, Doug Thistlethwaite wrote: > Hello, > > I hope there are people still reading this mailing list. The archive > appeared to not have anything new after 4/2005. > > I was using the commapi from sun for a project where a java application > reads data from test equipment connected to the serial port. I had to > upgrade the ftdi vcp driver on my pc and the old sun commapi no longer > works with hardware flow control. as an experiment I replaced the > javax.com with gnu.io in the SerialDemo.java project that was included > with the commapi. This compiled fine using JBuilder 2006 and JRE > 1.5.0_05. RXTX also works with the latest ftdi drivers so life is > wonderful again... almost... > > When using the commapi jar the SerialDemo program starts in about 1 > second on my system. Using the RXTX jar it takes over 56 seconds to > start. Has anyone else seen this problem? Is there a workaround to get > the startup performance close to the old commapi? > > The last thing printed to the console before this delay is: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Thanks for your time! > > Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------- Just a student, Still a student ------------------------------- From yhua537 at cse.unsw.edu.au Sat May 27 06:04:26 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 22:04:26 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: Sorry, I don't think you could understand what I mean .I mean this: Without any detail about what your program is doing during that 56 seconds, it is hard for anyone to target the problem. On Sat, 27 May 2006, YiQi Huang wrote: > hi Doug > > The archive hasn't been update for a long time, But people certainly still > reading the list. > > I don't have enough experience to help on your problem, but without any > detail about what your problem doing during that 56 seconds, it is hard to > target the your question, I think. > > cheers > YiQi > > On Fri, 26 May 2006, Doug Thistlethwaite wrote: > >> Hello, >> >> I hope there are people still reading this mailing list. The archive >> appeared to not have anything new after 4/2005. >> >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From jredman at ergotech.com Sat May 27 08:32:02 2006 From: jredman at ergotech.com (Jim Redman) Date: Sat, 27 May 2006 08:32:02 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: <447862E2.4080506@ergotech.com> Doug, Since you mentioned it, we have a system that is also seems slow. From memory (I don't have one of the slow systems around), I'm not sure that it's consistent, it seems that sometimes it may take longer than others. Since it's part of the bootup it hasn't raised a flag and I haven't researched it. The same code runs much faster on other systems, so now you've got me wondering what's different. The slow system boots DSL (http://www.damnsmalllinux.org/) from a compact flash. FC4 is on my desktop where I haven't noticed a slow down. I think that the rxtx code is the same in both cases with lock files disabled. The slow system has a bunch of serial ports defined, including 4 USB serial ports that do not exist - they are not plugged in. Any clues in there? Jim > On Fri, 26 May 2006, Doug Thistlethwaite wrote: >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Sat May 27 10:41:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 May 2006 10:41:54 -0600 (MDT) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447862E2.4080506@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: On Sat, 27 May 2006, Jim Redman wrote: > Doug, > > Since you mentioned it, we have a system that is also seems slow. From > memory (I don't have one of the slow systems around), I'm not sure that > it's consistent, it seems that sometimes it may take longer than others. > Since it's part of the bootup it hasn't raised a flag and I haven't > researched it. > > The same code runs much faster on other systems, so now you've got me > wondering what's different. > > The slow system boots DSL (http://www.damnsmalllinux.org/) from a > compact flash. FC4 is on my desktop where I haven't noticed a slow > down. I think that the rxtx code is the same in both cases with lock > files disabled. > > The slow system has a bunch of serial ports defined, including 4 USB > serial ports that do not exist - they are not plugged in. > > Any clues in there? > rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. When it does this, it will try to open each port and do a timed out read. most systems will not have entries in device if the port is not there. But some minimal systems will just put all the device files there in case hardware is added. The list of devices scanned used to be ~10-20 times longer than it is today. That was getting very slow. I suspect moving the device files not used to a backup directory would increase the enumeration. I'll look into why the mail-list archive is not updating. The last update was about when I thought I 'fixed' the cron jobs. I probably didn't actually fix it but rather moved the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon May 29 19:46:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 May 2006 19:46:47 -0600 (MDT) Subject: [Rxtx] Mail-List Archives are updating. Message-ID: It was pointed out earlier that the archive is dated. This was a missing crontab entry. The list is currently archived by the week on the web page. It is updated once a day. So every 7 days it starts a new link and updates it daily. I've been limited in what I could do while my cable modem was disconnected this last week. rxtx.org is something I do on my own time. The patches and credits will be comming next. Many of these can be seen in bugzilla right now. -- Trent Jarvi tjarvi at qbang.org From doug at dupreeinc.com Tue May 30 11:18:41 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 10:18:41 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: <447C7E71.4080204@dupreeinc.com> Trent, YiQi, and Jim: Thanks to all for the replies and information! I am just back from a long weekend and I am now trying to figure out what I was doing! :) As for more information. First off, this example is being run under windows XP. I am developing test equipment that communicates with a java application via a serial port. I have been using the commapi for several years and have not had a problem. Recently, I have started a design modification that will replace the RS232 connection with a USB port. I am using the ftdi module for prototyping and I discovered that their virtual com port driver was not compatible with the commapi that Sun released. It turns out that it has problems with hardware flow control ( it works on incoming but not outgoing communications). The way I figured this out was by experimenting with the SerialDemo that was included with the Sum commapi. One nice thing about this example is it has the ability to set incoming and outgoing flow control independently. After I installed RXTX into my JBuilder 2006 IDE, I just replaced all all instances of javax.comm with gnu.io and it compiled and runs without a hitch (except for the slow startup). I Paused the JBuilder IDE during this long pause and the last few entries in the stack trace are: testRead() : -1, gnu.io.RXTXCommDriver registerValidPorts() : 255, gnu.io.RXTXCommDriver registerScannedPorts() : 777, gnu.io.RXTXCommDriver This was all initiated by the following call in the programs init routine: Enumeration en = CommPortIdentifier.getPortIdentifiers(); After looking at this, My guess is that Trent is correct in that the delay is in scanning for ports. I guess one solution would be to not scan for ports, though it would be nice to detect what is available on the system. Is there any way to reduce the number of ports scanned by this function in windows XP? Thanks again for your time, Doug Trent Jarvi wrote: >On Sat, 27 May 2006, Jim Redman wrote: > > > >>Doug, >> >>Since you mentioned it, we have a system that is also seems slow. From >>memory (I don't have one of the slow systems around), I'm not sure that >>it's consistent, it seems that sometimes it may take longer than others. >>Since it's part of the bootup it hasn't raised a flag and I haven't >>researched it. >> >>The same code runs much faster on other systems, so now you've got me >>wondering what's different. >> >>The slow system boots DSL (http://www.damnsmalllinux.org/) from a >>compact flash. FC4 is on my desktop where I haven't noticed a slow >>down. I think that the rxtx code is the same in both cases with lock >>files disabled. >> >>The slow system has a bunch of serial ports defined, including 4 USB >>serial ports that do not exist - they are not plugged in. >> >>Any clues in there? >> >> >> > >rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. > >When it does this, it will try to open each port and do a timed out read. >most systems will not have entries in device if the port is not there. >But some minimal systems will just put all the device files there in case >hardware is added. > >The list of devices scanned used to be ~10-20 times longer than it is >today. That was getting very slow. > >I suspect moving the device files not used to a backup directory would >increase the enumeration. > >I'll look into why the mail-list archive is not updating. The last update >was about when I thought I 'fixed' the cron jobs. I probably didn't >actually fix it but rather moved the problem. > >-- >Trent Jarvi >tjarvi at qbang.org > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/86796453/attachment-0396.html From doug at dupreeinc.com Tue May 30 14:36:09 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 13:36:09 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447C7E71.4080204@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com> Message-ID: <447CACB9.1000801@dupreeinc.com> Hello all, I also notice this pause (not as long however) when I call: CommPortIdentifier.getPortIdentifier(PortName); I would think that if I supply the name of the port, it would not have to go through the same discovery process. If you have any ideas of how to get rid of this startup delay, I would really appreciate it. Thanks, Doug Doug Thistlethwaite wrote: > Trent, YiQi, and Jim: > > Thanks to all for the replies and information! I am just back from a > long weekend and I am now trying to figure out what I was doing! :) > > As for more information. First off, this example is being run under > windows XP. I am developing test equipment that communicates with a > java application via a serial port. I have been using the commapi for > several years and have not had a problem. Recently, I have started a > design modification that will replace the RS232 connection with a USB > port. I am using the ftdi module for prototyping and I discovered > that their virtual com port driver was not compatible with the commapi > that Sun released. It turns out that it has problems with hardware > flow control ( it works on incoming but not outgoing communications). > The way I figured this out was by experimenting with the SerialDemo > that was included with the Sum commapi. One nice thing about this > example is it has the ability to set incoming and outgoing flow > control independently. > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup). > > I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are: > > testRead() : -1, gnu.io.RXTXCommDriver > registerValidPorts() : 255, gnu.io.RXTXCommDriver > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > This was all initiated by the following call in the programs init routine: > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > After looking at this, My guess is that Trent is correct in that the > delay is in scanning for ports. I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system. Is there any way to reduce the number of ports scanned by > this function in windows XP? > > Thanks again for your time, > > Doug > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/edaa5c3c/attachment-0396.html From lynn at swcp.com Tue May 30 15:07:18 2006 From: lynn at swcp.com (lynn@swcp.com) Date: Tue, 30 May 2006 21:07:18 -0000 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CACB9.1000801@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: *IF* the name of the port is supplied, we might want to use the preferences mechanism (java.util.prefs) where we could have previously saved the info for the port. We could do a quick check to see that things have not changed before using it. If things have changed (or never been defined) we would do a full port scan and save detected ports in the preferences. This way if the hardware is not changed, you only pay the time penalty one time. just an idea... Lynn Doug Thistlethwaite said: > This is a multi-part message in MIME format. > --------------070808020900080005070500 > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > Content-Transfer-Encoding: 7bit > > Hello all, > > I also notice this pause (not as long however) when I call: > > CommPortIdentifier.getPortIdentifier(PortName); > > I would think that if I supply the name of the port, it would not have > to go through the same discovery process. If you have any ideas of how > to get rid of this startup delay, I would really appreciate it. > > Thanks, > > Doug > > Doug Thistlethwaite wrote: > > > Trent, YiQi, and Jim: > > > > Thanks to all for the replies and information! I am just back from a > > long weekend and I am now trying to figure out what I was doing! :) > > > > As for more information. First off, this example is being run under > > windows XP. I am developing test equipment that communicates with a > > java application via a serial port. I have been using the commapi for > > several years and have not had a problem. Recently, I have started a > > design modification that will replace the RS232 connection with a USB > > port. I am using the ftdi module for prototyping and I discovered > > that their virtual com port driver was not compatible with the commapi > > that Sun released. It turns out that it has problems with hardware > > flow control ( it works on incoming but not outgoing communications). > > The way I figured this out was by experimenting with the SerialDemo > > that was included with the Sum commapi. One nice thing about this > > example is it has the ability to set incoming and outgoing flow > > control independently. > > > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > > all instances of javax.comm with gnu.io and it compiled and runs > > without a hitch (except for the slow startup). > > > > I Paused the JBuilder IDE during this long pause and the last few > > entries in the stack trace are: > > > > testRead() : -1, gnu.io.RXTXCommDriver > > registerValidPorts() : 255, gnu.io.RXTXCommDriver > > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > > > This was all initiated by the following call in the programs init routine: > > > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > > > After looking at this, My guess is that Trent is correct in that the > > delay is in scanning for ports. I guess one solution would be to not > > scan for ports, though it would be nice to detect what is available on > > the system. Is there any way to reduce the number of ports scanned by > > this function in windows XP? > > > > Thanks again for your time, > > > > Doug > > > > --------------070808020900080005070500 > Content-Type: text/html; charset=ISO-8859-1 > Content-Transfer-Encoding: 7bit > > > > > > > > > Hello all,
>
> I also notice this pause (not as long however) when I call:
>
>          CommPortIdentifier.getPortIdentifier(PortName);
>
> I would think that if I supply the name of the port, it would not have > to go through the same discovery process.  If you have any ideas of how > to get rid of this startup delay, I would really appreciate it.
>
> Thanks,
>
> Doug
>
> Doug Thistlethwaite wrote: >
> > Trent, YiQi, and Jim:
>
> Thanks to all for the replies and information!  I am just back from a > long weekend and I am now trying to figure out what I was doing! :)
>
> As for more information.  First off, this example is being run under > windows XP.  I am developing test equipment that communicates with a > java application via a serial port.  I have been using the commapi for > several years and have not had a problem.  Recently, I have started a > design modification that will replace the RS232 connection with a USB > port.  I am using the ftdi module for prototyping and I discovered that > their virtual com port driver was not compatible with the commapi that > Sun released.  It turns out that it has problems with hardware flow > control ( it works on incoming but not outgoing communications).  The > way I figured this out was by experimenting with the SerialDemo that > was included with the Sum commapi.  One nice thing about this example > is it has the ability to set incoming and outgoing flow control > independently.
>
> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup).
>
> I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are:
>
> testRead() : -1, gnu.io.RXTXCommDriver
> registerValidPorts() : 255, gnu.io.RXTXCommDriver
> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>
> This was all initiated by the following call in the programs init > routine:
>
> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>
> After looking at this,  My guess is that Trent is correct in that the > delay is in scanning for ports.  I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system.  Is there any way to reduce the number of ports scanned by > this function in windows XP? 
>
> Thanks again for your time,
>
> Doug
>
>
> > > > --------------070808020900080005070500-- > -- From jredman at ergotech.com Tue May 30 15:42:35 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 30 May 2006 15:42:35 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: <447CBC4B.2080206@ergotech.com> Lynn, If I understand your idea correctly, I don't think that this would work well for, say, USB ports since these can be easily added/removed by the end user. Jim lynn at swcp.com wrote: > *IF* the name of the port is supplied, we might want to use the preferences > mechanism (java.util.prefs) where we could have previously saved the info for > the port. We could do a quick check to see that things have not changed > before using it. If things have changed (or never been defined) we would do a > full port scan and save detected ports in the preferences. > > This way if the hardware is not changed, you only pay the time penalty one time. > > just an idea... > Lynn > > > Doug Thistlethwaite said: > >> This is a multi-part message in MIME format. >> --------------070808020900080005070500 >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >> Content-Transfer-Encoding: 7bit >> >> Hello all, >> >> I also notice this pause (not as long however) when I call: >> >> CommPortIdentifier.getPortIdentifier(PortName); >> >> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process. If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it. >> >> Thanks, >> >> Doug >> >> Doug Thistlethwaite wrote: >> >>> Trent, YiQi, and Jim: >>> >>> Thanks to all for the replies and information! I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :) >>> >>> As for more information. First off, this example is being run under >>> windows XP. I am developing test equipment that communicates with a >>> java application via a serial port. I have been using the commapi for >>> several years and have not had a problem. Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port. I am using the ftdi module for prototyping and I discovered >>> that their virtual com port driver was not compatible with the commapi >>> that Sun released. It turns out that it has problems with hardware >>> flow control ( it works on incoming but not outgoing communications). >>> The way I figured this out was by experimenting with the SerialDemo >>> that was included with the Sum commapi. One nice thing about this >>> example is it has the ability to set incoming and outgoing flow >>> control independently. >>> >>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup). >>> >>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are: >>> >>> testRead() : -1, gnu.io.RXTXCommDriver >>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>> >>> This was all initiated by the following call in the programs init routine: >>> >>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>> >>> After looking at this, My guess is that Trent is correct in that the >>> delay is in scanning for ports. I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system. Is there any way to reduce the number of ports scanned by >>> this function in windows XP? >>> >>> Thanks again for your time, >>> >>> Doug >>> >> --------------070808020900080005070500 >> Content-Type: text/html; charset=ISO-8859-1 >> Content-Transfer-Encoding: 7bit >> >> >> >> >> >> >> >> >> Hello all,
>>
>> I also notice this pause (not as long however) when I call:
>>
>>         >  CommPortIdentifier.getPortIdentifier(PortName);
>>
>> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process.  If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it.
>>
>> Thanks,
>>
>> Doug
>>
>> Doug Thistlethwaite wrote: >>
>> >> Trent, YiQi, and Jim:
>>
>> Thanks to all for the replies and information!  I am just back from a >> long weekend and I am now trying to figure out what I was doing! :)
>>
>> As for more information.  First off, this example is being run under >> windows XP.  I am developing test equipment that communicates with a >> java application via a serial port.  I have been using the commapi for >> several years and have not had a problem.  Recently, I have started a >> design modification that will replace the RS232 connection with a USB >> port.  I am using the ftdi module for prototyping and I discovered that >> their virtual com port driver was not compatible with the commapi that >> Sun released.  It turns out that it has problems with hardware flow >> control ( it works on incoming but not outgoing communications).  The >> way I figured this out was by experimenting with the SerialDemo that >> was included with the Sum commapi.  One nice thing about this example >> is it has the ability to set incoming and outgoing flow control >> independently.
>>
>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >> all instances of javax.comm with gnu.io and it compiled and runs >> without a hitch (except for the slow startup).
>>
>> I Paused the JBuilder IDE during this long pause and the last few >> entries in the stack trace are:
>>
>> testRead() : -1, gnu.io.RXTXCommDriver
>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>
>> This was all initiated by the following call in the programs init >> routine:
>>
>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>
>> After looking at this,  My guess is that Trent is correct in that the >> delay is in scanning for ports.  I guess one solution would be to not >> scan for ports, though it would be nice to detect what is available on >> the system.  Is there any way to reduce the number of ports scanned by >> this function in windows XP? 
>>
>> Thanks again for your time,
>>
>> Doug
>>
>>
>> >> >> >> --------------070808020900080005070500-- >> > > > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From yhua537 at cse.unsw.edu.au Tue May 30 18:10:23 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 31 May 2006 10:10:23 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CBC4B.2080206@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: Doug, In the SerialDemo, it allow us to save the parameters into a file, and use it when your program start up. Would this help? YiQi On Tue, 30 May 2006, Jim Redman wrote: > Lynn, > > If I understand your idea correctly, I don't think that this would work > well for, say, USB ports since these can be easily added/removed by the > end user. > > Jim > > lynn at swcp.com wrote: >> *IF* the name of the port is supplied, we might want to use the preferences >> mechanism (java.util.prefs) where we could have previously saved the info for >> the port. We could do a quick check to see that things have not changed >> before using it. If things have changed (or never been defined) we would do a >> full port scan and save detected ports in the preferences. >> >> This way if the hardware is not changed, you only pay the time penalty one time. >> >> just an idea... >> Lynn >> >> >> Doug Thistlethwaite said: >> >>> This is a multi-part message in MIME format. >>> --------------070808020900080005070500 >>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>> Content-Transfer-Encoding: 7bit >>> >>> Hello all, >>> >>> I also notice this pause (not as long however) when I call: >>> >>> CommPortIdentifier.getPortIdentifier(PortName); >>> >>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process. If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it. >>> >>> Thanks, >>> >>> Doug >>> >>> Doug Thistlethwaite wrote: >>> >>>> Trent, YiQi, and Jim: >>>> >>>> Thanks to all for the replies and information! I am just back from a >>>> long weekend and I am now trying to figure out what I was doing! :) >>>> >>>> As for more information. First off, this example is being run under >>>> windows XP. I am developing test equipment that communicates with a >>>> java application via a serial port. I have been using the commapi for >>>> several years and have not had a problem. Recently, I have started a >>>> design modification that will replace the RS232 connection with a USB >>>> port. I am using the ftdi module for prototyping and I discovered >>>> that their virtual com port driver was not compatible with the commapi >>>> that Sun released. It turns out that it has problems with hardware >>>> flow control ( it works on incoming but not outgoing communications). >>>> The way I figured this out was by experimenting with the SerialDemo >>>> that was included with the Sum commapi. One nice thing about this >>>> example is it has the ability to set incoming and outgoing flow >>>> control independently. >>>> >>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>> all instances of javax.comm with gnu.io and it compiled and runs >>>> without a hitch (except for the slow startup). >>>> >>>> I Paused the JBuilder IDE during this long pause and the last few >>>> entries in the stack trace are: >>>> >>>> testRead() : -1, gnu.io.RXTXCommDriver >>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>> >>>> This was all initiated by the following call in the programs init routine: >>>> >>>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>> >>>> After looking at this, My guess is that Trent is correct in that the >>>> delay is in scanning for ports. I guess one solution would be to not >>>> scan for ports, though it would be nice to detect what is available on >>>> the system. Is there any way to reduce the number of ports scanned by >>>> this function in windows XP? >>>> >>>> Thanks again for your time, >>>> >>>> Doug >>>> >>> --------------070808020900080005070500 >>> Content-Type: text/html; charset=ISO-8859-1 >>> Content-Transfer-Encoding: 7bit >>> >>> >>> >>> >>> >>> >>> >>> >>> Hello all,
>>>
>>> I also notice this pause (not as long however) when I call:
>>>
>>>         >>  CommPortIdentifier.getPortIdentifier(PortName);
>>>
>>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process.  If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it.
>>>
>>> Thanks,
>>>
>>> Doug
>>>
>>> Doug Thistlethwaite wrote: >>>
>>> >>> Trent, YiQi, and Jim:
>>>
>>> Thanks to all for the replies and information!  I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :)
>>>
>>> As for more information.  First off, this example is being run under >>> windows XP.  I am developing test equipment that communicates with a >>> java application via a serial port.  I have been using the commapi for >>> several years and have not had a problem.  Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port.  I am using the ftdi module for prototyping and I discovered that >>> their virtual com port driver was not compatible with the commapi that >>> Sun released.  It turns out that it has problems with hardware flow >>> control ( it works on incoming but not outgoing communications).  The >>> way I figured this out was by experimenting with the SerialDemo that >>> was included with the Sum commapi.  One nice thing about this example >>> is it has the ability to set incoming and outgoing flow control >>> independently.
>>>
>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup).
>>>
>>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are:
>>>
>>> testRead() : -1, gnu.io.RXTXCommDriver
>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>
>>> This was all initiated by the following call in the programs init >>> routine:
>>>
>>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>
>>> After looking at this,  My guess is that Trent is correct in that the >>> delay is in scanning for ports.  I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system.  Is there any way to reduce the number of ports scanned by >>> this function in windows XP? 
>>>
>>> Thanks again for your time,
>>>
>>> Doug
>>>
>>>
>>> >>> >>> >>> --------------070808020900080005070500-- >>> >> >> >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From halbleib at rechnerbetriebsgruppe.de Wed May 31 02:06:16 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 10:06:16 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp Message-ID: <447D4E78.30302@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, I getting an error while reloading my app in tomcat. At the first start everything runs well, but if i reload mit webapp by tomcat manager i get the following error. java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader Is there a possibility to unload the native library rxtxSerial.dll? thx for all help! regards tom -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 b8FT80HQ1xlbDLnRecDANCc= =heb1 -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 02:52:17 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 10:52:17 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D4E78.30302@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> Message-ID: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Hello Tom, To the best of my knowledge it is impossible to unload native libraries once loaded into the JVM. The exception you see stems from the fact, that Tomcat creates a new classloader when you "reload" the weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar is loaded from the session class loader. Try to add RXTXComm.jar to your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. Regards, Joachim On 31.05.2006, at 10:06, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 > b8FT80HQ1xlbDLnRecDANCc= > =heb1 > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From halbleib at rechnerbetriebsgruppe.de Wed May 31 03:28:35 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 11:28:35 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Message-ID: <447D61C3.1030807@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Joachim, I'm still not getting it. How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml-file? Perhaps web.xml? Regards, Tom Joachim Buechse schrieb: > Hello Tom, > > To the best of my knowledge it is impossible to unload native > libraries once loaded into the JVM. The exception you see stems from > the fact, that Tomcat creates a new classloader when you "reload" the > weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar > is loaded from the session class loader. Try to add RXTXComm.jar to > your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. > > Regards, > Joachim > > On 31.05.2006, at 10:06, Tom Halbleib wrote: > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL tzNy+/0iIUfkYYgt1+UT1ko= =pkpY -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 04:03:42 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 12:03:42 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D61C3.1030807@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> <447D61C3.1030807@rechnerbetriebsgruppe.de> Message-ID: -Xbootclasspath/a: is a start option to the java vm. Google is your friend in finding how to modfiy it and what it means: tomcat modifying bootclasspath Regards, Joachim On 31.05.2006, at 11:28, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Joachim, > > I'm still not getting it. > How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml- > file? > Perhaps web.xml? > > Regards, > Tom > > Joachim Buechse schrieb: >> Hello Tom, >> >> To the best of my knowledge it is impossible to unload native >> libraries once loaded into the JVM. The exception you see stems from >> the fact, that Tomcat creates a new classloader when you "reload" the >> weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar >> is loaded from the session class loader. Try to add RXTXComm.jar to >> your bootlclasspath (-Xbootclasspath/a:) and the problem should go >> away. >> >> Regards, >> Joachim >> >> On 31.05.2006, at 10:06, Tom Halbleib wrote: >> >> Hi all, >> >> I getting an error while reloading my app in tomcat. At the first >> start >> everything runs well, but if i reload mit webapp by tomcat manager >> i get >> the following error. >> >> java.lang.UnsatisfiedLinkError: Native Library >> C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in >> another classloader thrown while loading gnu.io.RXTXCommDriver >> Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: >> Native >> Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already >> loaded >> in another classloader >> >> >> Is there a possibility to unload the native library rxtxSerial.dll? >> >> thx for all help! >> >> regards >> >> tom > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL > tzNy+/0iIUfkYYgt1+UT1ko= > =pkpY > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From impakt01 at optusnet.com.au Wed May 31 06:55:42 2006 From: impakt01 at optusnet.com.au (Daren) Date: Wed, 31 May 2006 22:55:42 +1000 Subject: [Rxtx] (no subject) Message-ID: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/ade7ad37/attachment-0396.html From doug at dupreeinc.com Wed May 31 10:19:19 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 31 May 2006 09:19:19 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: <447DC207.3070702@dupreeinc.com> I am not sure what you are saying. The Save parameters menu option saves the current settings (baud, data bits, etc.). The long pause (~60 seconds) is when the application first starts (before loading the saved parameters). This does bring up a question, though I hate this type of kludge approach to getting this library to work... What exactly is a PortIdentifier? Is it always the same? If I stored the results from "CommPortIdentifier.getPortIdentifier(PortName);" in a file, could I use this the next time the program is executed? In this case I am using a virtual com port driver to connect to the device through a USB port. Doug YiQi Huang wrote: >Doug, > >In the SerialDemo, it allow us to save the parameters into a file, and use >it when your program start up. Would this help? > >YiQi > >On Tue, 30 May 2006, Jim Redman wrote: > > > >>Lynn, >> >>If I understand your idea correctly, I don't think that this would work >>well for, say, USB ports since these can be easily added/removed by the >>end user. >> >>Jim >> >>lynn at swcp.com wrote: >> >> >>>*IF* the name of the port is supplied, we might want to use the preferences >>>mechanism (java.util.prefs) where we could have previously saved the info for >>>the port. We could do a quick check to see that things have not changed >>>before using it. If things have changed (or never been defined) we would do a >>>full port scan and save detected ports in the preferences. >>> >>>This way if the hardware is not changed, you only pay the time penalty one time. >>> >>>just an idea... >>>Lynn >>> >>> >>>Doug Thistlethwaite said: >>> >>> >>> >>>>This is a multi-part message in MIME format. >>>>--------------070808020900080005070500 >>>>Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>>>Content-Transfer-Encoding: 7bit >>>> >>>>Hello all, >>>> >>>>I also notice this pause (not as long however) when I call: >>>> >>>> CommPortIdentifier.getPortIdentifier(PortName); >>>> >>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process. If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it. >>>> >>>>Thanks, >>>> >>>>Doug >>>> >>>>Doug Thistlethwaite wrote: >>>> >>>> >>>> >>>>>Trent, YiQi, and Jim: >>>>> >>>>>Thanks to all for the replies and information! I am just back from a >>>>>long weekend and I am now trying to figure out what I was doing! :) >>>>> >>>>>As for more information. First off, this example is being run under >>>>>windows XP. I am developing test equipment that communicates with a >>>>>java application via a serial port. I have been using the commapi for >>>>>several years and have not had a problem. Recently, I have started a >>>>>design modification that will replace the RS232 connection with a USB >>>>>port. I am using the ftdi module for prototyping and I discovered >>>>>that their virtual com port driver was not compatible with the commapi >>>>>that Sun released. It turns out that it has problems with hardware >>>>>flow control ( it works on incoming but not outgoing communications). >>>>>The way I figured this out was by experimenting with the SerialDemo >>>>>that was included with the Sum commapi. One nice thing about this >>>>>example is it has the ability to set incoming and outgoing flow >>>>>control independently. >>>>> >>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>>without a hitch (except for the slow startup). >>>>> >>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>>entries in the stack trace are: >>>>> >>>>>testRead() : -1, gnu.io.RXTXCommDriver >>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>>> >>>>>This was all initiated by the following call in the programs init routine: >>>>> >>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>>> >>>>>After looking at this, My guess is that Trent is correct in that the >>>>>delay is in scanning for ports. I guess one solution would be to not >>>>>scan for ports, though it would be nice to detect what is available on >>>>>the system. Is there any way to reduce the number of ports scanned by >>>>>this function in windows XP? >>>>> >>>>>Thanks again for your time, >>>>> >>>>>Doug >>>>> >>>>> >>>>> >>>>--------------070808020900080005070500 >>>>Content-Type: text/html; charset=ISO-8859-1 >>>>Content-Transfer-Encoding: 7bit >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>>Hello all,
>>>>
>>>>I also notice this pause (not as long however) when I call:
>>>>
>>>>        >>>> >>>> >>> CommPortIdentifier.getPortIdentifier(PortName);
>>> >>> >>>>
>>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process.  If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it.
>>>>
>>>>Thanks,
>>>>
>>>>Doug
>>>>
>>>>Doug Thistlethwaite wrote: >>>>
>>>> >>>>Trent, YiQi, and Jim:
>>>>
>>>>Thanks to all for the replies and information!  I am just back from a >>>>long weekend and I am now trying to figure out what I was doing! :)
>>>>
>>>>As for more information.  First off, this example is being run under >>>>windows XP.  I am developing test equipment that communicates with a >>>>java application via a serial port.  I have been using the commapi for >>>>several years and have not had a problem.  Recently, I have started a >>>>design modification that will replace the RS232 connection with a USB >>>>port.  I am using the ftdi module for prototyping and I discovered that >>>>their virtual com port driver was not compatible with the commapi that >>>>Sun released.  It turns out that it has problems with hardware flow >>>>control ( it works on incoming but not outgoing communications).  The >>>>way I figured this out was by experimenting with the SerialDemo that >>>>was included with the Sum commapi.  One nice thing about this example >>>>is it has the ability to set incoming and outgoing flow control >>>>independently.
>>>>
>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>without a hitch (except for the slow startup).
>>>>
>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>entries in the stack trace are:
>>>>
>>>>testRead() : -1, gnu.io.RXTXCommDriver
>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>>
>>>>This was all initiated by the following call in the programs init >>>>routine:
>>>>
>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>>
>>>>After looking at this,  My guess is that Trent is correct in that the >>>>delay is in scanning for ports.  I guess one solution would be to not >>>>scan for ports, though it would be nice to detect what is available on >>>>the system.  Is there any way to reduce the number of ports scanned by >>>>this function in windows XP? 
>>>>
>>>>Thanks again for your time,
>>>>
>>>>Doug
>>>>
>>>>
>>>> >>>> >>>> >>>>--------------070808020900080005070500-- >>>> >>>> >>>> >>> >>> >>> >>-- >>Jim Redman >>(505) 662 5156 x85 >>http://www.ergotech.com >>_______________________________________________ >>Rxtx mailing list >>Rxtx at qbang.org >>http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > >cheers >YiQi Huang >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/61d4d4c9/attachment-0395.html From impakt01 at optusnet.com.au Wed May 31 17:02:54 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 09:02:54 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Message-ID: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Hi all, I downloaded 2.1.7-pre16 and managed to build it and get it going. I made the changes as suggested by Peter Smith in an old post, by adding his code to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. Still not working, it opens the port at 9600 according to portmon.exe . Has anyone managed to get this going at a custom rate? Here is the post I'm referring to: http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 Thanks, Daren ________________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Daren Sent: Wednesday, 31 May 2006 10:56 PM To: rxtx at qbang.org Subject: [Rxtx] (no subject) Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren From tjarvi at qbang.org Wed May 31 21:44:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 May 2006 21:44:01 -0600 (MDT) Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> References: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Message-ID: On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org From impakt01 at optusnet.com.au Wed May 31 22:06:04 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 14:06:04 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: Message-ID: <200606010406.k51464X2010447@mail03.syd.optusnet.com.au> Trent, I have managed to successfully open the port at this speed using Realterm (available on sourceforge). From memory this uses DLPortIO. Using portmon.exe with realterm, even there it says that the port has opened at 1953. I changed termios.c:560 to dcb->BaudRate = 1953 ; and it still opens the port at 9600. Daren -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Thursday, 1 June 2006 1:44 PM To: RXTX Developers and Users Subject: Re: [Rxtx] custom baud rate win32 On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From smontgomery at mediaspansoftware.com Mon May 1 09:52:28 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 11:52:28 -0400 Subject: [Rxtx] RXTX, Java COMM and Windows Server 2003 on x64 experiences? Message-ID: Just wondering if anybody here has had to deploy RXTX or the javax.comm on Windows Server 2003 machines running on x64 (i.e. Xeon EM64T) and would like to relate how things went. From Sun's site, the Supported System Configurations pages give the options for that system: Java 5.0: - 32-bit Java 5.0 running on the OS in the 32-bit mode - 64-bit Java 5.0 running on the OS in the 64-bit native mode Java 1.4.2: - no options listed for EM64T processors, but potentially the standard 32-bit Java 1.4.2 could run on the OS in 32-bit mode? I guess the two main points of failure would be 1) the JVM itself and 2) the jni components. Make that three: there's gotta be hardware vendor driver support for the OS in the various modes, too. Guess I better go look at Keyspan's website... Thanks in advance for any info anyone might be able to provide. From smontgomery at mediaspansoftware.com Mon May 1 10:18:33 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 12:18:33 -0400 Subject: [Rxtx] Mailing list archive out of date? Message-ID: The mailing list archive at: http://mailman.qbang.org/pipermail/rxtx/ only shows emails through the end of March. Is there a new archive somewhere else? Didn't see anything mentioned on the wiki. From p.cain at phasefale.com.au Mon May 1 22:33:09 2006 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 02 May 2006 14:33:09 +1000 Subject: [Rxtx] RXTX and the Linux kernel. Message-ID: <4456E105.5080106@phasefale.com.au> Hi, First off the problem I am having isn't caused by RXTX itself but I'm hoping someone out there may have some knowledge that may help me. Background: I have an application monitoring a control system through a standard PC serial port which I talk to with rxtx-2.0.5. The application runs on RedHat7.3 kernel version 2.4.18 using Java 1.4. This configuration has been in use for several years and has proved to be stable. But it has become necessary for me to upgrade the OS but I'm running into problems with the serial communications. Its not that the comms don't work on the new OS (its never that simple) the comms work for a variable period of time (sometimes several hours) and then just stop, nothing on the data lines and control lines all indicate that data could flow. The new OS is Ubuntu 5.10 running kernel version 2.6.12. I have installed the OS and software on a PC and had it perform ok, then install the new OS and same software on the very same hardware and experienced the problems of them comms stopping. In the new OS I'm using Java5 to run the app but since I have experience the problem I reverted back to Java1.4 which didn't fix the problem. I've moved the app to a different system RedHat FC3 running 2.6.14 had experienced the problem. Not wanting to go through all the thing I have tried but I have established that it seems to be the 2.6 versions of the kernel that seem to be the problem and not an individual distribution of Linux. I should point out that I am using the same jar and library files for each java and OS combination. So I'm just wondering if anyone has had or heard of problems similar to these ? Or perhaps might know of what changed in the Linux serial driver (something I'm having a hard time establishing). I'm starting to run low on ideas of what to try so any help would be much appreciated. -- Peter Cain Senior Programmer Phasefale Pty Ltd From tjarvi at qbang.org Wed May 3 07:31:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 May 2006 07:31:00 -0600 (MDT) Subject: [Rxtx] Re: Concering ircomm and RXTX In-Reply-To: References: Message-ID: On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From legolas.w at gmail.com Wed May 3 08:46:23 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 19:16:23 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <4458C23F.2000003@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From legolas.w at gmail.com Wed May 3 13:10:57 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 23:40:57 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <44590041.80706@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From Lars.Hennig at wow-portal.com Thu May 4 00:39:15 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Thu, 4 May 2006 08:39:15 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: Message-ID: Hi, I could not find any solution. I therefore decided to to my own native implementation. Allthough it only supports the functions I need, it works pretty well now for me. I think the main problem there is the use of a wrong Windows API function and not setting an timeout. Regards, Lars Hennig W?rth Online World GmbH Tel. (0049)7181-258183 Mob. (0049)160-3522889 Fax. (0049)7940-153299 Lars.Hennig at wow-portal.com Gesendet von: rxtx-bounces at qbang.org 09.04.2006 10:42 Bitte antworten zu RXTX Developers and Users An d.herwald at dsh-elektronik.de, RXTX Developers and Users Kopie Thema Re: [Rxtx] USB Serialport - disconnection problems WV Proj./Teilpr.: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/7b39f374/attachment-0400.html From Pawan.Kharbanda at dot.state.co.us Thu May 4 11:00:58 2006 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Thu, 4 May 2006 11:00:58 -0600 Subject: [Rxtx] Dangling Lock Files Message-ID: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Hi, I have been using RXTX API's for the Serial Communication for quite some time now and for some of the devices we are opening and closing the connection every 2 minutes. This works great for few days and then suddenly I start seeing some "Port in Use Exception" and I see that the Lock files are still in the /var/lock folder after manually removing the lock files it works good for few hours and I see the same problem again. Can somebody explain me the scenarios why I am seeing the dangling Lock files? I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise Servers. Thanks Pawan Kharbanda -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/ba0e9261/attachment-0400.html From tjarvi at qbang.org Thu May 4 14:10:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:10:30 -0600 (MDT) Subject: [Rxtx] Dangling Lock Files In-Reply-To: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> References: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Message-ID: On Thu, 4 May 2006, Kharbanda, Pawan wrote: > Hi, > I have been using RXTX API's for the Serial Communication for quite > some time now and for some of the devices we are opening and closing the > connection every 2 minutes. This works great for few days and then > suddenly I start seeing some "Port in Use Exception" and I see that the > Lock files are still in the /var/lock folder after manually removing the > lock files it works good for few hours and I see the same problem again. > Can somebody explain me the scenarios why I am seeing the dangling Lock > files? > > I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise > Servers. Hi Pawan The next time it happens, look in the lockfile. There will be a pid. ps aux |grep 'pid' I think you will see that the application is still running for some reason. RXTX does a kill -0 on the pid to see if its alive. If not, it will remove the lockfile. So I suspect the previous program did not exit as you expected. -- Trent Jarvi tjarvi at qbang.org From Scott.Hughes at dalsemi.com Thu May 4 14:23:11 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 4 May 2006 15:23:11 -0500 Subject: [Rxtx] Wiki instructions... Message-ID: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire demo apps, when I stumbled across this tip on the wiki to add yourself to the uucp group: It may be simpler to just run usermod -G uucp jarvi Taken from: http://rxtx.qbang.org/wiki/index.php/Installation This does not work as advertised. I should have read the man page for usermod before I tried that out. If there are any groups which are not listed after the -G switch, the user is removed from those groups. On Ubuntu, this is bad... I removed myself from the Admin group, which removed my sudo priviledges. Ubuntu has no root account, so I've disabled the only account which could fix it. Anyone know of a good workaround? Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor From tjarvi at qbang.org Thu May 4 14:32:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:32:09 -0600 (MDT) Subject: [Rxtx] Wiki instructions... In-Reply-To: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> Message-ID: On Thu, 4 May 2006, Scott Hughes wrote: > I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire > demo apps, when I stumbled across this tip on the wiki to add yourself to > the uucp group: > > It may be simpler to just run > > usermod -G uucp jarvi > > Taken from: > http://rxtx.qbang.org/wiki/index.php/Installation > > This does not work as advertised. I should have read the man page for > usermod before I tried that out. If there are any groups which are not > listed after the -G switch, the user is removed from those groups. On > Ubuntu, this is bad... I removed myself from the Admin group, which removed > my sudo priviledges. Ubuntu has no root account, so I've disabled the only > account which could fix it. > > Anyone know of a good workaround? > Yikes This will get your permissions back: in grub/lilo/.. pass the following option to the kernel init=/bin/sh You are now root. when it boots, mount -o remount,rw / add yourself to the groups, reboot to get normal init going. Thats about all I can think of without sudo/root. -- Trent Jarvi tjarvi at qbang.org From Gettings at earth.utah.edu Thu May 4 14:41:22 2006 From: Gettings at earth.utah.edu (Paul Gettings) Date: Thu, 4 May 2006 14:41:22 -0600 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <20060504204122.GA6534@earth.utah.edu> When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get messages on stdout from the JVM: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 As the only change was the version of RXTX (from 2.1.6), I am unsure why the messages suddenly appeared. Anyone know how to get rid of them? Thanks. -- 101 USES FOR A DEAD MICROPROCESSOR (23) Dead cat brush From mmester at sps.edu Mon May 1 21:22:28 2006 From: mmester at sps.edu (Michael Mester) Date: Mon, 1 May 2006 23:22:28 -0400 Subject: [Rxtx] Windows PortInUseException Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> I'm trying to get simple serial communication going with RxTx under Windows XP. I can enumerate the ports fine, but I always run into problems when I try to open one. I get a PortInUseException, but the owner application is "Unknown" and the port is never open. I've tried this on several different systems and all of them give the same behavior. The only thing I can thiunk of that might be causing the problem is that fact that I had to put the serial .dll file in system32 instead of the reccommended folder, because it didn't work in the folder the documentation gives. The library loads fine, though, so I'm not sure whether that makes sense, and I don't know how to fix it anyway. Any help is greatly appreciated. Below is the output of the program, right up to the PortInUseException and the NullPointerException it causes (because the serial port object is not instantiated). C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI Starting GPSTalkerGUI... Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 gnu.io.PortInUseException: Unknown Application Exception in thread "main" java.lang.NullPointerException at GPSTalkerGUI.(GPSTalkerGUI.java:102) at GPSTalkerGUI.main(GPSTalkerGUI.java:161) Again, thank you very much for any help you can give. From lshellman at qwest.net Wed May 3 01:38:34 2006 From: lshellman at qwest.net (Lucious Shellman) Date: Wed, 03 May 2006 01:38:34 -0600 Subject: [Rxtx] Help needed: Project using parallel port Message-ID: <1146641914.8337.14.camel@localhost.localdomain> I was looking for a way to access the parallel port on a PC using Java. Searching the Internet, I came across this site (rxtx.org). What I am trying to do is detect logic levels from a TTL logic IC on the parallel port. I am not trying to do classic parallel port communication. I just want to detect whether a line(s) is (are) high or low. I am using Windows 98. Can rxtx be used to do this? If yes, is there a tutorial for using rxtx posted on the Internet that someone can direct me to. If you need more information, feel free to e-mail me. Unfortunately for me, I need the information ASAP. Thanks. lshellman at qwest.net From webmaster at egyhelp.com Wed May 3 18:43:39 2006 From: webmaster at egyhelp.com (Mohamed Samy) Date: Thu, 4 May 2006 02:43:39 +0200 Subject: [Rxtx] RE: Concering ircomm and RXTX In-Reply-To: Message-ID: <20060503184362.SM01044@Geek> Hey, I issue the command "modprobe ircomm-tty" yet no ttyircomm appears, while the ircomm appear by "modprobe ircomm" so forgive me but I am bit lost. Even searching google for the keyword "ttyircomm" only returns 3 matches. So any way I can start the ttyircomm???? Thanks a lot. -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Wednesday, May 03, 2006 3:31 PM To: Mohamed Samy; rxtx at qbang.org Cc: taj at www.linux.org.uk Subject: Re: Concering ircomm and RXTX On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 4 15:49:49 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 15:49:49 -0600 (MDT) Subject: [Rxtx] Windows PortInUseException In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> Message-ID: On Mon, 1 May 2006, Michael Mester wrote: > > I'm trying to get simple serial communication going with RxTx under > Windows XP. I can enumerate the ports fine, but I always run into > problems when I try to open one. I get a PortInUseException, but the > owner application is "Unknown" and the port is never open. I've tried > this on several different systems and all of them give the same > behavior. The only thing I can thiunk of that might be causing the > problem is that fact that I had to put the serial .dll file in system32 > instead of the reccommended folder, because it didn't work in the folder > the documentation gives. The library loads fine, though, so I'm not sure > whether that makes sense, and I don't know how to fix it anyway. Any > help is greatly appreciated. Below is the output of the program, right > up to the PortInUseException and the NullPointerException it causes > (because the serial port object is not instantiated). > > C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI > Starting GPSTalkerGUI... > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > gnu.io.PortInUseException: Unknown Application > Exception in thread "main" java.lang.NullPointerException > at GPSTalkerGUI.(GPSTalkerGUI.java:102) > at GPSTalkerGUI.main(GPSTalkerGUI.java:161) > Perhaps you are trying to open the port twice in your code? rxtx does open the ports, do a timed out read and then close the ports during enumeration. I think the port is being opened fine. The Unknown Application is always reported. On linux, there is some code that finds the actual application but on windows, its always unknown. If the port enumeration is returning the ports you expect, rxtx has opened the port and closed it with success. The port should open. There is also example code in the contrib directory that comes with rxtx source that has examples you can modify to work. -- Trent Jarvi tjarvi at qbang.org From Christian.Klemke at t-online.de Thu May 4 23:37:23 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Fri, 5 May 2006 07:37:23 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu> Message-ID: <004f01c67005$fc72fee0$016a10ac@NB600> Hi Paul, I was wondering about the same question some days ago and took a look at the source files. Unfortunately, I found that you can only get rid of that messages by altering and recompiling the Java code. There is a final static boolean variable called "devel" in the file "RXTXCommDriver.java" which is set to "true". This constellation causes the output after the native libraries have been loaded. No mechanism exists to suppress them otherwise :-(. Trent, does that mean that 2.1.7 is still officially a "development" version ? When will this value be changed to "false" by default ? With 2.1.8 ? It would be nice to provide a means to suppress such messages besides that static flag (maybe by setting a property called "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The output can indeed by annoying, especially when used with console applications, where the message potentially appears "in the middle" of your own output. Another possibility would be not to use System.out directly, but instead some PrintStream field which is initially set to System.out but can programatically be changed. That would allow for any kind of redirection or suppression by implementing appropriate user-defined PrintStream subclasses and making RXTX use that stream. What do you think ? Best regards, Christian ----- Original Message ----- From: "Paul Gettings" To: Sent: Thursday, May 04, 2006 10:41 PM Subject: [Rxtx] RXTX causing stdout messages > When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get > messages on stdout from the JVM: > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > As the only change was the version of RXTX (from 2.1.6), I am unsure > why the messages suddenly appeared. Anyone know how to get rid of > them? > > Thanks. > > -- > 101 USES FOR A DEAD MICROPROCESSOR > (23) Dead cat brush > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri May 5 06:09:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 06:09:46 -0600 (MDT) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <004f01c67005$fc72fee0$016a10ac@NB600> References: <20060504204122.GA6534@earth.utah.edu> <004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: On Fri, 5 May 2006, Christian Klemke wrote: > Hi Paul, > > I was wondering about the same question some days ago and took a look at the > source files. Unfortunately, I found that you can only get rid of that > messages by altering and recompiling the Java code. There is a final static > boolean variable called "devel" in the file "RXTXCommDriver.java" which is > set to "true". This constellation causes the output after the native > libraries have been loaded. No mechanism exists to suppress them otherwise > :-(. > > Trent, does that mean that 2.1.7 is still officially a "development" version > ? When will this value be changed to "false" by default ? With 2.1.8 ? It > would be nice to provide a means to suppress such messages besides that > static flag (maybe by setting a property called > "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The > output can indeed by annoying, especially when used with console > applications, where the message potentially appears "in the middle" of your > own output. Another possibility would be not to use System.out directly, but > instead some PrintStream field which is initially set to System.out but can > programatically be changed. That would allow for any kind of redirection or > suppression by implementing appropriate user-defined PrintStream subclasses > and making RXTX use that stream. What do you think ? > A patch for using properties would be accepted I'm sure. The reason the default is to display the message is not related to the development state of rxtx anymore. The problem is that people first using rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. The message prevents a great deal of email thats easily explained by the message. I question if we should support rxtx 2.0 at all anymore. If you post a patch in bugzilla, we'll put it into CVS this weekend. we'll be going through and doing such things anyhow. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri May 5 13:23:56 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 13:23:56 -0600 (MDT) Subject: [Rxtx] How to read from RxTx parallel port in Win XP In-Reply-To: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> References: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> Message-ID: On Thu, 27 Apr 2006, Worsley, Bob (Development Engineer) wrote: > I'm sorry if this is a dumb question, but I didn't find the answer in > the archives. > > I'm using the RxTx binaries for Windows on a reasonably current notebook > PC running Windows XP. I can send stuff to a printer on the parallel > port (LPT1), but I can't get anything back. > > I wrote a class that has the methods listed below. I write some data to > the printer with the "write" method and then try to read a response > using the "read" method, but I never get any data. I'd greatly > appreciate any help you can give! > > Bob Worsley > bobwoyid2 at yahoo.com > > > > > private ParallelPort parallelPort = null; > private RXTXCommDriver parallelPortDriver = null; > > > public boolean initialize() throws IOException { > if (parallelPort != null) { > return false; // Already initialized > } > > // Create the parallel port; > parallelPortDriver = new RXTXCommDriver(); > parallelPort = > (ParallelPort)parallelPortDriver.getCommPort(address, > CommPortIdentifier.PORT_PARALLEL); > > // Set the parallel port parameters. > try { > parallelPort.enableReceiveTimeout(READ_TIMEOUT); > parallelPort.disableReceiveFraming(); > parallelPort.disableReceiveThreshold(); > //parallelPort.setMode(mode); !!!!errors > } catch (UnsupportedCommOperationException e) { > throw (new IOException("Parallel port with address '" + > address > + "' cannot be configured as specified")); > } > > return true; > } > > > > public void write(final byte[] bytes) throws IOException { > initialize(); > while (busyReading) { > Thread.yield(); > } > busyWriting = true; > if (bytes.length < 1) { > return; > } > OutputStream outputStream = parallelPort.getOutputStream(); > outputStream.write(bytes); > outputStream.flush(); > outputStream.close(); > Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); > busyWriting = false; > } > > > public byte[] read() throws IOException { > > // Read up to MAX_BYTES bytes. > initialize(); > while (busyWriting) { > Thread.yield(); > } > busyReading = true; > byte[] buff = new byte[MAX_BYTES_READ]; > InputStream inputStream = parallelPort.getInputStream(); > // This read blocks until input data is available > int bytesRead = inputStream.read(buff); > inputStream.close(); > // If no data read, create empty array > if (bytesRead == -1) { > bytesRead = 0; > } > byte[] deviceBytes = new byte[bytesRead]; > System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); > if (bytesRead > 0) { > Debug.p("PPIOP.read - got data: '" + new > String(deviceBytes) + "'"); > } > busyReading = false; > return deviceBytes; > } > Hi Bob I've only used rxtx to test a hello world page printing but there are others that have used it. PPIOP? hmm what is this? :) The rxtx parallel support is behind the serial support but should be OK. As you note, the setting of modes is not supported. rxtx uses what is provided when the port is open. Are your asserting the pin for the printer being online? I suspect what often happens is people try to just use the data pins but the C API rxtx uses wants the printer to be online. There should be some posts relating to this in the rxtx mail-list archive. Some APIs are probably reading and writing from the port address (also suggested in your code as something you are looking at). RXTX currently uses a higher level C/C++ API for port access. This can still work if the API thinks the 'printer' is there. -- Trent Jarvi tjarvi at qbang.org From agrodellic at gmail.com Sat May 6 08:39:40 2006 From: agrodellic at gmail.com (Leigh Stewart) Date: Sat, 6 May 2006 10:39:40 -0400 Subject: [Rxtx] sun commapi 3 Message-ID: I think I read here: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html that rxtx-2.0 is basically fracked for now? Does anyone know of a workaround? ie can i somehow get an older version of sun's comm api and use that (not easy to find)? i mean 2.0 must be working for someone...how is it being tested. 2.1 isnt working for me....im getting nasty native exceptions etc, which is why im so set on 2.0... any ideas? From tjarvi at qbang.org Sun May 7 15:40:27 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 7 May 2006 15:40:27 -0600 (MDT) Subject: [Rxtx] sun commapi 3 In-Reply-To: References: Message-ID: On Sat, 6 May 2006, Leigh Stewart wrote: > > 2.1 isnt working for me....im getting nasty native exceptions etc, > which is why im so set on 2.0... any ideas? > Hi Leigh What native exceptions are you seeing? Which OS? The native code is almost identical between rxtx 2.0 and 2.1. Only the names have been changed to protect the inocent. :) ie: javax_comm_... vs gnu_io_... So the odds are very likely that even if you do find commapi 2.0 and get it installed, you will run into the same error. It would be better to just find and fix the problem. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Mon May 8 10:47:20 2006 From: mail at willicon.de (WILLICon) Date: Mon, 08 May 2006 18:47:20 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 Message-ID: <445F7618.3070303@willicon.de> Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/ef37e8ec/attachment-0400.html From tjarvi at qbang.org Mon May 8 16:14:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 May 2006 16:14:51 -0600 (MDT) Subject: [Rxtx] Screenshot of Application using RXTX (fwd) Message-ID: Just though someone may end up searching for 0x0D and 0x0A. Here are the details from his system. SuSE Linux 10.0 (x86_64) Kernel 2.6.13-15.8 j2se 1.4.2_11 (i586) Sun: comm3.0_u1 rxtx: rxtx-2.1-7 ---------- Forwarded message ---------- Date: Sat, 6 May 2006 20:01:46 +0200 From: Michael Poppitz To: taj at www.linux.org.uk Subject: Screenshot of Application using RXTX Hi Trent, the rxtx package works like a charm. Sun's package seemed to replace all 0x0D with 0x0A in received data on my Linux box, which is really annoying when transfering binary data. But rxtx came and saved the day - and turned out to be a lot more convenient as it does not require a configuration file. I use it for connecting to a home made logic analyzer. (http://www.sump.org/projects/analyzer/) Thanks for your great job, Michael -------------- next part -------------- A non-text attachment was scrubbed... Name: la_client.png Type: image/png Size: 16592 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/45494fbb/la_client-0400.png From tjarvi at qbang.org Tue May 9 14:56:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 May 2006 14:56:05 -0600 (MDT) Subject: [Rxtx] RXTX javax.comm: which one to install? In-Reply-To: <20060509161742.43547.qmail@web53814.mail.yahoo.com> References: <20060509161742.43547.qmail@web53814.mail.yahoo.com> Message-ID: On Tue, 9 May 2006, Adenilson Cavalcanti wrote: > Dear Trent Jarvi > > I'm trying to write a small Java app running in linux that interfaces with a device connected to serial port. > > I do have some questions about RXTX and javax.comm state of affairs, since I'm new to Java programming (used to program in plain old C writting to devices using termios and open/write/read syscalls, but this is another story). > > I ask you the favor to clarify this issues (if possible...): > > a) Sun offers to download a file (comm3.0_u1_PUTAUNIXVERSION.zip) which does contain .so files. Does it work out of box? > > b) Case negative, its there that we should use 'librxtx*.so' provided by your site? > > c) Sun's comm3 API version does work with which version of rxtx? > > I already searched google and read documentation available in rxtx site ("Java Comm Serial API How-to") but still have this issues unsolved. Any help will be appreciated. > > Best regards > > Adenilson Hi Adenilson, RXTX does not currently support javax.comm in Sun's CommAPI 3.0. I would recommend using package gnu.io provided by rxtx 2.1. -- Trent Jarvi tjarvi at qbang.org From chris.develder at intec.ugent.be Wed May 10 08:45:40 2006 From: chris.develder at intec.ugent.be (Chris Develder) Date: Wed, 10 May 2006 16:45:40 +0200 Subject: [Rxtx] rxtx troubles on ARM Message-ID: <4461FC94.6040909@intec.ugent.be> Hi all, Sorry to bother you, but I don't seem to get RXTX working on an ARM processor (xscale ixp 425, big endian). I managed to crosscompile the rxtx libs and moved it over to the ARM. Using jamvm (which is the only open source java VM we got working on the ARM), I get the following error result when running SimpleRead from Sun's javax.comm examples (commapi\examples\Simple\SimpleRead) -- see bottom of mail for complete output: "java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver" However, output shows that the RXTXCommDriver code is accessible (cf. debug and devel output of lib versions). So it doesn't seem to be a missing lib/jar issue. The error happens before RXTXCommDriver.initialize() is called, since the first line there is System.out.println("RXTXCommDriver:initialize()"); Any ideas? Cheers, Chris ---------------------------- [root at xxx(ttyp1) /work/cdvelder/xscale/test]# jamvm -Djava.library.path=/work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/jre/lib/arm -classpath /work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/lib/ext/RXTXcomm.jar:./comm.jar:. SimpleRead RXTXCommDriver {} Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTXCommDriver: Jar version = RXTX-2.1-7 native lib Version = RXTX-2.1-7 java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver gnu/io/RXTXCommDriver at javax.comm.CommPortIdentifier.loadDriver (CommPortIdentifier.java:239) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:109) at SimpleRead.main (Unknown Source) java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive (Native Method) at com.sun.comm.Portmapping.registerCommPorts (Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase (Portmapping.java:100) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:138) at SimpleRead.main (Unknown Source) From joachim at buechse.de Fri May 12 00:44:48 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 08:44:48 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) Message-ID: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Good day, I guess that only a selected few (hi Trent) will be able to answer this question, but the answer might be interesting for anyone trying to debug or understand the code. Apparently the MonitorThread is started and stopped in RXTXPort.addEventListener and RXTXPort.removeEventListener. This would indicate that (originally?) the MonitorThread is only required when there is an EventListener. However the MonitorThread is also started in the RXTXPort constructor, which could mean that RXTX won't work at all if it isn't there. It seems to me, that if anyone would add an event listener and later on remove it, he could potentially wreak the port. Because the second action would kill the MonitorThread. For the moment I am only trying to understand the role of and idea behind the MonitorThread. But of course there is a deeper reason thor my question: If the MonitorThread needs to exist anyway, it could be the thread that cleans up the port (ie calls nativeClose) - this would eliminate (a further) problem I am seeing with some USB drivers on Mac OSX. (Close blocks (after releasing the tty, but still) in the USB driver if the device is "not responding"). Greetings, Joachim From tjarvi at qbang.org Fri May 12 07:10:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 12 May 2006 07:10:59 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Fri, 12 May 2006, Joachim Buechse wrote: > Good day, > > I guess that only a selected few (hi Trent) will be able to answer > this question, but the answer might be interesting for anyone trying > to debug or understand the code. > > Apparently the MonitorThread is started and stopped in > RXTXPort.addEventListener and RXTXPort.removeEventListener. This > would indicate that (originally?) the MonitorThread is only required > when there is an EventListener. However the MonitorThread is also > started in the RXTXPort constructor, which could mean that RXTX won't > work at all if it isn't there. > > It seems to me, that if anyone would add an event listener and later > on remove it, he could potentially wreak the port. Because the second > action would kill the MonitorThread. > > > For the moment I am only trying to understand the role of and idea > behind the MonitorThread. But of course there is a deeper reason thor > my question: > > If the MonitorThread needs to exist anyway, it could be the thread > that cleans up the port (ie calls nativeClose) - this would eliminate > (a further) problem I am seeing with some USB drivers on Mac OSX. > (Close blocks (after releasing the tty, but still) in the USB driver > if the device is "not responding"). > Hi Jaochim Before commapi, rxtx did not support events. You could read, write and change port settings. The MonitorThread was added as an afterthought to support commapi events. So the way things are now his historical spaghetti not a well devised plan. It is my opinion that the MonitorThread should exist as long as the port is open. The odd starting of the thread in the constructor and addEventListener was just to get past the obvious problem of people using the port without adding listeners. -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Fri May 12 07:59:50 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 15:59:50 +0200 Subject: [Rxtx] MonitorThread -> ChangeRequest In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: <2B1E508C-8CEE-4AB7-914D-E7BA25C871A2@buechse.de> In this case I suggest removing the starting/stopping of MonitorThread in addEventListener / removeEventListener. This should not affect existing projects. On 12.05.2006, at 15:10, Trent Jarvi wrote: > It is my opinion that the MonitorThread should exist as long as the > port > is open. The odd starting of the thread in the constructor and > addEventListener was just to get past the obvious problem of people > using > the port without adding listeners. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Fri May 12 11:43:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 19:43:21 +0200 Subject: [Rxtx] Spring Cleaning - some suggestions Message-ID: The current implementation of RXTX contains quite a lot of code that will break if it is used from several threads (especially on a multi processor machine). I think it would be nice to clean this up. I suggest the following changes (which keep the current semantics and should not influence existing projects in a negative way): - InterruptedException will never be ignored or reset - read methods will be protected with a Monitor - write methods will be protected with a (separate) Monitor - close() sets the read and write monitors into a "closed" state which will lead to IOExceptions for any following call to RXTXPort.read/write. - close() will wait a finite amount of time (maybe 500ms) for the release of the read and write monitors after that, it will trigger the closing of the file descriptor to abort any pending read or write. - close() will not call close(file_desc). Instead it will "interrupt" (ie set a flag and then, pthread_kill(ABRT)) the MonitorThread, the MonitorThread will call close(file_desc). - the monitors are properly released in a finally block the try of which starts directly after obtaining the monitor. - finally will not call close(file_desc) it will only "interrupt" the MonitorThread (see above) - the native-code (esp read) does not use SA_RESTART but checks Thread.interrupted() when it receives a SIGNAL (ie system call returns with EINTR or other signalling method). The read/write monitors will be allocated from a factory whose mode can be set to fast/normal/advanced. In fast-mode it will create "non thread safe, non synchronized" pseudo-monitors. In default mode, the monitors will store the owning thread. In "advanced" mode setting the monitors into closed state will "interrupt()" threads which are blocked in a native read/write. {Reasoning close behaviour: Calling close on a file descriptor in Windows unblocks any read() or write() on the same file descriptor with an error. On Solaris < 2.7 and MacOS X however the close() will/ can block - until the read or write have finished:-(( Even the JDK people have trouble with this. I dont know how Linux reacts in this case. The best practice for BSD/Solaris is to send a signal to the thread which will usually unblock the read/write with an EINTR - this however is not guarenteed as it also depends on the device driver. So the only resolution that will certainly not block the thread calling RXTXPort.close() (which will often enough be the AWT event dispatcher or the VM finalizer thread) is to call close(fd) from another thread.} {Reasoning read behaviour: It is rather uncommon to receive a signal while reading or writing - it will happen, but checking Thread.interrupted() when it happens will not degrade performance. The checking of Thread.interrupted() can be handled by returning to Java and potententially reentering into the native code if the thread was not interrupted or by calling back into the VM from the native code. On top of this, many functions like read(byte[]) or read(byte [], int, int) are allowed to return less than the requested amount of data. Only int read() is a bit more tricky. } [Trent: From the code I can tell, that you experimented quite a bit with signals. Do you know if the Java Thread.interrupt() triggers a unix signal on Linux/Solaris? If so, which one?? References: - http://java.sun.com/docs/hotspot/VMOptions.html - http://www.hp.com/products1/unix/java/infolibrary/prog_guide/ signals.html ] On OS X (hotspot client jdk-1.4.2) I did not see any signal propagated to the SELECT of the event_loop/MonitorThread (ie no EINTR) when I call monThread.interrupt(). This is a pitty, but thats the way it is. I simply assume this is true for most system calls. How to handle this? Of course it would be possible to install/ deinstall a specific signal handler before/after every native read and to natively send an ABRT signal if RXTXPort.close is called. A more elegant solution might be to have an additional "signaling" socket which is always included in the SELECT. Or the simplest solution: cap the timeout of the select to 500 ms (the loop around it exists already) after every timeout check the Thread.interrupted() flag. From a performance perspective this should be completely invisible... On the other hand, all write() calls need to be preceeded by a SELECT as well, to avoid running into a blocking write. Best regards, Joachim From lyon at docjava.com Sat May 13 05:54:52 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 13 May 2006 07:54:52 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Dmitry suggests that we acquire an implementation of a serial port reference, use it, then release it (i.e., check it back in). Joachim says that making serial ports thread friendly might be a good idea. This is a good idea. The design pattern that is close to this idea is the "Object Pool Design Pattern". # Object Pool Manage the reuse of objects for a type of object that is expensive to create or only a limited number of a kind of object can be created. It has been described at: http://www.developer.com/java/ent/article.php/626171 and in Marks' book, Patterns in Java, Volume 1. However, the Object Pool is intended to pool objects so that each object is just like every other object. The intent of the Parametric Singleton is to enable others to access the same resource at the same time (as long as the same parameters were used in construction). It sounds like we need a NEW Design Pattern (Oh no, Doug is doing it again!). Yes friends, you got me on a role (roll) :) If you like design patterns, you can thank me later. If you don't like design patterns, blame Dmitry, it was his idea ;) And Dave, thanks for the feedback on Singleton abuse. It has led me to change the way I think about application contexts, which we will see, below. We need (drum roll please): The Parametric Object Pool Design Pattern (POP) By Douglas A. Lyon ABSTRACT The goal of the Parametric Singleton design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values, in a given context. In comparison, the goal of the POP design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values and that only one reference to the class is checked out at a time, in a given context. A context is a namespace for holding identifiers during execution. In Java, A context can be changed in any of several ways. For example, creation of a new class loader, the deserialization of an old POP or the creation of a new process all create a new namespace. The POP Design Pattern combines the Parametric Singleton Design Pattern with the check out mechanism of the Object Pool Design Pattern. This enables unique creation of instances of a class. These instances are cached in a table. When a clients asks for an instance with these parameters, the cache is checked. If the instance is not in the cache it is created. If the instance is available, the clients checks out the instance. A reference is left to the clients that checked out the instance. The POP has the role of creating objects uniquely, from parameters. It also has the role of keeping track of which clients has checked out a given object. This is just like a library keeping track of who borrowed a book. If a resource is left unavailable in a system, a deadlock can occur. Deadlock debugging is facilitated by mapping a resource to the clients that have checked it out. We apply our POP Design Pattern to the retrieval of serial ports. The goal of our system is to make sure that serial ports are checked out to only one client at a time, and that they be checked back in when the client is done. The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. Users are discouraged from calling this the Parametric Object Oriented Pool (POOP). Introduction The intent of the POP Design Pattern is to ensure that a class has only one instance for a given set of parameter values. It also provides a point of access that is global to a given context. The POP uses the Singleton Design Pattern to ensure that there is only one POP, in the given context. The POP DP is responsible for checking out a reference to a given instance, and keeping track of that instance. The instance is responsible for sharing that instance. POP requires that users of the DP implement an interface that enables a recall facility. Thus, if there is a contention for a consumed resource, the deadlock can be resolved in an orderly fashion. Motivation A system cannot tolerate multiple instances of some classes with identical parameters used by different instances at the same time. For example, you cannot have two instances use the same serial port, at the same time. You cannot have two instances that are trying to listen to the same socket connection. You cannot have two instances writing to the same file structure at the same time. Further, once a serial port is checked out by a client, it is assigned to the client. This is like the spin-lock service provided by the operating system, only in the application layer. Naturally, deadlock will occur if a resource is not released, therefore the client of the resource is tracked. Recalling a resource is required for the POP DP by virtue of the implementation of an interface. The policy on how to break a deadlock (by honoring the recall) is application specific. As the operating system is often thought of as the arbiter of consumed resources (i.e., tape drives, serial ports, etc.) we frequently leave it to an operating system implementation to resolve these contention issues. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on naming conventions (which are not well standardized). The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. The POP Design Pattern can take on the role of the peer method mapper that homogenizes the API for different operating environments. That is, it can wrapper the different locking mechanisms used in different operating systems. POP that is responsible for keeping track of the instances created and the client that has checked them out. The POP Design Pattern is implemented using the Singleton Design Pattern. In Java, the POP implementation is declared final, so that it cannot be subclassed. The class also has a private constructor, so that other classes cannot instance it. The new design pattern is called the POP design pattern and it provides a way to check out and create instances with given parameters. Applicability Use the POP Design Pattern when: 1. There must be exactly one instance of a class with the given parameters in a given context. 2. The instances must be accessible to clients from a well-known access point. 3. The instances are reusable. 4. Only one client can check out an instance at a time. Structure Insert UML diagram here. Participants The POP Clients that need instances 1. The POP defines an instance upon request from a client, if, and only if, the instance does not already exist. 2. The POP returns the instance to the client. 3. The POP is responsible for creating unique instances from given parameters. 4. The POP is responsible to recalling instances from clients. Collaborations Clients obtain a reference to a POP instance only through the singleton design pattern. If the POP instance is left in an improper state (e.g., the serial port was left open) it is NOT the role of the POP to close the IO port. However, the POP can be requested to get the instance released. Nor is it the role of the POP Design Pattern to open the port. That role is delegate to some other part of the system. Further, it is the role of the POP Design Pattern to check out resources. However, it is still possible to have, multiple threads that have multiple references to the same resource at the same time. Checkout and resource requests are MUTEX locked (i.e., synchronized). Consequences The POP Design Pattern has several benefits: 1. Controlled access to parametrically defined instances. Since the POP encapsulates its instances, there is some limited control over how and when clients access it. 2. Reduced name space. The POP pattern avoids global variables that store instances created from the same parameter. Implementation Here are implementation issues to consider when using the POP pattern: 1. Unique mapping of parameters. The POP pattern requires that there be a mean to isomorphically map the parameter space into the instance space and back again. 2. Ensure unique instances. The POP pattern makes unique instances from parameters, and it does so only once. 3. Cache instances for fast retrieval. The POP must be able to look up instances, given some set of parameters, and do so from some data structure. That is, there must be enough space to hold references to all the instances the program will need. Also, a mechanism is needed to look up and retrieve the instances quickly enough to satisfy the clients. Sample Code To be written....any volunteers? Thanks! - Doug >I don't think I get it > >On Mar 22, 2006, at 9:36 AM, David Garnier wrote: >>Using the singleton pattern in this case is >>just convenient for the programmer. Problems >>arises >>pretty quickly, especially if you attempt to unit-test your classes. > > >so you're saying that something isn't so good >because you can not test it in the convenient >way? >if that's true, I'm totally disagree >change your test, debug whatever, but if >software is efficient at runtime, works fine and >only problem is some unit test >(which is some kind of framework for testing) >then dump that unit test , dump that unit >framework and make something appropriate to the >software >you're testing > >so if Douglas want to use singletons, what's the problem? >and what do you mean by abusing of singleton usage? > >of course singleton doesn't prevent concurrent >access to the resource across the processes >unless >you're using some OS facility to prevent it, besides >singleton as it was introduced is relevant only >and only inside of the same process >otherwise it's not singleton it's something else >(let's say network singleton: so you have remote >invocation facility >and some factory method that return object created by that facility) > >I don't have any problem with using any kind of singletons. > Parametric Singleton idea (if I understand it >right) could be easily implemented in the >following way: >use a map >populate map with instances of some class and key is your parameter >(you can use lazy population too) > >if somebody ask the key check the value if it's null so resource is taken >if somebody returns the resource put it back to the map > >public synchronized static Object getSomeResource(Object parameter); >public synchronized static void returnResource(Object parameter); > >getSomeResource (inside of the same process) could return null in 2 cases >1. if somebody (from other thread for example) already took that resource >2. if OS API said that resource corresponded to >that parameter (serial port with parameter = 1 >(port #)) >is locked and unavailable; >I'm not sure that in case of serial ports we >even need those Parametric Singletons >(unless lock checking is a very expensive operation) >just ask the OS about availability of that >resource and if it's available give it away >and then OS will lock it and therefore in next >time somebody ask it just answer that resource >is locked >and return null > >for example system has 2 serial ports available >so I ask getResource("tty"); >or I ask getResource("Bluetooth-Modem"); > >and if OS is ok you can give tty or Bluetooth-Modem or both > >no need for any additional pattern I think > >back to the problem >mac os x doesn't recognize locking via files, so >it handles locking via some API >an instance of the singleton in each process >should recognize that resource is locked >(by using that API) that's all >we don't have to make things more complicate >then they are just because there is some nice >design pattern or nice unit test framework or whatever >keep things simple, make them work fast, don't introduce middle layers >unless you have really good reason to do so > >of course I could be entirely wrong, so sorry about that in advance > >thanks > > >Dmitry Markman > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx >Good day, > >I guess that only a selected few (hi Trent) will be able to answer? >this question, but the answer might be interesting for anyone trying? >to debug or understand the code. > >Apparently the MonitorThread is started and stopped in? >RXTXPort.addEventListener and RXTXPort.removeEventListener. This? >would indicate that (originally?) the MonitorThread is only required? >when there is an EventListener. However the MonitorThread is also? >started in the RXTXPort constructor, which could mean that RXTX won't? >work at all if it isn't there. > >It seems to me, that if anyone would add an event listener and later? >on remove it, he could potentially wreak the port. Because the second? >action would kill the MonitorThread. > > >For the moment I am only trying to understand the role of and idea? >behind the MonitorThread. But of course there is a deeper reason thor? >my question: > >If the MonitorThread needs to exist anyway, it could be the thread? >that cleans up the port (ie calls nativeClose) - this would eliminate? >(a further) problem I am seeing with some USB drivers on Mac OSX.? >(Close blocks (after releasing the tty, but still) in the USB driver? >if the device is "not responding"). > >Greetings, >Joachim > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Sat May 13 10:07:37 2006 From: joachim at buechse.de (Joachim Buechse) Date: Sat, 13 May 2006 18:07:37 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Douglas, Looking at the current code, leaves me with the feeling, that there is a lot to do. Defining an API that wraps javax.comm to provide what you describe is certainly possible, but I wonder how much benefit it will actually provide. Personally I think the API defined by javax.comm "request/lock" a port with: cp= new CommunicationPort(identifier) "release" a port with: cp.close(); works quite nice for 99% of the applications. In my experience, the most efficient and elegant implementation is to wrap a port/socket/.. into a business object which declares the remote operations that are possible. Ie "uploadFile", "waitForPrompt", "getSerialNumber", "sendContact", "executeCommand", etc Those methods are then either synchronized or guarded by a monitor. I do not see how your design pattern applied to the port resource would help implementing this. [details start, skip if you agree to the above] When I talked about "thread-safe" I didn't mean several independent "sessions" accessing the port concurrently. I think this is a very rare usage. I believe the most common use case for serial ports today is the control of an external device from a PC running a GUI based application. To implement a clean Swing/AWT-GUI one needs to pass any action that can block to a "worker" thread (else the GUI blocks, the application appears dead). While it is possible to use own prespawned thread that will accept Runnables which operate on the port, this is not very elegant. It is more common to spawn a new thread for every action triggered by the user. Additionally the ABORT of a running operation is often implemented via a port.close() delegated to a different thread. - During the lifetime of a port, it will usually be accessed from several different threads. Instance variables need to be set/read in synchronized regions to guarantee a correct operation based on the Java memory model. - Synchronizing the access is usually handled on the application level (synchronizing the reads/writes is usually useless from the applications view because it is not a transaction mechanism). [details end] I am very open to learn about other scenarios where your proposed design pattern applied to the port resource is beneficial to the application implementor. Best regards, Joachim On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > Dmitry suggests that we acquire an implementation of > a serial port reference, use it, then release it (i.e., check it > back in). > > Joachim says that making serial ports thread friendly might be a > good idea. > > This is a good idea. The design pattern that is close to this idea > is the "Object Pool Design Pattern". > # Object Pool From jredman at ergotech.com Sun May 14 14:28:24 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 14:28:24 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers Message-ID: <446792E8.4000506@ergotech.com> Does anyone know of any work to make RXTX work with Ethernet (telent) Terminal Servers? If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? We've used RXTX with upwards of 100 virtual COM ports on Windows and it works well. Linux is more problematic. It would be good to have an OS independent solution to accesses remote Ethernet serial ports. Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From legolas.w at gmail.com Sun May 14 14:26:34 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:56:34 +0430 Subject: [Rxtx] does any one have a working sample of RXTX and LPT port Message-ID: <4467927A.4000008@gmail.com> Hi Thank you for reading my post does any one has a working sample for RXTX and LPT port ? Thanks From legolas.w at gmail.com Sun May 14 14:27:29 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:57:29 +0430 Subject: [Rxtx] does RXTX support Trigerr on parallel port? Message-ID: <446792B1.4040905@gmail.com> Hi does RXTX support trigger on LPT port ? if so , how i can use it ? Thanks From tjarvi at qbang.org Sun May 14 17:40:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 17:40:59 -0600 (MDT) Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: <446792E8.4000506@ergotech.com> References: <446792E8.4000506@ergotech.com> Message-ID: On Sun, 14 May 2006, Jim Redman wrote: > Does anyone know of any work to make RXTX work with Ethernet (telent) > Terminal Servers? > > If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 > Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? > Hi Jim It appears the author of NVTCom has decided to release the library into the public domain. Integration with rxtx is possible but it would be best to contact the author and find out what his intent is. I would suggest contacting the author with a proposal of what you would like to do and take it from there. We could 'take' public domain software but its better to show respect to the authors and respect their wishes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:10:23 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:10:23 -0600 (MDT) Subject: [Rxtx] does any one have a working sample of RXTX and LPT port In-Reply-To: <4467927A.4000008@gmail.com> References: <4467927A.4000008@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > Thank you for reading my post > does any one has a working sample for RXTX and LPT port ? > Thanks Hi Legolas LPT port support in rxtx is spotty. That means some people have sent in patches for what they do and it works well for them. The original code was not very good. It may have been 3 hours work :/ To get started, Sun has some demo programs with their commapi. With rxtx 2.1 you can change their code from using javax.com to gnu.io and it -should- work. But if it does not you can post here and on bugzilla. There has been more interest lately off the list and maybe there will be enough community resources to get what you need going. If you do get a sample program together, we would gladly put it in the contrib directory so the next person can get things going faster. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:12:12 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:12:12 -0600 (MDT) Subject: [Rxtx] does RXTX support Trigerr on parallel port? In-Reply-To: <446792B1.4040905@gmail.com> References: <446792B1.4040905@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > does RXTX support trigger on LPT port ? > if so , how i can use it ? > Hi Legolas As mentioned in the previous post, rxtx parallel support is not very mature. But if you can point to something that describes the trigger feature, we can probably make sure its there and give a quick code example. -- Trent Jarvi tjarvi at qbang.org From jredman at ergotech.com Sun May 14 22:22:48 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 22:22:48 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: References: <446792E8.4000506@ergotech.com> Message-ID: <44680218.4080008@ergotech.com> Trent, Trent Jarvi wrote: > On Sun, 14 May 2006, Jim Redman wrote: > >> Does anyone know of any work to make RXTX work with Ethernet (telent) >> Terminal Servers? >> >> If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 >> Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? >> > > Hi Jim > > It appears the author of NVTCom has decided to release the library into > the public domain. Integration with rxtx is possible but it would be best > to contact the author and find out what his intent is. > > I would suggest contacting the author with a proposal of what you would > like to do and take it from there. We could 'take' public domain software > but its better to show respect to the authors and respect their wishes. > I sent Marco(?), the author of the library, a note before asking the list - I'll let you know the response. If anyone is already working on it, or has an interest and more time and energy than me, I'd hate to duplicate the efforts. If no one is, and no one objects, maybe I'll see what I can do. Jim > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From Christian.Klemke at t-online.de Mon May 15 02:23:06 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Mon, 15 May 2006 10:23:06 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu><004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: <008a01c677f8$cae18590$02fea8c0@NB600> Hi Trent, Hi Paul, I finally found some time to create a simple patch to enable the optional suppression of version output to the console. It is based on a new system property called "gnu.io.rxtx.NoVersionOutput" which can by set to "true" if necessary. I had some problems accessing CVS, therefore I downloaded the rxtx-2.1-7r2 source archive from ftp.qbang.org (which is linked on the rxtx.org download page) and worked with that release. Please find my proposed patch in the attachment ! Regards, Christian ----- Original Message ----- From: "Trent Jarvi" To: "RXTX Developers and Users" Cc: ""Paul Gettings"" Sent: Friday, May 05, 2006 2:09 PM Subject: Re: [Rxtx] RXTX causing stdout messages > On Fri, 5 May 2006, Christian Klemke wrote: > >> Hi Paul, >> >> I was wondering about the same question some days ago and took a look at >> the >> source files. Unfortunately, I found that you can only get rid of that >> messages by altering and recompiling the Java code. There is a final >> static >> boolean variable called "devel" in the file "RXTXCommDriver.java" which >> is >> set to "true". This constellation causes the output after the native >> libraries have been loaded. No mechanism exists to suppress them >> otherwise >> :-(. >> >> Trent, does that mean that 2.1.7 is still officially a "development" >> version >> ? When will this value be changed to "false" by default ? With 2.1.8 ? It >> would be nice to provide a means to suppress such messages besides that >> static flag (maybe by setting a property called >> "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The >> output can indeed by annoying, especially when used with console >> applications, where the message potentially appears "in the middle" of >> your >> own output. Another possibility would be not to use System.out directly, >> but >> instead some PrintStream field which is initially set to System.out but >> can >> programatically be changed. That would allow for any kind of redirection >> or >> suppression by implementing appropriate user-defined PrintStream >> subclasses >> and making RXTX use that stream. What do you think ? >> > > A patch for using properties would be accepted I'm sure. > > The reason the default is to display the message is not related to the > development state of rxtx anymore. The problem is that people first using > rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. > The message prevents a great deal of email thats easily explained by the > message. > > I question if we should support rxtx 2.0 at all anymore. > > If you post a patch in bugzilla, we'll put it into CVS this weekend. > we'll be going through and doing such things anyhow. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_version_output_patch.diff Type: application/octet-stream Size: 991 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060515/3173c2b6/rxtx_version_output_patch-0400.obj From lyon at docjava.com Mon May 15 06:06:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 May 2006 08:06:21 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Joachim makes several good points. Let me see if I can address some of them below: >Hello Douglas, > >Looking at the current code, leaves me with the feeling, that there? >is a lot to do. Yes! >Defining an API that wraps javax.comm to provide what? >you describe is certainly possible, but I wonder how much benefit it? >will actually provide. > >Personally I think the API defined by javax.comm > >"request/lock" a port with: > cp= new CommunicationPort(identifier) >"release" a port with: > cp.close(); > >works quite nice for 99% of the applications. I don't know what percentage of applications turn off locking, the way that I do in my version of the RXTX lib. I do know that this is not safe practice. I also know that it was motivated by the multi-platform nature of my code and that this was the only way I could make things work, at the time. Java does not appear to have a cross-platform standard for locking resources on various platforms. Each OS appears to have its own standard. The question of who breaks deadlocks and how this is done remains open, as this is not an easy question to resolve. Let me continue, below: > >In my experience, the most efficient and elegant implementation is to? >wrap a port/socket/.. into a business object which declares the? >remote operations that are possible. Ie "uploadFile",? >"waitForPrompt", "getSerialNumber", "sendContact", "executeCommand",? >etc Those methods are then either synchronized or guarded by a? >monitor. I do not see how your design pattern applied to the port? >resource would help implementing this. I have no problem with high-level wrappers that are application specific. That is a very good idea, but orthogonal with respect to the issue of deadlocks. More below: > >[details start, skip if you agree to the above] >When I talked about "thread-safe" I didn't mean several independent? >"sessions" accessing the port concurrently. I think this is a very? >rare usage. That is probably why turning locking off works so well! On the other hand, it is not safe and I shouldn't do it. >I believe the most common use case for serial ports today? >is the control of an external device from a PC running a GUI based? >application. To implement a clean Swing/AWT-GUI one needs to pass any? >action that can block to a "worker" thread (else the GUI blocks, the? >application appears dead). While it is possible to use own prespawned? >thread that will accept Runnables which operate on the port, this is? >not very elegant. It is more common to spawn a new thread for every? >action triggered by the user. Additionally the ABORT of a running? >operation is often implemented via a port.close() delegated to a? >different thread. Here lies the heart of serial port concern. An application opens a serial port and then dies. The application is restarted and finds the port locked. How do we clear the lock? Must the application's user reside in the UUCP group? Must installers of the serial port add users to the UUCP group? Should locking be handled at a high-level of abstraction in an operating system independent way? Should the implementation of the locking mechanism be translated into an API that is dependent on the OS convention? Suppose that we restrict the discussion to serial ports. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on inconsistent naming conventions. Hence my feeling that we need to mirror what is done in other API's; we need a locking toolkit that references peer methods, IMHO. >From the Java programming point of view, the locking API is portable across different platforms, but has, as its implementation, a native peer method that uses the conventions of the underlying OS. This enables portable resource locking (in theory!). Consider, for example: org.apache.commons.transaction.locking with: Interface LockManager at: http://jakarta.apache.org/commons/transaction/apidocs/org/apache/commons/transaction/locking/LockManager.html Or, more recently: java.util.concurrent.locks Interface Lock based on Doug Lea's code: http://kickjava.com/src/EDU/oswego/cs/dl/util/concurrent/ReadWriteLock.java.htm Should we incorporate a clean, portable design into serial port use, one that is consistent with current locking APIs? Basically, a comm port is a resource and resources are typically controlled by managers. Thus, I suggest that we make use of a CommPortManager to help control and centralize serial port usage. The question of how this is done remains open, IMHO, but using core API's like: java.util.concurrent.locks might not be amiss. High-level methods (getAllPorts, getAllSerialPorts, getAllParallelPorts, etc...) might be welcome additions. Basic questions like, "what if a port is in use?" remain open, hence my proposal for the new design pattern. Isn't it the CommPortManager's role to break the deadlock? Cheers! - Doug > >- During the lifetime of a port, it will usually be accessed from? >several different threads. Instance variables need to be set/read in? >synchronized regions to guarantee a correct operation based on the? >Java memory model. >- Synchronizing the access is usually handled on the application? >level (synchronizing the reads/writes is usually useless from the? >applications view because it is not a transaction mechanism). >[details end] > >I am very open to learn about other scenarios where your proposed? >design pattern applied to the port resource is beneficial to the? >application implementor. > >Best regards, >Joachim > >On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > >> Dmitry suggests that we acquire an implementation of >> a serial port reference, use it, then release it (i.e., check it? >> back in). >> > > Joachim says that making serial ports thread friendly might be a? >> good idea. >> >> This is a good idea. The design pattern that is close to this idea >> is the "Object Pool Design Pattern". >> # Object Pool > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Mon May 15 06:58:19 2006 From: joachim at buechse.de (Joachim Buechse) Date: Mon, 15 May 2006 14:58:19 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Doug, I agree fully, that locking of the system resource should be abstracted from the user (programmer). Currently this is already the case, but I agree it might be nice to extract the code into a separate class, which uses platform dependent providers to do its job. What I described in my email was not targeted at allocating the system resource, but at handling an already allocated system resource inside the framework. I agree that it may be possible to combine the two - however, I would suggest to do this in phase2. I can contribute a work over of RXTXPort.java which implements clean internal locking and proper close behavior (which I would call phase 1). I could do this this week. However I strongly believe that there is little sense in trying to do this as a series of patches. It will be closer to a rewrite than to a patch. I have already provided a number of suggested patches via Bugzilla, but this is quite inconvenient (for me). My working copy diverges more and more from the master and hence it gets more and more annoying to provide self contained patches. Best regards, Joachim From tjarvi at qbang.org Mon May 15 08:27:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 May 2006 08:27:51 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Mon, 15 May 2006, Joachim Buechse wrote: > Hello Doug, > > I agree fully, that locking of the system resource should be > abstracted from the user (programmer). Currently this is already the > case, but I agree it might be nice to extract the code into a > separate class, which uses platform dependent providers to do its job. > > What I described in my email was not targeted at allocating the > system resource, but at handling an already allocated system resource > inside the framework. I agree that it may be possible to combine the > two - however, I would suggest to do this in phase2. > > I can contribute a work over of RXTXPort.java which implements clean > internal locking and proper close behavior (which I would call phase > 1). I could do this this week. > > However I strongly believe that there is little sense in trying to do > this as a series of patches. It will be closer to a rewrite than to a > patch. I have already provided a number of suggested patches via > Bugzilla, but this is quite inconvenient (for me). My working copy > diverges more and more from the master and hence it gets more and > more annoying to provide self contained patches. > For methodical testing purposes (which does go on) the incremental patches are better. I'm lagging behind in bugzilla but thats soon to change (this week). It has just been rather chaotic up until now. I moved, purchased a house, and jumped into the fire of a feature freeze timeframe at a new job. btw, we see the Solaris close issues on 2.8 also. 9 and 10 are fine. I'll work towards making those test results public and allow others to run new rxtx code through them. We had the OK at one point but setting up the environment is involved. It isn't just a collection of java classes. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Tue May 16 02:01:47 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:01:47 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] Message-ID: <446986EB.209@willicon.de> Hi, any ideas for my problem? Hans -------- Original-Nachricht -------- Betreff: [Rxtx] Problem under Mac OSX 10.3.9 Datum: Mon, 08 May 2006 18:47:20 +0200 Von: WILLICon Antwort an: RXTX Developers and Users An: RXTX Developers and Users Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/b0741c2b/attachment-0400.html From joachim at buechse.de Tue May 16 02:15:08 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 10:15:08 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: Hello Hans, I am using RXTX on OS X for my own project. I do not see the problem you describe. I had some troubles installing it because the current version uses lock files which is non-standard on OS X. I have created a patched version which I currently use. This version does not need to modify user groups and hence does not need an installer. I just pop it in the application directory. If you send me a link where I can download your OSX installer, I will have a quick look. Regards, Joachim On 16.05.2006, at 10:01, WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we > have some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + > spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + > spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always > the value "false". > I can only get the status, while I open the port and catch the > exception. > > Any ideas? > > Hans > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail at willicon.de Tue May 16 02:26:53 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:26:53 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: References: <446986EB.209@willicon.de> Message-ID: <44698CCD.7050709@willicon.de> Joachim, tanks for the answer. I'll send You a mail. Hans Joachim Buechse schrieb: > Hello Hans, > > I am using RXTX on OS X for my own project. I do not see the problem > you describe. > > I had some troubles installing it because the current version uses > lock files which is non-standard on OS X. I have created a patched > version which I currently use. This version does not need to modify > user groups and hence does not need an installer. I just pop it in > the application directory. If you send me a link where I can download > your OSX installer, I will have a quick look. > > Regards, > Joachim > > On 16.05.2006, at 10:01, WILLICon wrote: > > >> Hi, >> >> any ideas for my problem? >> >> Hans >> >> -------- Original-Nachricht -------- >> Betreff: [Rxtx] Problem under Mac OSX 10.3.9 >> Datum: Mon, 08 May 2006 18:47:20 +0200 >> Von: WILLICon >> Antwort an: RXTX Developers and Users >> An: RXTX Developers and Users >> >> >> Hi, >> >> I use for RXTX for communicate with CyclingComputers. >> >> It works good under Win32, Sloaris and Linux but with Mac OSX we >> have some problems. >> >> My users install the Mac OSX serial lib from the actual binary. >> >> After starting the program, they get this error message: >> >> java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while >> loading gnu.io.RXTXCommDriver >> >> Remember, this error comes only under Mac OSX. >> >> That is the code for the error: >> >> Enumeration portList = CommPortIdentifier.getPortIdentifiers(); >> spInUse = getBundleStr("serialPortInUse"); >> spFree = getBundleStr("serialPortFree"); >> while (portList.hasMoreElements()) { >> CommPortIdentifier portId = (CommPortIdentifier) >> portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (osName != null && osName.startsWith("mac")) { >> if (!portId.getName().startsWith("dev/cu.")) { >> continue; >> } >> } >> if (portId.isCurrentlyOwned()) { >> serialPortNames.add(portId.getName() + " - " + >> spInUse); >> } >> else { >> serialPortNames.add(portId.getName() + " - " + >> spFree); >> } >> } >> } >> if (serialPortNames.size() == 0) { >> serialPortNames.add(getBundleStr("serialPortNotFound")); >> } >> >> BTW: The methode isCurrentlyOwned() is not working. I get always >> the value "false". >> I can only get the status, while I open the port and catch the >> exception. >> >> Any ideas? >> >> Hans >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/948333be/attachment-0400.html From jredman at ergotech.com Tue May 16 07:35:52 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 16 May 2006 07:35:52 -0600 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: <4469D538.6070408@ergotech.com> Hans, I have no direct insight, but would note that what you have is a "NoClassDefFoundError" not a "ClassNotFoundException". So the class javax/comm/CommDriver is found, but one of its dependencies is missing. NoClassDefFoundError are a bigger problem to resolve because you get no indication of the real problem. Jim WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we have > some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > * spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always the > value "false". > I can only get the status, while I open the port and catch the exception. > > Any ideas? > > Hans > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.de Tue May 16 08:01:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 16:01:21 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 In-Reply-To: <4469AFC3.6000002@willicon.de> References: <44698EBC.8000008@willicon.de> <8C5680C4-E2BA-42FF-B221-36E1124FA6A4@buechse.de> <4469AFC3.6000002@willicon.de> Message-ID: <9825A602-D6ED-4C28-BF33-9A7C984FACD5@buechse.de> Hallo Hans, you include RXTX 2.17 in your "bikeXexperience.jar" (2.17 uses Interfaces from gnu.io.* not javax.comm.*). Now inspect your error log closely: The class gnu.io.RXTXCommDriver tries to load javax.comm.CommDriver: this is only the case for RXTX 2.07. I assume, that the user has installed Version 2.07 into one of the java.ext.dirs . The VM always tries to load classes from the "system" path first. The current Mac installer distributed with RXTX in fact installs RXTXcomm.jar and librxtxSerial.jnilib into /Library/Java/Extensions. (I wrote some time ago that I consider this as a bad idea because of potential version conflicts-> thanks for delivering the example). For 2.07 it does so without installing the javax.comm classes it seems. I would recommend that you instruct your users to install version 2.17 only. Until RXTX is changed to use TIOCEXCL instead of lock files, you can hardly avoid the installer, as the user needs to be added to a special group and a lockfile directory needs be created. More precisely you are waiting for: http://bugzilla.qbang.org/show_bug.cgi?id=50 [RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL)] Regards, Joachim -------------- next part -------------- A non-text attachment was scrubbed... Name: log.tiff Type: image/tiff Size: 38394 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/e3e52128/log-0400.tiff -------------- next part -------------- > > Ich verwende RXTX 2.17. Das orginal RXTXcomm.jar ist in > CyclingDataManager.jar enthalten. > From tjarvi at qbang.org Wed May 17 23:18:15 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 May 2006 23:18:15 -0600 (MDT) Subject: [Rxtx] update Message-ID: So we have several patches and these have stacked up. I'd like to thank everyone for being patient. Tests for the most intrusive patches look good so far. I still have to get some bits together on my end but it looks like we can catch everything up in CVS this week. I'll try to post a normal list of what went in by whom with links Saturday. But I'm not seeing anything that raises flags yet. I also think I'll be able to submit a patch for nonstandard baud rates. I have to confirm w32 but I think its going to be a one line fix. I don't know if its bugzilla or people tinkering with patch files before submitting but patches are not applying cleanly. So the patches have to be done by hand. This may make things difficult for people hoping to add other patches on top. I'm trying to make that go well but ... -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Thu May 18 02:23:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 May 2006 10:23:47 +0200 Subject: [Rxtx] update In-Reply-To: References: Message-ID: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Hello Trent, in fact I tinkered with the patches (never used this mechanism before, usually I "communicate" via cvs) ... so sorry for any trouble you had applying them. Basicly I edited the patches to make them self contained. Having the tests run with different speeds on different platforms, may well be an effect of caching. I have seen quite interesting propagation delays for the closing flag on my PowerPC system, which makes me doubt, that the propagation of output_buffer_empty_flag works as it should. Maybe the communication mechanism between the two threads should be replaced by something like pthread_cond_*. Could you describe which problems you see on Solaris/SPARC? I'd be interested to see if they exist on OS X (PowerPC) as well... As you seem to work on the stuff at the moment I would like to suggest the following additions (it looks more than it is, I posted some context to make clear where to apply the change). See the comments in braces for what was changed Greetings, Joachim (1) The end of the drain loop could be: --- report("drain_loop: received EINTR in tcdrain\n"); --- (added "in tcdrain" to make debug output clearer) (2) The start of the drain loop should be: --- for(i=0;;i++) { report_verbose("drain_loop: looping\n"); #if defined(__sun__) /* FIXME: No time to test on all OS's for production */ if( eis->eventloop_interrupted ) { goto end; } if (usleep(5000)) { report("drain_loop: received EINTR"); } #else if (usleep(1000000)) { report("drain_loop: received EINTR"); } #endif /* __sun__ */ --- (added a check for "eis->eventloop_interrupted" before the sleep) (3) The end of interrupt_event_loop could (and maybe should) be: --- #if !defined(TIOCSERGETLSR) && !defined(WIN32) /* make sure that the drainloop unblocks from tcdrain */ pthread_kill(index->drain_tid, SIGABRT); /* TODO use wait/join/SIGCHLD/?? instead of sleep? */ usleep(50 * 1000); /* Under normal conditions, SIGABRT will unblock tcdrain. However a non-responding USB device combined with an unclean driver may still block. This is very ugly because it may block the call to close indefinetly. */ if (index->closing != 1) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); index->closing = 1; } #endif report("interruptEventLoop: interrupted\n"); --- (added some comments and pthread_cancel for resisting drain thread) On 18.05.2006, at 07:18, Trent Jarvi wrote: > > So we have several patches and these have stacked up. I'd like to > thank > everyone for being patient. > > Tests for the most intrusive patches look good so far. I still > have to > get some bits together on my end but it looks like we can catch > everything > up in CVS this week. > > I'll try to post a normal list of what went in by whom with links > Saturday. But I'm not seeing anything that raises flags yet. I also > think I'll be able to submit a patch for nonstandard baud rates. > I have > to confirm w32 but I think its going to be a one line fix. > > I don't know if its bugzilla or people tinkering with patch files > before > submitting but patches are not applying cleanly. So the patches > have to > be done by hand. This may make things difficult for people hoping > to add > other patches on top. I'm trying to make that go well but ... > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu May 18 22:28:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 18 May 2006 22:28:00 -0600 (MDT) Subject: [Rxtx] update In-Reply-To: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> References: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Message-ID: On Thu, 18 May 2006, Joachim Buechse wrote: > Hello Trent, > > in fact I tinkered with the patches (never used this mechanism > before, usually I "communicate" via cvs) ... so sorry for any trouble > you had applying them. Basicly I edited the patches to make them self > contained. I think we are close to moving towards that. > > Having the tests run with different speeds on different platforms, > may well be an effect of caching. I have seen quite interesting > propagation delays for the closing flag on my PowerPC system, which > makes me doubt, that the propagation of output_buffer_empty_flag > works as it should. Maybe the communication mechanism between the two > threads should be replaced by something like pthread_cond_*. Could > you describe which problems you see on Solaris/SPARC? I'd be > interested to see if they exist on OS X (PowerPC) as well... This is interesting. I have seen problems with output buffer empty in applications that require it. I'm trying to get a bug list and or test results open for everyone to see but that may take time. But missed output buffer events ... yep. With Sparc, we have seen a few things. One was a kernel race condition that went away when we reimaged and updated 2.8. RXTX was hanging on close, top showed no cpu use but there was 2 second delays just typing on console. The other is our tests now take ~4 times longer on Solaris. Someone is looking at timing just open, close, read, write, ... to see if they can find where the slowdown is. This happened after solaris 2.8. I'll try to share more when/if there is something interesting. This may well not be solvable in userland. > > As you seem to work on the stuff at the moment I would like to > suggest the following additions (it looks more than it is, I posted > some context to make clear where to apply the change). See the > comments in braces for what was changed I'll take a look. This could all come together Saturday but I also have an event to attend that day. I may not wrap this up until Sunday. -- Trent Jarvi tjarvi at qbang.org From andrewlord at internode.on.net Sun May 21 20:10:02 2006 From: andrewlord at internode.on.net (Andrew Lord) Date: Mon, 22 May 2006 11:40:02 +0930 Subject: [Rxtx] Kernel include files do not match kernel Message-ID: <200605221140.03271.andrewlord@internode.on.net> Hi, I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel 2.6.12-18 with the command: ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include However I get the message: ## checking java.version 1.5.0_06 ## checking os.version 2.6.12-18mdk ## ## WARNING: Kernel include files do not match the current kernel ## ## configure: creating ./config.status etc. Is there a problem with the way I'm specifying the 'include' directory ? If not, how else can I specify the correct directory for the include files please ? Cheers, Andrew From tjarvi at qbang.org Sun May 21 20:31:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 May 2006 20:31:31 -0600 (MDT) Subject: [Rxtx] Kernel include files do not match kernel In-Reply-To: <200605221140.03271.andrewlord@internode.on.net> References: <200605221140.03271.andrewlord@internode.on.net> Message-ID: On Mon, 22 May 2006, Andrew Lord wrote: > Hi, > > I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel > 2.6.12-18 with the command: > > ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk > CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include > > However I get the message: > > ## checking java.version 1.5.0_06 > ## checking os.version 2.6.12-18mdk > ## > ## WARNING: Kernel include files do not match the current kernel > ## > ## configure: creating ./config.status > etc. > > Is there a problem with the way I'm specifying the 'include' directory ? If > not, how else can I specify the correct directory for the include files > please ? > Hi Andrew I'm fairly sure your --with-kernel option does nothing. The CPPFLAGS should do what you want. Maybe put an #error message in /usr/src/linux.../incude/linux/version.h But I don't recall a recent problem with version missmatches. It should work. Distros will even ship include files that don't match versions exactly. In theory it should never matter for users. I used to compile new kernels by hand and really didnt have a distro. I didnt have a seperate package of kernel headers for users (myself). When changing a gateway from linux 1.2.12 to 2.1.77, I would worry about such messages. So if you are doing something that weird, the message may be of use to you. If you just see the message on a distro you installed, it is more than likely harmless. -- Trent Jarvi tjarvi at qbang.org From mrogers at spro.net Mon May 22 14:45:39 2006 From: mrogers at spro.net (Mike Rogers) Date: Mon, 22 May 2006 14:45:39 -0600 Subject: [Rxtx] Sun's CommAPI -- think May? Message-ID: <447222F3.9040302@spro.net> Hi, Any word from Sun about progress towards fixing the Java CommAPI v3 "incompatibilities" so RXTX 2.0 can operate within the framework's namespace (javax.comm)? I recall mention of a May time frame. Thanks, Mike From paul.klissner at sun.com Mon May 22 15:09:27 2006 From: paul.klissner at sun.com (Paul Klissner) Date: Mon, 22 May 2006 14:09:27 -0700 Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <447222F3.9040302@spro.net> References: <447222F3.9040302@spro.net> Message-ID: <44722887.8080308@sun.com> Mike Rogers wrote: > Hi, > > Any word from Sun about progress towards fixing the Java CommAPI v3 > "incompatibilities" so RXTX 2.0 can operate within the framework's > namespace (javax.comm)? I recall mention of a May time frame. > > Thanks, > > Mike > We've had a lot of work come in. This hasn't been the only priority. I'm running behind the plan in addressing this, but will be looking at it again soon. Rather than state a new, I'll just say it is in progress, and not off the table. I'll get this fixed as soon as I can. Good timing for asking as we just started discussing javax.comm plans today, and I'll have some cycles to work on it soon. Paul From yhua537 at cse.unsw.edu.au Mon May 22 16:03:05 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Tue, 23 May 2006 08:03:05 +1000 (EST) Subject: [Rxtx] install rxtx in XP Message-ID: Hi Guys, I am new to serial port programming, and have no experience on programming java in xp, but my project require me to builld a communication link between xp and a UART device. Most of the information in the web site seems for linux only. including the commands such as export and chmod. How do I install rxtx in xp? cheers YiQi Huang From mark at mdsh.com Tue May 23 01:24:20 2006 From: mark at mdsh.com (Mark Himsley) Date: Tue, 23 May 2006 08:24:20 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off , it includes DLLs for Windows and the JAR for Java. Follow the Windows instructions in the INSTALL. ie RXTXcomm.jar goes in \jre\lib\ext (under java) rxtxSerial.dll goes in \jre\bin So, assuming a fairly standard Java install, copy RXTXcomm.jar into C:\Program Files\Java\jre1.5.0_06\lib\ext and copy rxtxSerial.dll into C:\Program Files\Java\jre1.5.0_06\bin Yes, it really is that simple. On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > I am new to serial port programming, and have no experience on > programming java in xp, but my project require me to builld a > communication link between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang -- Mark Himsley From joachim at buechse.de Tue May 23 02:51:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 23 May 2006 10:51:47 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) Unless it is absolutely required you should NOT install RXTX in your global Java Runtime Environment. This will for sure create versioning conflicts - if not now, than in the future, if not on your system than at your clients. Instead put the dll in your application directory and include the RXTXcomm.jar in your classpath. This is much safer and not a bit more complicated. Regards, Joachim On 23.05.2006, at 09:24, Mark Himsley wrote: > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR > for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > >> I am new to serial port programming, and have no experience on >> programming java in xp, but my project require me to builld a >> communication link between xp and a UART device. >> >> Most of the information in the web site seems for linux only. >> including >> the commands such as export and chmod. How do I install rxtx in xp? >> >> cheers >> YiQi Huang > > > > -- > Mark Himsley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tod at todbot.com Tue May 23 03:12:22 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 02:12:22 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I totally agree: do not contaminate the Java installation. I put all the RXTX files in a directory and then change my java invocation to be: % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* Alternatively, use Launch4J to create a double-clickable application and keep the RXTX libraries in the directory of the application. -=tod On May 23, 2006, at 1:51 AM, Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > >> Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off >> , it includes DLLs for Windows and the JAR >> for Java. >> >> Follow the Windows instructions in the INSTALL. >> >> ie >> >> RXTXcomm.jar goes in \jre\lib\ext (under java) >> rxtxSerial.dll goes in \jre\bin >> >> So, assuming a fairly standard Java install, copy RXTXcomm.jar into >> C:\Program Files\Java\jre1.5.0_06\lib\ext >> and copy rxtxSerial.dll into >> C:\Program Files\Java\jre1.5.0_06\bin >> >> Yes, it really is that simple. >> >> >> >> On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: >> >>> I am new to serial port programming, and have no experience on >>> programming java in xp, but my project require me to builld a >>> communication link between xp and a UART device. >>> >>> Most of the information in the web site seems for linux only. >>> including >>> the commands such as export and chmod. How do I install rxtx in xp? >>> >>> cheers >>> YiQi Huang >> >> >> >> -- >> Mark Himsley >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From smontgomery at mediaspansoftware.com Tue May 23 08:46:53 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Tue, 23 May 2006 10:46:53 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: Message-ID: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Joachim and Tod mentioned how to keep the files RXTX requires on Windows XP out of the Java installations - thanks gentlemen! Are there similar suggestions for an RXTX install on OS X? The current "canonical" OS X installation instructions "contaminate the Java installation", to use Tod's words. Our app will run fine under 1.4.2 and 5.0 on OS X, and a lot of users will have both. We've already been burned by the recent switch from 1.4.2 to 5.0 as the platform default. Any suggestions welcomed. From tod at todbot.com Tue May 23 13:27:55 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 12:27:55 -0700 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <9BA0F670-A862-42E7-BB2C-130D775ABDF9@todbot.com> Hi Sean, It depends on how you build and deploy your code. If you're using shell scripts, you can do something like this: #!/bin/sh # pick one JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/ Commands/java #JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/ Commands/java $JAVA -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* That both picks which VM to use and uses the RXTX in the directory called 'rxtxlib'. If you want your shell script to be clever, you could test for the existence of the different 'java' executables and go from there (maybe even use different jar files). I am almost positive all OS X systems with Java 1.5 are guaranteed to also have Java 1.4.2. If you're using Jar Builder or XCode, you can specify which JVM to use and add the extra args in the Info.plist file. The paths specified in the 'java' invocation then are based off of the $JAVAROOT variable that the JavaApplicationStub sets for you. For my app, I've have been compiling two sets of jars, one compiled with 1.4.2 and one with 1.5, but they both run under 1.5. So I have a similar shell script that chooses a different 'javac' depending on the need. -=tod On May 23, 2006, at 7:46 AM, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From yhua537 at cse.unsw.edu.au Tue May 23 11:09:37 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 03:09:37 +1000 (EST) Subject: [Rxtx] install rxtx in XP (Mark Himsley, Joachim Buechse, Tod E. Kurt> In-Reply-To: References: Message-ID: > Message: 8 > Date: Tue, 23 May 2006 08:03:05 +1000 (EST) > From: YiQi Huang > Subject: [Rxtx] install rxtx in XP > To: rxtx at qbang.org > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > Hi Guys, > > I am new to serial port programming, and have no experience on programming > java in xp, but my project require me to builld a communication link > between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang > > > ------------------------------ > > Message: 9 > Date: Tue, 23 May 2006 08:24:20 +0100 > From: Mark Himsley > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=us-ascii; format=flowed > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > ------------------------------ > > Message: 10 > Date: Tue, 23 May 2006 10:51:47 +0200 > From: Joachim Buechse > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > > ------------------------------ > > Message: 11 > Date: Tue, 23 May 2006 02:12:22 -0700 > From: "Tod E. Kurt" > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I totally agree: do not contaminate the Java installation. > > I put all the RXTX files in a directory and then change my java > invocation to be: > > % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* > > Alternatively, use Launch4J to create a double-clickable application > and keep the RXTX libraries in the directory of the application. > > -=tod > > Hi, Thanks guys, I don't know if this is the correct way to reply your mecessage, if wrong, please point out. Thank you for Mark to give the detail instructions and Joachim to point out the cons ot installing in the java directory, and specially thanks for Tod to give the instrection in detail. Sorry to ask another stupid question: I have followed Tod's instruction. Now I think i am ready to start hacking. But where is the RXTX API documentation? Is it the same as using normal java comm API? btw, where could i find some examples to start with? Thanks very much cheers YiQi Huang From tjarvi at qbang.org Tue May 23 16:09:32 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 May 2006 16:09:32 -0600 (MDT) Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <44722887.8080308@sun.com> References: <447222F3.9040302@spro.net> <44722887.8080308@sun.com> Message-ID: > Good timing for asking as we just started discussing javax.comm plans > today, and I'll have some cycles to work on it soon. Hi Paul I assume you mean Sun is discussing plans concerning its own internal actions and there is no community involvment at this point. -- Trent Jarvi tjarvi at qbang.org From yhua537 at cse.unsw.edu.au Tue May 23 22:50:01 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 14:50:01 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } From mmester at sps.edu Tue May 23 22:58:21 2006 From: mmester at sps.edu (Michael Mester) Date: Wed, 24 May 2006 00:58:21 -0400 Subject: [Rxtx] install rxtx in XP References: Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below -----Original Message----- From: rxtx-bounces at qbang.org on behalf of YiQi Huang Sent: Wed 5/24/2006 12:50 AM To: RXTX Developers and Users Subject: Re: [Rxtx] install rxtx in XP Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3950 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060523/b36d0c63/attachment-0400.bin From yhua537 at cse.unsw.edu.au Tue May 23 23:05:50 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 15:05:50 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: Yes, Michael you are right, it should be semicolons, But it still can't find the correct library. On Wed, 24 May 2006, Michael Mester wrote: > I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below > > > -----Original Message----- > From: rxtx-bounces at qbang.org on behalf of YiQi Huang > Sent: Wed 5/24/2006 12:50 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] install rxtx in XP > > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > cheers YiQi Huang From tod at todbot.com Wed May 24 00:01:57 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 23:01:57 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Yes, sorry, classpath entries are semicolon-separated on Windows and colon-separated on everything else. Your example code below is importing the wrong set of classes. It should not "import javax.comm.*", instead it should "import gnu.io.*". When I make that change, your example program compiles. The "javax.comm" package is the one released by Sun, the "gnu.io" package is the RXTX one. You might've seen some discussion that the two will be merged or become compatible, but that hasn't happened yet. -=tod On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > > Yes, Michael you are right, it should be semicolons, But it still > can't > find the correct library. > > On Wed, 24 May 2006, Michael Mester wrote: > >> I believe the entries in the classpath need to be seperated with >> semicolons, not a colon as you have in your command below >> >> >> -----Original Message----- >> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >> Sent: Wed 5/24/2006 12:50 AM >> To: RXTX Developers and Users >> Subject: Re: [Rxtx] install rxtx in XP >> >> Hi, >> >> Sorry guys.I follow Tod's instruction, and here is what i did: >> >> put >> RXTXcomm.jar, >> rxtxParallel.dll, >> rxtxSerial.dll >> in >> C:\RXTX_files >> >> and I got a SimpleRead class attached below, compile it with : >> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >> it still saying "cannot find symbol". >> >> Is there anything I did wrong? Do I need the comm.jar from Sun? >> >> Thanks & regards >> YiQi Huang >> >> >> //////////////////////////////////////////////////////// >> // SimpleRead.java >> //////////////////////////////////////////////////////// >> >> import java.io.*; >> import java.util.*; >> import javax.comm.*; >> >> public class SimpleRead >> implements Runnable, SerialPortEventListener { >> static CommPortIdentifier portId; >> static Enumeration portList; >> InputStream inputStream; >> SerialPort serialPort; >> Thread readThread; >> public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == >> CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals("COM1")) { >> //if (portId.getName().equals("/dev/term/a")) { >> SimpleRead reader = new SimpleRead(); >> } >> } >> } >> } >> public SimpleRead() { >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", >> 2000); >> } catch (PortInUseException e) {} >> try { >> inputStream = serialPort.getInputStream(); >> } catch (IOException e) {} >> try { >> serialPort.addEventListener(this); >> } catch (TooManyListenersException e) {} >> serialPort.notifyOnDataAvailable(true); >> try { >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } catch (UnsupportedCommOperationException e) {} >> readThread = new Thread(this); >> readThread.start(); >> } >> public void run() { >> try { >> Thread.sleep(20000); >> } catch (InterruptedException e) {} >> } >> public void serialEvent(SerialPortEvent event) { >> switch(event.getEventType()) { >> case SerialPortEvent.BI: >> case SerialPortEvent.OE: >> case SerialPortEvent.FE: >> case SerialPortEvent.PE: >> case SerialPortEvent.CD: >> case SerialPortEvent.CTS: >> case SerialPortEvent.DSR: >> case SerialPortEvent.RI: >> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >> break; >> case SerialPortEvent.DATA_AVAILABLE: >> byte[] readBuffer = new byte[20]; >> try { >> while (inputStream.available() > 0) { >> int numBytes = inputStream.read(readBuffer); >> } >> System.out.print(new String(readBuffer)); >> } catch (IOException e) {} >> break; >> } >> } >> } >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > cheers > YiQi Huang > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From joachim at buechse.de Wed May 24 00:10:06 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:10:06 +0200 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Hi Sean, my preferred way of dealing with RXTX on OS X is to include the RXTX classes into my application jar and to put the RXTX lib in the same directory as this jar. To make it even more comfortable, you can include the lib in the jar and have some startup code extract it and write it to a temporary file from which you load it with System.load(). Unfortunately the current version of RXTX for OS X requires tinkering with user groups as it is based on lockfiles - and hence it needs the RXTX OS X installer or you need to duplicated this functionality in your own installer. I have created my own native version which is not based on lockfiles but tty locking (the standard way to do it on OSX). I hope that these patches will be integrated soon into the distribution. Regards, Joachim On 23.05.2006, at 16:46, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Wed May 24 00:16:12 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:16:12 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <7017ECFC-B13E-4806-B321-9FFCAC5830F0@buechse.de> I assume you downloaded rxtx-217 (not 207). Instead of importing javax.comm.* you must import gnu.io.* The classes have the same name, but they are not in the same package. On 24.05.2006, at 06:50, YiQi Huang wrote: > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From yhua537 at cse.unsw.edu.au Wed May 24 00:17:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 16:17:45 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Message-ID: Thanks Tod again, i kept reading "gnu.io.*" as "gun.io.*" last few hours after i read some commons from web. Thanks very much Tod. thanks YiQi Huang On Tue, 23 May 2006, Tod E. Kurt wrote: > Yes, sorry, classpath entries are semicolon-separated on Windows and > colon-separated on everything else. > > Your example code below is importing the wrong set of classes. It > should not "import javax.comm.*", instead it should "import > gnu.io.*". When I make that change, your example program compiles. > The "javax.comm" package is the one released by Sun, the "gnu.io" > package is the RXTX one. You might've seen some discussion that the > two will be merged or become compatible, but that hasn't happened yet. > > -=tod > > > On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > >> >> Yes, Michael you are right, it should be semicolons, But it still >> can't >> find the correct library. >> >> On Wed, 24 May 2006, Michael Mester wrote: >> >>> I believe the entries in the classpath need to be seperated with >>> semicolons, not a colon as you have in your command below >>> >>> >>> -----Original Message----- >>> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >>> Sent: Wed 5/24/2006 12:50 AM >>> To: RXTX Developers and Users >>> Subject: Re: [Rxtx] install rxtx in XP >>> >>> Hi, >>> >>> Sorry guys.I follow Tod's instruction, and here is what i did: >>> >>> put >>> RXTXcomm.jar, >>> rxtxParallel.dll, >>> rxtxSerial.dll >>> in >>> C:\RXTX_files >>> >>> and I got a SimpleRead class attached below, compile it with : >>> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >>> it still saying "cannot find symbol". >>> >>> Is there anything I did wrong? Do I need the comm.jar from Sun? >>> >>> Thanks & regards >>> YiQi Huang >>> >>> >>> //////////////////////////////////////////////////////// >>> // SimpleRead.java >>> //////////////////////////////////////////////////////// >>> >>> import java.io.*; >>> import java.util.*; >>> import javax.comm.*; >>> >>> public class SimpleRead >>> implements Runnable, SerialPortEventListener { >>> static CommPortIdentifier portId; >>> static Enumeration portList; >>> InputStream inputStream; >>> SerialPort serialPort; >>> Thread readThread; >>> public static void main(String[] args) { >>> portList = CommPortIdentifier.getPortIdentifiers(); >>> while (portList.hasMoreElements()) { >>> portId = (CommPortIdentifier) portList.nextElement(); >>> if (portId.getPortType() == >>> CommPortIdentifier.PORT_SERIAL) { >>> if (portId.getName().equals("COM1")) { >>> //if (portId.getName().equals("/dev/term/a")) { >>> SimpleRead reader = new SimpleRead(); >>> } >>> } >>> } >>> } >>> public SimpleRead() { >>> try { >>> serialPort = (SerialPort) portId.open("SimpleReadApp", >>> 2000); >>> } catch (PortInUseException e) {} >>> try { >>> inputStream = serialPort.getInputStream(); >>> } catch (IOException e) {} >>> try { >>> serialPort.addEventListener(this); >>> } catch (TooManyListenersException e) {} >>> serialPort.notifyOnDataAvailable(true); >>> try { >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, >>> SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> } catch (UnsupportedCommOperationException e) {} >>> readThread = new Thread(this); >>> readThread.start(); >>> } >>> public void run() { >>> try { >>> Thread.sleep(20000); >>> } catch (InterruptedException e) {} >>> } >>> public void serialEvent(SerialPortEvent event) { >>> switch(event.getEventType()) { >>> case SerialPortEvent.BI: >>> case SerialPortEvent.OE: >>> case SerialPortEvent.FE: >>> case SerialPortEvent.PE: >>> case SerialPortEvent.CD: >>> case SerialPortEvent.CTS: >>> case SerialPortEvent.DSR: >>> case SerialPortEvent.RI: >>> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >>> break; >>> case SerialPortEvent.DATA_AVAILABLE: >>> byte[] readBuffer = new byte[20]; >>> try { >>> while (inputStream.available() > 0) { >>> int numBytes = inputStream.read(readBuffer); >>> } >>> System.out.print(new String(readBuffer)); >>> } catch (IOException e) {} >>> break; >>> } >>> } >>> } >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> >> cheers >> YiQi Huang >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From smontgomery at mediaspansoftware.com Wed May 24 10:24:13 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 12:24:13 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: Tod & Joachim, Thanks for the info, that's very helpful. I'll give that a whirl when I move to rxtx 2.1. I'm still using the older 2.0.7 version for now (don't ask), which probably requires the Sun comm.jar, javax.comm.properties and librxtxSerial.jnilib to be in very specific places in each jvm's file hierarchy. From tjarvi at qbang.org Wed May 24 11:59:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 11:59:16 -0600 (MDT) Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: On Wed, 24 May 2006, Sean Montgomery wrote: > Tod & Joachim, > > Thanks for the info, that's very helpful. I'll give that a whirl > when I move to rxtx 2.1. I'm still using the older 2.0.7 version for > now (don't ask), which probably requires the Sun comm.jar, > javax.comm.properties and librxtxSerial.jnilib to be in very specific > places in each jvm's file hierarchy. > You will need comm.jar from Sun then. It must be Sun's version 2.* or older for Linux or Solaris. I assume they have this in download archives. The default offering from Sun is version 3.0. This version currently does not support rxtx. The older version will probably be fine for your needs. -- Trent Jarvi tjarvi at qbang.org From smontgomery at mediaspansoftware.com Wed May 24 12:19:06 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 14:19:06 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: <3939EFB8-11E1-4E3E-A684-5B3C525577CD@mediaspansoftware.com> Yup, that's right, thanks Trent. I've been using these files for quite a while now. Thanks for bringing it up. I almost didn't mention using 2.0.7 because I didn't want to give any new members of the list the wrong idea! :-) On May 24, 2006, at 1:59 PM, Trent Jarvi wrote: > On Wed, 24 May 2006, Sean Montgomery wrote: > >> Tod & Joachim, >> >> Thanks for the info, that's very helpful. I'll give that a whirl >> when I move to rxtx 2.1. I'm still using the older 2.0.7 version for >> now (don't ask), which probably requires the Sun comm.jar, >> javax.comm.properties and librxtxSerial.jnilib to be in very specific >> places in each jvm's file hierarchy. >> > > You will need comm.jar from Sun then. It must be Sun's version 2.* or > older for Linux or Solaris. I assume they have this in download > archives. > > The default offering from Sun is version 3.0. This version > currently does > not support rxtx. > > The older version will probably be fine for your needs. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mark at mdsh.com Wed May 24 15:55:46 2006 From: mark at mdsh.com (Mark Himsley) Date: Wed, 24 May 2006 22:55:46 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <37B0FC4B1F3237321F093ABE@MacMini.local> On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) That's no problem. BUT, do note that the instructions I elaborated on are in the INSTALL file within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone please update the INSTALL file? > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > > , it includes DLLs for Windows and the JAR > > for Java. > > > > Follow the Windows instructions in the INSTALL. > > > > ie > > > > RXTXcomm.jar goes in \jre\lib\ext (under java) > > rxtxSerial.dll goes in \jre\bin > > > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > > C:\Program Files\Java\jre1.5.0_06\lib\ext > > and copy rxtxSerial.dll into > > C:\Program Files\Java\jre1.5.0_06\bin > > > > Yes, it really is that simple. > > > > > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > > > >> I am new to serial port programming, and have no experience on > >> programming java in xp, but my project require me to builld a > >> communication link between xp and a UART device. > >> > >> Most of the information in the web site seems for linux only. > >> including > >> the commands such as export and chmod. How do I install rxtx in xp? > >> > >> cheers > >> YiQi Huang > > > > > > > > -- > > Mark Himsley > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Mark Himsley From tjarvi at qbang.org Wed May 24 16:41:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 16:41:46 -0600 (MDT) Subject: [Rxtx] install rxtx in XP In-Reply-To: <37B0FC4B1F3237321F093ABE@MacMini.local> References: <37B0FC4B1F3237321F093ABE@MacMini.local> Message-ID: On Wed, 24 May 2006, Mark Himsley wrote: > > > On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > >> I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > That's no problem. > > BUT, do note that the instructions I elaborated on are in the INSTALL file > within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone > please update the INSTALL file? > > The INSTALL file may be updated by anyone at anytime. http://rxtx.qbang.org/wiki/index.php/Installation We are moving it to the wiki so end users may put the type of answers they would like to see in. Sometimes it's best if developers don't give what appears to be cryptic answers. You can even put in that jre/lib/ext is not the right place but you don't understand the classpath solution mentioned on the mail-list and then we know what to add. -- Trent Jarvi tjarvi at qbang.org From stramit at gmail.com Wed May 24 21:45:31 2006 From: stramit at gmail.com (Tim Cooper) Date: Thu, 25 May 2006 13:45:31 +1000 Subject: [Rxtx] Accessing Virtual Com Port Message-ID: Hi, I have to develop an application that talks to a virtual com port (in this case com3) which translates any messages sent across a USB cable to a micro. Using C++ I can talk to this com port and I know that it is configured, present, and working. For the application that I am trying to write I want to use RXTX for the communication. My problem is that the configured virtual port (in windows) is not showing up when I do an enumeration over the available ports. The output I get is (com 3 is not present) : Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 PORT FOUND: COM1 PORT FOUND: LPT1 Is there anything that I need to do to make com3 available to RXTX and my application? Timothy Cooper -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060524/c5591648/attachment-0400.html From antonio.luis at iscte.pt Thu May 25 01:39:13 2006 From: antonio.luis at iscte.pt (=?ISO-8859-1?Q?Ant=F3nio_Lopes?=) Date: Thu, 25 May 2006 08:39:13 +0100 Subject: [Rxtx] RXTX on Pocket PC Message-ID: <44755F21.8060103@iscte.pt> Hello everyone, I've been using RXTX to communicate with serial ports in Windows and it's been quite successful. However, I'm now considering porting my application from Windows to Pocket PC but I can't seem to find the RXTX binaries (*.jar and *.dll) to use in Pocket PC. I've been "digging" on the mailing list's archives and also on the web and I can't find these anywhere. Can anyone in this mailing list give me some pointers on this? Where can I find the necessary files and basic installation instructions? Thanks very much for your help. I very much appreciate any help that you can provide me. Regards, -- Ant?nio Lopes @contact: antonio.luis at iscte.pt @work: ADETTI - ISCTE @web: http://antonio.lopes.googlepages.com/home From doug at dupreeinc.com Fri May 26 15:45:50 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Fri, 26 May 2006 14:45:50 -0700 Subject: [Rxtx] rxtx slow startup Message-ID: <4477770E.9010400@dupreeinc.com> Hello, I hope there are people still reading this mailing list. The archive appeared to not have anything new after 4/2005. I was using the commapi from sun for a project where a java application reads data from test equipment connected to the serial port. I had to upgrade the ftdi vcp driver on my pc and the old sun commapi no longer works with hardware flow control. as an experiment I replaced the javax.com with gnu.io in the SerialDemo.java project that was included with the commapi. This compiled fine using JBuilder 2006 and JRE 1.5.0_05. RXTX also works with the latest ftdi drivers so life is wonderful again... almost... When using the commapi jar the SerialDemo program starts in about 1 second on my system. Using the RXTX jar it takes over 56 seconds to start. Has anyone else seen this problem? Is there a workaround to get the startup performance close to the old commapi? The last thing printed to the console before this delay is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks for your time! Doug From yhua537 at cse.unsw.edu.au Sat May 27 05:46:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 21:46:45 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <4477770E.9010400@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> Message-ID: hi Doug The archive hasn't been update for a long time, But people certainly still reading the list. I don't have enough experience to help on your problem, but without any detail about what your problem doing during that 56 seconds, it is hard to target the your question, I think. cheers YiQi On Fri, 26 May 2006, Doug Thistlethwaite wrote: > Hello, > > I hope there are people still reading this mailing list. The archive > appeared to not have anything new after 4/2005. > > I was using the commapi from sun for a project where a java application > reads data from test equipment connected to the serial port. I had to > upgrade the ftdi vcp driver on my pc and the old sun commapi no longer > works with hardware flow control. as an experiment I replaced the > javax.com with gnu.io in the SerialDemo.java project that was included > with the commapi. This compiled fine using JBuilder 2006 and JRE > 1.5.0_05. RXTX also works with the latest ftdi drivers so life is > wonderful again... almost... > > When using the commapi jar the SerialDemo program starts in about 1 > second on my system. Using the RXTX jar it takes over 56 seconds to > start. Has anyone else seen this problem? Is there a workaround to get > the startup performance close to the old commapi? > > The last thing printed to the console before this delay is: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Thanks for your time! > > Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------- Just a student, Still a student ------------------------------- From yhua537 at cse.unsw.edu.au Sat May 27 06:04:26 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 22:04:26 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: Sorry, I don't think you could understand what I mean .I mean this: Without any detail about what your program is doing during that 56 seconds, it is hard for anyone to target the problem. On Sat, 27 May 2006, YiQi Huang wrote: > hi Doug > > The archive hasn't been update for a long time, But people certainly still > reading the list. > > I don't have enough experience to help on your problem, but without any > detail about what your problem doing during that 56 seconds, it is hard to > target the your question, I think. > > cheers > YiQi > > On Fri, 26 May 2006, Doug Thistlethwaite wrote: > >> Hello, >> >> I hope there are people still reading this mailing list. The archive >> appeared to not have anything new after 4/2005. >> >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From jredman at ergotech.com Sat May 27 08:32:02 2006 From: jredman at ergotech.com (Jim Redman) Date: Sat, 27 May 2006 08:32:02 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: <447862E2.4080506@ergotech.com> Doug, Since you mentioned it, we have a system that is also seems slow. From memory (I don't have one of the slow systems around), I'm not sure that it's consistent, it seems that sometimes it may take longer than others. Since it's part of the bootup it hasn't raised a flag and I haven't researched it. The same code runs much faster on other systems, so now you've got me wondering what's different. The slow system boots DSL (http://www.damnsmalllinux.org/) from a compact flash. FC4 is on my desktop where I haven't noticed a slow down. I think that the rxtx code is the same in both cases with lock files disabled. The slow system has a bunch of serial ports defined, including 4 USB serial ports that do not exist - they are not plugged in. Any clues in there? Jim > On Fri, 26 May 2006, Doug Thistlethwaite wrote: >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Sat May 27 10:41:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 May 2006 10:41:54 -0600 (MDT) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447862E2.4080506@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: On Sat, 27 May 2006, Jim Redman wrote: > Doug, > > Since you mentioned it, we have a system that is also seems slow. From > memory (I don't have one of the slow systems around), I'm not sure that > it's consistent, it seems that sometimes it may take longer than others. > Since it's part of the bootup it hasn't raised a flag and I haven't > researched it. > > The same code runs much faster on other systems, so now you've got me > wondering what's different. > > The slow system boots DSL (http://www.damnsmalllinux.org/) from a > compact flash. FC4 is on my desktop where I haven't noticed a slow > down. I think that the rxtx code is the same in both cases with lock > files disabled. > > The slow system has a bunch of serial ports defined, including 4 USB > serial ports that do not exist - they are not plugged in. > > Any clues in there? > rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. When it does this, it will try to open each port and do a timed out read. most systems will not have entries in device if the port is not there. But some minimal systems will just put all the device files there in case hardware is added. The list of devices scanned used to be ~10-20 times longer than it is today. That was getting very slow. I suspect moving the device files not used to a backup directory would increase the enumeration. I'll look into why the mail-list archive is not updating. The last update was about when I thought I 'fixed' the cron jobs. I probably didn't actually fix it but rather moved the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon May 29 19:46:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 May 2006 19:46:47 -0600 (MDT) Subject: [Rxtx] Mail-List Archives are updating. Message-ID: It was pointed out earlier that the archive is dated. This was a missing crontab entry. The list is currently archived by the week on the web page. It is updated once a day. So every 7 days it starts a new link and updates it daily. I've been limited in what I could do while my cable modem was disconnected this last week. rxtx.org is something I do on my own time. The patches and credits will be comming next. Many of these can be seen in bugzilla right now. -- Trent Jarvi tjarvi at qbang.org From doug at dupreeinc.com Tue May 30 11:18:41 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 10:18:41 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: <447C7E71.4080204@dupreeinc.com> Trent, YiQi, and Jim: Thanks to all for the replies and information! I am just back from a long weekend and I am now trying to figure out what I was doing! :) As for more information. First off, this example is being run under windows XP. I am developing test equipment that communicates with a java application via a serial port. I have been using the commapi for several years and have not had a problem. Recently, I have started a design modification that will replace the RS232 connection with a USB port. I am using the ftdi module for prototyping and I discovered that their virtual com port driver was not compatible with the commapi that Sun released. It turns out that it has problems with hardware flow control ( it works on incoming but not outgoing communications). The way I figured this out was by experimenting with the SerialDemo that was included with the Sum commapi. One nice thing about this example is it has the ability to set incoming and outgoing flow control independently. After I installed RXTX into my JBuilder 2006 IDE, I just replaced all all instances of javax.comm with gnu.io and it compiled and runs without a hitch (except for the slow startup). I Paused the JBuilder IDE during this long pause and the last few entries in the stack trace are: testRead() : -1, gnu.io.RXTXCommDriver registerValidPorts() : 255, gnu.io.RXTXCommDriver registerScannedPorts() : 777, gnu.io.RXTXCommDriver This was all initiated by the following call in the programs init routine: Enumeration en = CommPortIdentifier.getPortIdentifiers(); After looking at this, My guess is that Trent is correct in that the delay is in scanning for ports. I guess one solution would be to not scan for ports, though it would be nice to detect what is available on the system. Is there any way to reduce the number of ports scanned by this function in windows XP? Thanks again for your time, Doug Trent Jarvi wrote: >On Sat, 27 May 2006, Jim Redman wrote: > > > >>Doug, >> >>Since you mentioned it, we have a system that is also seems slow. From >>memory (I don't have one of the slow systems around), I'm not sure that >>it's consistent, it seems that sometimes it may take longer than others. >>Since it's part of the bootup it hasn't raised a flag and I haven't >>researched it. >> >>The same code runs much faster on other systems, so now you've got me >>wondering what's different. >> >>The slow system boots DSL (http://www.damnsmalllinux.org/) from a >>compact flash. FC4 is on my desktop where I haven't noticed a slow >>down. I think that the rxtx code is the same in both cases with lock >>files disabled. >> >>The slow system has a bunch of serial ports defined, including 4 USB >>serial ports that do not exist - they are not plugged in. >> >>Any clues in there? >> >> >> > >rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. > >When it does this, it will try to open each port and do a timed out read. >most systems will not have entries in device if the port is not there. >But some minimal systems will just put all the device files there in case >hardware is added. > >The list of devices scanned used to be ~10-20 times longer than it is >today. That was getting very slow. > >I suspect moving the device files not used to a backup directory would >increase the enumeration. > >I'll look into why the mail-list archive is not updating. The last update >was about when I thought I 'fixed' the cron jobs. I probably didn't >actually fix it but rather moved the problem. > >-- >Trent Jarvi >tjarvi at qbang.org > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/86796453/attachment-0397.html From doug at dupreeinc.com Tue May 30 14:36:09 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 13:36:09 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447C7E71.4080204@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com> Message-ID: <447CACB9.1000801@dupreeinc.com> Hello all, I also notice this pause (not as long however) when I call: CommPortIdentifier.getPortIdentifier(PortName); I would think that if I supply the name of the port, it would not have to go through the same discovery process. If you have any ideas of how to get rid of this startup delay, I would really appreciate it. Thanks, Doug Doug Thistlethwaite wrote: > Trent, YiQi, and Jim: > > Thanks to all for the replies and information! I am just back from a > long weekend and I am now trying to figure out what I was doing! :) > > As for more information. First off, this example is being run under > windows XP. I am developing test equipment that communicates with a > java application via a serial port. I have been using the commapi for > several years and have not had a problem. Recently, I have started a > design modification that will replace the RS232 connection with a USB > port. I am using the ftdi module for prototyping and I discovered > that their virtual com port driver was not compatible with the commapi > that Sun released. It turns out that it has problems with hardware > flow control ( it works on incoming but not outgoing communications). > The way I figured this out was by experimenting with the SerialDemo > that was included with the Sum commapi. One nice thing about this > example is it has the ability to set incoming and outgoing flow > control independently. > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup). > > I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are: > > testRead() : -1, gnu.io.RXTXCommDriver > registerValidPorts() : 255, gnu.io.RXTXCommDriver > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > This was all initiated by the following call in the programs init routine: > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > After looking at this, My guess is that Trent is correct in that the > delay is in scanning for ports. I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system. Is there any way to reduce the number of ports scanned by > this function in windows XP? > > Thanks again for your time, > > Doug > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/edaa5c3c/attachment-0397.html From lynn at swcp.com Tue May 30 15:07:18 2006 From: lynn at swcp.com (lynn@swcp.com) Date: Tue, 30 May 2006 21:07:18 -0000 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CACB9.1000801@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: *IF* the name of the port is supplied, we might want to use the preferences mechanism (java.util.prefs) where we could have previously saved the info for the port. We could do a quick check to see that things have not changed before using it. If things have changed (or never been defined) we would do a full port scan and save detected ports in the preferences. This way if the hardware is not changed, you only pay the time penalty one time. just an idea... Lynn Doug Thistlethwaite said: > This is a multi-part message in MIME format. > --------------070808020900080005070500 > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > Content-Transfer-Encoding: 7bit > > Hello all, > > I also notice this pause (not as long however) when I call: > > CommPortIdentifier.getPortIdentifier(PortName); > > I would think that if I supply the name of the port, it would not have > to go through the same discovery process. If you have any ideas of how > to get rid of this startup delay, I would really appreciate it. > > Thanks, > > Doug > > Doug Thistlethwaite wrote: > > > Trent, YiQi, and Jim: > > > > Thanks to all for the replies and information! I am just back from a > > long weekend and I am now trying to figure out what I was doing! :) > > > > As for more information. First off, this example is being run under > > windows XP. I am developing test equipment that communicates with a > > java application via a serial port. I have been using the commapi for > > several years and have not had a problem. Recently, I have started a > > design modification that will replace the RS232 connection with a USB > > port. I am using the ftdi module for prototyping and I discovered > > that their virtual com port driver was not compatible with the commapi > > that Sun released. It turns out that it has problems with hardware > > flow control ( it works on incoming but not outgoing communications). > > The way I figured this out was by experimenting with the SerialDemo > > that was included with the Sum commapi. One nice thing about this > > example is it has the ability to set incoming and outgoing flow > > control independently. > > > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > > all instances of javax.comm with gnu.io and it compiled and runs > > without a hitch (except for the slow startup). > > > > I Paused the JBuilder IDE during this long pause and the last few > > entries in the stack trace are: > > > > testRead() : -1, gnu.io.RXTXCommDriver > > registerValidPorts() : 255, gnu.io.RXTXCommDriver > > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > > > This was all initiated by the following call in the programs init routine: > > > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > > > After looking at this, My guess is that Trent is correct in that the > > delay is in scanning for ports. I guess one solution would be to not > > scan for ports, though it would be nice to detect what is available on > > the system. Is there any way to reduce the number of ports scanned by > > this function in windows XP? > > > > Thanks again for your time, > > > > Doug > > > > --------------070808020900080005070500 > Content-Type: text/html; charset=ISO-8859-1 > Content-Transfer-Encoding: 7bit > > > > > > > > > Hello all,
>
> I also notice this pause (not as long however) when I call:
>
>          CommPortIdentifier.getPortIdentifier(PortName);
>
> I would think that if I supply the name of the port, it would not have > to go through the same discovery process.  If you have any ideas of how > to get rid of this startup delay, I would really appreciate it.
>
> Thanks,
>
> Doug
>
> Doug Thistlethwaite wrote: >
> > Trent, YiQi, and Jim:
>
> Thanks to all for the replies and information!  I am just back from a > long weekend and I am now trying to figure out what I was doing! :)
>
> As for more information.  First off, this example is being run under > windows XP.  I am developing test equipment that communicates with a > java application via a serial port.  I have been using the commapi for > several years and have not had a problem.  Recently, I have started a > design modification that will replace the RS232 connection with a USB > port.  I am using the ftdi module for prototyping and I discovered that > their virtual com port driver was not compatible with the commapi that > Sun released.  It turns out that it has problems with hardware flow > control ( it works on incoming but not outgoing communications).  The > way I figured this out was by experimenting with the SerialDemo that > was included with the Sum commapi.  One nice thing about this example > is it has the ability to set incoming and outgoing flow control > independently.
>
> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup).
>
> I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are:
>
> testRead() : -1, gnu.io.RXTXCommDriver
> registerValidPorts() : 255, gnu.io.RXTXCommDriver
> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>
> This was all initiated by the following call in the programs init > routine:
>
> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>
> After looking at this,  My guess is that Trent is correct in that the > delay is in scanning for ports.  I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system.  Is there any way to reduce the number of ports scanned by > this function in windows XP? 
>
> Thanks again for your time,
>
> Doug
>
>
> > > > --------------070808020900080005070500-- > -- From jredman at ergotech.com Tue May 30 15:42:35 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 30 May 2006 15:42:35 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: <447CBC4B.2080206@ergotech.com> Lynn, If I understand your idea correctly, I don't think that this would work well for, say, USB ports since these can be easily added/removed by the end user. Jim lynn at swcp.com wrote: > *IF* the name of the port is supplied, we might want to use the preferences > mechanism (java.util.prefs) where we could have previously saved the info for > the port. We could do a quick check to see that things have not changed > before using it. If things have changed (or never been defined) we would do a > full port scan and save detected ports in the preferences. > > This way if the hardware is not changed, you only pay the time penalty one time. > > just an idea... > Lynn > > > Doug Thistlethwaite said: > >> This is a multi-part message in MIME format. >> --------------070808020900080005070500 >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >> Content-Transfer-Encoding: 7bit >> >> Hello all, >> >> I also notice this pause (not as long however) when I call: >> >> CommPortIdentifier.getPortIdentifier(PortName); >> >> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process. If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it. >> >> Thanks, >> >> Doug >> >> Doug Thistlethwaite wrote: >> >>> Trent, YiQi, and Jim: >>> >>> Thanks to all for the replies and information! I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :) >>> >>> As for more information. First off, this example is being run under >>> windows XP. I am developing test equipment that communicates with a >>> java application via a serial port. I have been using the commapi for >>> several years and have not had a problem. Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port. I am using the ftdi module for prototyping and I discovered >>> that their virtual com port driver was not compatible with the commapi >>> that Sun released. It turns out that it has problems with hardware >>> flow control ( it works on incoming but not outgoing communications). >>> The way I figured this out was by experimenting with the SerialDemo >>> that was included with the Sum commapi. One nice thing about this >>> example is it has the ability to set incoming and outgoing flow >>> control independently. >>> >>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup). >>> >>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are: >>> >>> testRead() : -1, gnu.io.RXTXCommDriver >>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>> >>> This was all initiated by the following call in the programs init routine: >>> >>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>> >>> After looking at this, My guess is that Trent is correct in that the >>> delay is in scanning for ports. I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system. Is there any way to reduce the number of ports scanned by >>> this function in windows XP? >>> >>> Thanks again for your time, >>> >>> Doug >>> >> --------------070808020900080005070500 >> Content-Type: text/html; charset=ISO-8859-1 >> Content-Transfer-Encoding: 7bit >> >> >> >> >> >> >> >> >> Hello all,
>>
>> I also notice this pause (not as long however) when I call:
>>
>>         >  CommPortIdentifier.getPortIdentifier(PortName);
>>
>> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process.  If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it.
>>
>> Thanks,
>>
>> Doug
>>
>> Doug Thistlethwaite wrote: >>
>> >> Trent, YiQi, and Jim:
>>
>> Thanks to all for the replies and information!  I am just back from a >> long weekend and I am now trying to figure out what I was doing! :)
>>
>> As for more information.  First off, this example is being run under >> windows XP.  I am developing test equipment that communicates with a >> java application via a serial port.  I have been using the commapi for >> several years and have not had a problem.  Recently, I have started a >> design modification that will replace the RS232 connection with a USB >> port.  I am using the ftdi module for prototyping and I discovered that >> their virtual com port driver was not compatible with the commapi that >> Sun released.  It turns out that it has problems with hardware flow >> control ( it works on incoming but not outgoing communications).  The >> way I figured this out was by experimenting with the SerialDemo that >> was included with the Sum commapi.  One nice thing about this example >> is it has the ability to set incoming and outgoing flow control >> independently.
>>
>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >> all instances of javax.comm with gnu.io and it compiled and runs >> without a hitch (except for the slow startup).
>>
>> I Paused the JBuilder IDE during this long pause and the last few >> entries in the stack trace are:
>>
>> testRead() : -1, gnu.io.RXTXCommDriver
>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>
>> This was all initiated by the following call in the programs init >> routine:
>>
>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>
>> After looking at this,  My guess is that Trent is correct in that the >> delay is in scanning for ports.  I guess one solution would be to not >> scan for ports, though it would be nice to detect what is available on >> the system.  Is there any way to reduce the number of ports scanned by >> this function in windows XP? 
>>
>> Thanks again for your time,
>>
>> Doug
>>
>>
>> >> >> >> --------------070808020900080005070500-- >> > > > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From yhua537 at cse.unsw.edu.au Tue May 30 18:10:23 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 31 May 2006 10:10:23 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CBC4B.2080206@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: Doug, In the SerialDemo, it allow us to save the parameters into a file, and use it when your program start up. Would this help? YiQi On Tue, 30 May 2006, Jim Redman wrote: > Lynn, > > If I understand your idea correctly, I don't think that this would work > well for, say, USB ports since these can be easily added/removed by the > end user. > > Jim > > lynn at swcp.com wrote: >> *IF* the name of the port is supplied, we might want to use the preferences >> mechanism (java.util.prefs) where we could have previously saved the info for >> the port. We could do a quick check to see that things have not changed >> before using it. If things have changed (or never been defined) we would do a >> full port scan and save detected ports in the preferences. >> >> This way if the hardware is not changed, you only pay the time penalty one time. >> >> just an idea... >> Lynn >> >> >> Doug Thistlethwaite said: >> >>> This is a multi-part message in MIME format. >>> --------------070808020900080005070500 >>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>> Content-Transfer-Encoding: 7bit >>> >>> Hello all, >>> >>> I also notice this pause (not as long however) when I call: >>> >>> CommPortIdentifier.getPortIdentifier(PortName); >>> >>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process. If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it. >>> >>> Thanks, >>> >>> Doug >>> >>> Doug Thistlethwaite wrote: >>> >>>> Trent, YiQi, and Jim: >>>> >>>> Thanks to all for the replies and information! I am just back from a >>>> long weekend and I am now trying to figure out what I was doing! :) >>>> >>>> As for more information. First off, this example is being run under >>>> windows XP. I am developing test equipment that communicates with a >>>> java application via a serial port. I have been using the commapi for >>>> several years and have not had a problem. Recently, I have started a >>>> design modification that will replace the RS232 connection with a USB >>>> port. I am using the ftdi module for prototyping and I discovered >>>> that their virtual com port driver was not compatible with the commapi >>>> that Sun released. It turns out that it has problems with hardware >>>> flow control ( it works on incoming but not outgoing communications). >>>> The way I figured this out was by experimenting with the SerialDemo >>>> that was included with the Sum commapi. One nice thing about this >>>> example is it has the ability to set incoming and outgoing flow >>>> control independently. >>>> >>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>> all instances of javax.comm with gnu.io and it compiled and runs >>>> without a hitch (except for the slow startup). >>>> >>>> I Paused the JBuilder IDE during this long pause and the last few >>>> entries in the stack trace are: >>>> >>>> testRead() : -1, gnu.io.RXTXCommDriver >>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>> >>>> This was all initiated by the following call in the programs init routine: >>>> >>>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>> >>>> After looking at this, My guess is that Trent is correct in that the >>>> delay is in scanning for ports. I guess one solution would be to not >>>> scan for ports, though it would be nice to detect what is available on >>>> the system. Is there any way to reduce the number of ports scanned by >>>> this function in windows XP? >>>> >>>> Thanks again for your time, >>>> >>>> Doug >>>> >>> --------------070808020900080005070500 >>> Content-Type: text/html; charset=ISO-8859-1 >>> Content-Transfer-Encoding: 7bit >>> >>> >>> >>> >>> >>> >>> >>> >>> Hello all,
>>>
>>> I also notice this pause (not as long however) when I call:
>>>
>>>         >>  CommPortIdentifier.getPortIdentifier(PortName);
>>>
>>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process.  If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it.
>>>
>>> Thanks,
>>>
>>> Doug
>>>
>>> Doug Thistlethwaite wrote: >>>
>>> >>> Trent, YiQi, and Jim:
>>>
>>> Thanks to all for the replies and information!  I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :)
>>>
>>> As for more information.  First off, this example is being run under >>> windows XP.  I am developing test equipment that communicates with a >>> java application via a serial port.  I have been using the commapi for >>> several years and have not had a problem.  Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port.  I am using the ftdi module for prototyping and I discovered that >>> their virtual com port driver was not compatible with the commapi that >>> Sun released.  It turns out that it has problems with hardware flow >>> control ( it works on incoming but not outgoing communications).  The >>> way I figured this out was by experimenting with the SerialDemo that >>> was included with the Sum commapi.  One nice thing about this example >>> is it has the ability to set incoming and outgoing flow control >>> independently.
>>>
>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup).
>>>
>>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are:
>>>
>>> testRead() : -1, gnu.io.RXTXCommDriver
>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>
>>> This was all initiated by the following call in the programs init >>> routine:
>>>
>>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>
>>> After looking at this,  My guess is that Trent is correct in that the >>> delay is in scanning for ports.  I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system.  Is there any way to reduce the number of ports scanned by >>> this function in windows XP? 
>>>
>>> Thanks again for your time,
>>>
>>> Doug
>>>
>>>
>>> >>> >>> >>> --------------070808020900080005070500-- >>> >> >> >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From halbleib at rechnerbetriebsgruppe.de Wed May 31 02:06:16 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 10:06:16 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp Message-ID: <447D4E78.30302@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, I getting an error while reloading my app in tomcat. At the first start everything runs well, but if i reload mit webapp by tomcat manager i get the following error. java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader Is there a possibility to unload the native library rxtxSerial.dll? thx for all help! regards tom -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 b8FT80HQ1xlbDLnRecDANCc= =heb1 -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 02:52:17 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 10:52:17 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D4E78.30302@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> Message-ID: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Hello Tom, To the best of my knowledge it is impossible to unload native libraries once loaded into the JVM. The exception you see stems from the fact, that Tomcat creates a new classloader when you "reload" the weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar is loaded from the session class loader. Try to add RXTXComm.jar to your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. Regards, Joachim On 31.05.2006, at 10:06, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 > b8FT80HQ1xlbDLnRecDANCc= > =heb1 > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From halbleib at rechnerbetriebsgruppe.de Wed May 31 03:28:35 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 11:28:35 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Message-ID: <447D61C3.1030807@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Joachim, I'm still not getting it. How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml-file? Perhaps web.xml? Regards, Tom Joachim Buechse schrieb: > Hello Tom, > > To the best of my knowledge it is impossible to unload native > libraries once loaded into the JVM. The exception you see stems from > the fact, that Tomcat creates a new classloader when you "reload" the > weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar > is loaded from the session class loader. Try to add RXTXComm.jar to > your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. > > Regards, > Joachim > > On 31.05.2006, at 10:06, Tom Halbleib wrote: > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL tzNy+/0iIUfkYYgt1+UT1ko= =pkpY -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 04:03:42 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 12:03:42 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D61C3.1030807@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> <447D61C3.1030807@rechnerbetriebsgruppe.de> Message-ID: -Xbootclasspath/a: is a start option to the java vm. Google is your friend in finding how to modfiy it and what it means: tomcat modifying bootclasspath Regards, Joachim On 31.05.2006, at 11:28, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Joachim, > > I'm still not getting it. > How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml- > file? > Perhaps web.xml? > > Regards, > Tom > > Joachim Buechse schrieb: >> Hello Tom, >> >> To the best of my knowledge it is impossible to unload native >> libraries once loaded into the JVM. The exception you see stems from >> the fact, that Tomcat creates a new classloader when you "reload" the >> weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar >> is loaded from the session class loader. Try to add RXTXComm.jar to >> your bootlclasspath (-Xbootclasspath/a:) and the problem should go >> away. >> >> Regards, >> Joachim >> >> On 31.05.2006, at 10:06, Tom Halbleib wrote: >> >> Hi all, >> >> I getting an error while reloading my app in tomcat. At the first >> start >> everything runs well, but if i reload mit webapp by tomcat manager >> i get >> the following error. >> >> java.lang.UnsatisfiedLinkError: Native Library >> C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in >> another classloader thrown while loading gnu.io.RXTXCommDriver >> Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: >> Native >> Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already >> loaded >> in another classloader >> >> >> Is there a possibility to unload the native library rxtxSerial.dll? >> >> thx for all help! >> >> regards >> >> tom > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL > tzNy+/0iIUfkYYgt1+UT1ko= > =pkpY > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From impakt01 at optusnet.com.au Wed May 31 06:55:42 2006 From: impakt01 at optusnet.com.au (Daren) Date: Wed, 31 May 2006 22:55:42 +1000 Subject: [Rxtx] (no subject) Message-ID: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/ade7ad37/attachment-0397.html From doug at dupreeinc.com Wed May 31 10:19:19 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 31 May 2006 09:19:19 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: <447DC207.3070702@dupreeinc.com> I am not sure what you are saying. The Save parameters menu option saves the current settings (baud, data bits, etc.). The long pause (~60 seconds) is when the application first starts (before loading the saved parameters). This does bring up a question, though I hate this type of kludge approach to getting this library to work... What exactly is a PortIdentifier? Is it always the same? If I stored the results from "CommPortIdentifier.getPortIdentifier(PortName);" in a file, could I use this the next time the program is executed? In this case I am using a virtual com port driver to connect to the device through a USB port. Doug YiQi Huang wrote: >Doug, > >In the SerialDemo, it allow us to save the parameters into a file, and use >it when your program start up. Would this help? > >YiQi > >On Tue, 30 May 2006, Jim Redman wrote: > > > >>Lynn, >> >>If I understand your idea correctly, I don't think that this would work >>well for, say, USB ports since these can be easily added/removed by the >>end user. >> >>Jim >> >>lynn at swcp.com wrote: >> >> >>>*IF* the name of the port is supplied, we might want to use the preferences >>>mechanism (java.util.prefs) where we could have previously saved the info for >>>the port. We could do a quick check to see that things have not changed >>>before using it. If things have changed (or never been defined) we would do a >>>full port scan and save detected ports in the preferences. >>> >>>This way if the hardware is not changed, you only pay the time penalty one time. >>> >>>just an idea... >>>Lynn >>> >>> >>>Doug Thistlethwaite said: >>> >>> >>> >>>>This is a multi-part message in MIME format. >>>>--------------070808020900080005070500 >>>>Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>>>Content-Transfer-Encoding: 7bit >>>> >>>>Hello all, >>>> >>>>I also notice this pause (not as long however) when I call: >>>> >>>> CommPortIdentifier.getPortIdentifier(PortName); >>>> >>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process. If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it. >>>> >>>>Thanks, >>>> >>>>Doug >>>> >>>>Doug Thistlethwaite wrote: >>>> >>>> >>>> >>>>>Trent, YiQi, and Jim: >>>>> >>>>>Thanks to all for the replies and information! I am just back from a >>>>>long weekend and I am now trying to figure out what I was doing! :) >>>>> >>>>>As for more information. First off, this example is being run under >>>>>windows XP. I am developing test equipment that communicates with a >>>>>java application via a serial port. I have been using the commapi for >>>>>several years and have not had a problem. Recently, I have started a >>>>>design modification that will replace the RS232 connection with a USB >>>>>port. I am using the ftdi module for prototyping and I discovered >>>>>that their virtual com port driver was not compatible with the commapi >>>>>that Sun released. It turns out that it has problems with hardware >>>>>flow control ( it works on incoming but not outgoing communications). >>>>>The way I figured this out was by experimenting with the SerialDemo >>>>>that was included with the Sum commapi. One nice thing about this >>>>>example is it has the ability to set incoming and outgoing flow >>>>>control independently. >>>>> >>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>>without a hitch (except for the slow startup). >>>>> >>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>>entries in the stack trace are: >>>>> >>>>>testRead() : -1, gnu.io.RXTXCommDriver >>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>>> >>>>>This was all initiated by the following call in the programs init routine: >>>>> >>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>>> >>>>>After looking at this, My guess is that Trent is correct in that the >>>>>delay is in scanning for ports. I guess one solution would be to not >>>>>scan for ports, though it would be nice to detect what is available on >>>>>the system. Is there any way to reduce the number of ports scanned by >>>>>this function in windows XP? >>>>> >>>>>Thanks again for your time, >>>>> >>>>>Doug >>>>> >>>>> >>>>> >>>>--------------070808020900080005070500 >>>>Content-Type: text/html; charset=ISO-8859-1 >>>>Content-Transfer-Encoding: 7bit >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>>Hello all,
>>>>
>>>>I also notice this pause (not as long however) when I call:
>>>>
>>>>        >>>> >>>> >>> CommPortIdentifier.getPortIdentifier(PortName);
>>> >>> >>>>
>>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process.  If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it.
>>>>
>>>>Thanks,
>>>>
>>>>Doug
>>>>
>>>>Doug Thistlethwaite wrote: >>>>
>>>> >>>>Trent, YiQi, and Jim:
>>>>
>>>>Thanks to all for the replies and information!  I am just back from a >>>>long weekend and I am now trying to figure out what I was doing! :)
>>>>
>>>>As for more information.  First off, this example is being run under >>>>windows XP.  I am developing test equipment that communicates with a >>>>java application via a serial port.  I have been using the commapi for >>>>several years and have not had a problem.  Recently, I have started a >>>>design modification that will replace the RS232 connection with a USB >>>>port.  I am using the ftdi module for prototyping and I discovered that >>>>their virtual com port driver was not compatible with the commapi that >>>>Sun released.  It turns out that it has problems with hardware flow >>>>control ( it works on incoming but not outgoing communications).  The >>>>way I figured this out was by experimenting with the SerialDemo that >>>>was included with the Sum commapi.  One nice thing about this example >>>>is it has the ability to set incoming and outgoing flow control >>>>independently.
>>>>
>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>without a hitch (except for the slow startup).
>>>>
>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>entries in the stack trace are:
>>>>
>>>>testRead() : -1, gnu.io.RXTXCommDriver
>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>>
>>>>This was all initiated by the following call in the programs init >>>>routine:
>>>>
>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>>
>>>>After looking at this,  My guess is that Trent is correct in that the >>>>delay is in scanning for ports.  I guess one solution would be to not >>>>scan for ports, though it would be nice to detect what is available on >>>>the system.  Is there any way to reduce the number of ports scanned by >>>>this function in windows XP? 
>>>>
>>>>Thanks again for your time,
>>>>
>>>>Doug
>>>>
>>>>
>>>> >>>> >>>> >>>>--------------070808020900080005070500-- >>>> >>>> >>>> >>> >>> >>> >>-- >>Jim Redman >>(505) 662 5156 x85 >>http://www.ergotech.com >>_______________________________________________ >>Rxtx mailing list >>Rxtx at qbang.org >>http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > >cheers >YiQi Huang >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/61d4d4c9/attachment-0396.html From impakt01 at optusnet.com.au Wed May 31 17:02:54 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 09:02:54 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Message-ID: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Hi all, I downloaded 2.1.7-pre16 and managed to build it and get it going. I made the changes as suggested by Peter Smith in an old post, by adding his code to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. Still not working, it opens the port at 9600 according to portmon.exe . Has anyone managed to get this going at a custom rate? Here is the post I'm referring to: http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 Thanks, Daren ________________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Daren Sent: Wednesday, 31 May 2006 10:56 PM To: rxtx at qbang.org Subject: [Rxtx] (no subject) Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren From tjarvi at qbang.org Wed May 31 21:44:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 May 2006 21:44:01 -0600 (MDT) Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> References: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Message-ID: On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org From impakt01 at optusnet.com.au Wed May 31 22:06:04 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 14:06:04 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: Message-ID: <200606010406.k51464X2010447@mail03.syd.optusnet.com.au> Trent, I have managed to successfully open the port at this speed using Realterm (available on sourceforge). From memory this uses DLPortIO. Using portmon.exe with realterm, even there it says that the port has opened at 1953. I changed termios.c:560 to dcb->BaudRate = 1953 ; and it still opens the port at 9600. Daren -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Thursday, 1 June 2006 1:44 PM To: RXTX Developers and Users Subject: Re: [Rxtx] custom baud rate win32 On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From smontgomery at mediaspansoftware.com Mon May 1 09:52:28 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 11:52:28 -0400 Subject: [Rxtx] RXTX, Java COMM and Windows Server 2003 on x64 experiences? Message-ID: Just wondering if anybody here has had to deploy RXTX or the javax.comm on Windows Server 2003 machines running on x64 (i.e. Xeon EM64T) and would like to relate how things went. From Sun's site, the Supported System Configurations pages give the options for that system: Java 5.0: - 32-bit Java 5.0 running on the OS in the 32-bit mode - 64-bit Java 5.0 running on the OS in the 64-bit native mode Java 1.4.2: - no options listed for EM64T processors, but potentially the standard 32-bit Java 1.4.2 could run on the OS in 32-bit mode? I guess the two main points of failure would be 1) the JVM itself and 2) the jni components. Make that three: there's gotta be hardware vendor driver support for the OS in the various modes, too. Guess I better go look at Keyspan's website... Thanks in advance for any info anyone might be able to provide. From smontgomery at mediaspansoftware.com Mon May 1 10:18:33 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 12:18:33 -0400 Subject: [Rxtx] Mailing list archive out of date? Message-ID: The mailing list archive at: http://mailman.qbang.org/pipermail/rxtx/ only shows emails through the end of March. Is there a new archive somewhere else? Didn't see anything mentioned on the wiki. From p.cain at phasefale.com.au Mon May 1 22:33:09 2006 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 02 May 2006 14:33:09 +1000 Subject: [Rxtx] RXTX and the Linux kernel. Message-ID: <4456E105.5080106@phasefale.com.au> Hi, First off the problem I am having isn't caused by RXTX itself but I'm hoping someone out there may have some knowledge that may help me. Background: I have an application monitoring a control system through a standard PC serial port which I talk to with rxtx-2.0.5. The application runs on RedHat7.3 kernel version 2.4.18 using Java 1.4. This configuration has been in use for several years and has proved to be stable. But it has become necessary for me to upgrade the OS but I'm running into problems with the serial communications. Its not that the comms don't work on the new OS (its never that simple) the comms work for a variable period of time (sometimes several hours) and then just stop, nothing on the data lines and control lines all indicate that data could flow. The new OS is Ubuntu 5.10 running kernel version 2.6.12. I have installed the OS and software on a PC and had it perform ok, then install the new OS and same software on the very same hardware and experienced the problems of them comms stopping. In the new OS I'm using Java5 to run the app but since I have experience the problem I reverted back to Java1.4 which didn't fix the problem. I've moved the app to a different system RedHat FC3 running 2.6.14 had experienced the problem. Not wanting to go through all the thing I have tried but I have established that it seems to be the 2.6 versions of the kernel that seem to be the problem and not an individual distribution of Linux. I should point out that I am using the same jar and library files for each java and OS combination. So I'm just wondering if anyone has had or heard of problems similar to these ? Or perhaps might know of what changed in the Linux serial driver (something I'm having a hard time establishing). I'm starting to run low on ideas of what to try so any help would be much appreciated. -- Peter Cain Senior Programmer Phasefale Pty Ltd From tjarvi at qbang.org Wed May 3 07:31:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 May 2006 07:31:00 -0600 (MDT) Subject: [Rxtx] Re: Concering ircomm and RXTX In-Reply-To: References: Message-ID: On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From legolas.w at gmail.com Wed May 3 08:46:23 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 19:16:23 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <4458C23F.2000003@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From legolas.w at gmail.com Wed May 3 13:10:57 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 23:40:57 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <44590041.80706@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From Lars.Hennig at wow-portal.com Thu May 4 00:39:15 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Thu, 4 May 2006 08:39:15 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: Message-ID: Hi, I could not find any solution. I therefore decided to to my own native implementation. Allthough it only supports the functions I need, it works pretty well now for me. I think the main problem there is the use of a wrong Windows API function and not setting an timeout. Regards, Lars Hennig W?rth Online World GmbH Tel. (0049)7181-258183 Mob. (0049)160-3522889 Fax. (0049)7940-153299 Lars.Hennig at wow-portal.com Gesendet von: rxtx-bounces at qbang.org 09.04.2006 10:42 Bitte antworten zu RXTX Developers and Users An d.herwald at dsh-elektronik.de, RXTX Developers and Users Kopie Thema Re: [Rxtx] USB Serialport - disconnection problems WV Proj./Teilpr.: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/7b39f374/attachment-0401.html From Pawan.Kharbanda at dot.state.co.us Thu May 4 11:00:58 2006 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Thu, 4 May 2006 11:00:58 -0600 Subject: [Rxtx] Dangling Lock Files Message-ID: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Hi, I have been using RXTX API's for the Serial Communication for quite some time now and for some of the devices we are opening and closing the connection every 2 minutes. This works great for few days and then suddenly I start seeing some "Port in Use Exception" and I see that the Lock files are still in the /var/lock folder after manually removing the lock files it works good for few hours and I see the same problem again. Can somebody explain me the scenarios why I am seeing the dangling Lock files? I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise Servers. Thanks Pawan Kharbanda -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/ba0e9261/attachment-0401.html From tjarvi at qbang.org Thu May 4 14:10:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:10:30 -0600 (MDT) Subject: [Rxtx] Dangling Lock Files In-Reply-To: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> References: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Message-ID: On Thu, 4 May 2006, Kharbanda, Pawan wrote: > Hi, > I have been using RXTX API's for the Serial Communication for quite > some time now and for some of the devices we are opening and closing the > connection every 2 minutes. This works great for few days and then > suddenly I start seeing some "Port in Use Exception" and I see that the > Lock files are still in the /var/lock folder after manually removing the > lock files it works good for few hours and I see the same problem again. > Can somebody explain me the scenarios why I am seeing the dangling Lock > files? > > I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise > Servers. Hi Pawan The next time it happens, look in the lockfile. There will be a pid. ps aux |grep 'pid' I think you will see that the application is still running for some reason. RXTX does a kill -0 on the pid to see if its alive. If not, it will remove the lockfile. So I suspect the previous program did not exit as you expected. -- Trent Jarvi tjarvi at qbang.org From Scott.Hughes at dalsemi.com Thu May 4 14:23:11 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 4 May 2006 15:23:11 -0500 Subject: [Rxtx] Wiki instructions... Message-ID: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire demo apps, when I stumbled across this tip on the wiki to add yourself to the uucp group: It may be simpler to just run usermod -G uucp jarvi Taken from: http://rxtx.qbang.org/wiki/index.php/Installation This does not work as advertised. I should have read the man page for usermod before I tried that out. If there are any groups which are not listed after the -G switch, the user is removed from those groups. On Ubuntu, this is bad... I removed myself from the Admin group, which removed my sudo priviledges. Ubuntu has no root account, so I've disabled the only account which could fix it. Anyone know of a good workaround? Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor From tjarvi at qbang.org Thu May 4 14:32:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:32:09 -0600 (MDT) Subject: [Rxtx] Wiki instructions... In-Reply-To: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> Message-ID: On Thu, 4 May 2006, Scott Hughes wrote: > I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire > demo apps, when I stumbled across this tip on the wiki to add yourself to > the uucp group: > > It may be simpler to just run > > usermod -G uucp jarvi > > Taken from: > http://rxtx.qbang.org/wiki/index.php/Installation > > This does not work as advertised. I should have read the man page for > usermod before I tried that out. If there are any groups which are not > listed after the -G switch, the user is removed from those groups. On > Ubuntu, this is bad... I removed myself from the Admin group, which removed > my sudo priviledges. Ubuntu has no root account, so I've disabled the only > account which could fix it. > > Anyone know of a good workaround? > Yikes This will get your permissions back: in grub/lilo/.. pass the following option to the kernel init=/bin/sh You are now root. when it boots, mount -o remount,rw / add yourself to the groups, reboot to get normal init going. Thats about all I can think of without sudo/root. -- Trent Jarvi tjarvi at qbang.org From Gettings at earth.utah.edu Thu May 4 14:41:22 2006 From: Gettings at earth.utah.edu (Paul Gettings) Date: Thu, 4 May 2006 14:41:22 -0600 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <20060504204122.GA6534@earth.utah.edu> When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get messages on stdout from the JVM: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 As the only change was the version of RXTX (from 2.1.6), I am unsure why the messages suddenly appeared. Anyone know how to get rid of them? Thanks. -- 101 USES FOR A DEAD MICROPROCESSOR (23) Dead cat brush From mmester at sps.edu Mon May 1 21:22:28 2006 From: mmester at sps.edu (Michael Mester) Date: Mon, 1 May 2006 23:22:28 -0400 Subject: [Rxtx] Windows PortInUseException Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> I'm trying to get simple serial communication going with RxTx under Windows XP. I can enumerate the ports fine, but I always run into problems when I try to open one. I get a PortInUseException, but the owner application is "Unknown" and the port is never open. I've tried this on several different systems and all of them give the same behavior. The only thing I can thiunk of that might be causing the problem is that fact that I had to put the serial .dll file in system32 instead of the reccommended folder, because it didn't work in the folder the documentation gives. The library loads fine, though, so I'm not sure whether that makes sense, and I don't know how to fix it anyway. Any help is greatly appreciated. Below is the output of the program, right up to the PortInUseException and the NullPointerException it causes (because the serial port object is not instantiated). C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI Starting GPSTalkerGUI... Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 gnu.io.PortInUseException: Unknown Application Exception in thread "main" java.lang.NullPointerException at GPSTalkerGUI.(GPSTalkerGUI.java:102) at GPSTalkerGUI.main(GPSTalkerGUI.java:161) Again, thank you very much for any help you can give. From lshellman at qwest.net Wed May 3 01:38:34 2006 From: lshellman at qwest.net (Lucious Shellman) Date: Wed, 03 May 2006 01:38:34 -0600 Subject: [Rxtx] Help needed: Project using parallel port Message-ID: <1146641914.8337.14.camel@localhost.localdomain> I was looking for a way to access the parallel port on a PC using Java. Searching the Internet, I came across this site (rxtx.org). What I am trying to do is detect logic levels from a TTL logic IC on the parallel port. I am not trying to do classic parallel port communication. I just want to detect whether a line(s) is (are) high or low. I am using Windows 98. Can rxtx be used to do this? If yes, is there a tutorial for using rxtx posted on the Internet that someone can direct me to. If you need more information, feel free to e-mail me. Unfortunately for me, I need the information ASAP. Thanks. lshellman at qwest.net From webmaster at egyhelp.com Wed May 3 18:43:39 2006 From: webmaster at egyhelp.com (Mohamed Samy) Date: Thu, 4 May 2006 02:43:39 +0200 Subject: [Rxtx] RE: Concering ircomm and RXTX In-Reply-To: Message-ID: <20060503184362.SM01044@Geek> Hey, I issue the command "modprobe ircomm-tty" yet no ttyircomm appears, while the ircomm appear by "modprobe ircomm" so forgive me but I am bit lost. Even searching google for the keyword "ttyircomm" only returns 3 matches. So any way I can start the ttyircomm???? Thanks a lot. -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Wednesday, May 03, 2006 3:31 PM To: Mohamed Samy; rxtx at qbang.org Cc: taj at www.linux.org.uk Subject: Re: Concering ircomm and RXTX On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 4 15:49:49 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 15:49:49 -0600 (MDT) Subject: [Rxtx] Windows PortInUseException In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> Message-ID: On Mon, 1 May 2006, Michael Mester wrote: > > I'm trying to get simple serial communication going with RxTx under > Windows XP. I can enumerate the ports fine, but I always run into > problems when I try to open one. I get a PortInUseException, but the > owner application is "Unknown" and the port is never open. I've tried > this on several different systems and all of them give the same > behavior. The only thing I can thiunk of that might be causing the > problem is that fact that I had to put the serial .dll file in system32 > instead of the reccommended folder, because it didn't work in the folder > the documentation gives. The library loads fine, though, so I'm not sure > whether that makes sense, and I don't know how to fix it anyway. Any > help is greatly appreciated. Below is the output of the program, right > up to the PortInUseException and the NullPointerException it causes > (because the serial port object is not instantiated). > > C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI > Starting GPSTalkerGUI... > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > gnu.io.PortInUseException: Unknown Application > Exception in thread "main" java.lang.NullPointerException > at GPSTalkerGUI.(GPSTalkerGUI.java:102) > at GPSTalkerGUI.main(GPSTalkerGUI.java:161) > Perhaps you are trying to open the port twice in your code? rxtx does open the ports, do a timed out read and then close the ports during enumeration. I think the port is being opened fine. The Unknown Application is always reported. On linux, there is some code that finds the actual application but on windows, its always unknown. If the port enumeration is returning the ports you expect, rxtx has opened the port and closed it with success. The port should open. There is also example code in the contrib directory that comes with rxtx source that has examples you can modify to work. -- Trent Jarvi tjarvi at qbang.org From Christian.Klemke at t-online.de Thu May 4 23:37:23 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Fri, 5 May 2006 07:37:23 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu> Message-ID: <004f01c67005$fc72fee0$016a10ac@NB600> Hi Paul, I was wondering about the same question some days ago and took a look at the source files. Unfortunately, I found that you can only get rid of that messages by altering and recompiling the Java code. There is a final static boolean variable called "devel" in the file "RXTXCommDriver.java" which is set to "true". This constellation causes the output after the native libraries have been loaded. No mechanism exists to suppress them otherwise :-(. Trent, does that mean that 2.1.7 is still officially a "development" version ? When will this value be changed to "false" by default ? With 2.1.8 ? It would be nice to provide a means to suppress such messages besides that static flag (maybe by setting a property called "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The output can indeed by annoying, especially when used with console applications, where the message potentially appears "in the middle" of your own output. Another possibility would be not to use System.out directly, but instead some PrintStream field which is initially set to System.out but can programatically be changed. That would allow for any kind of redirection or suppression by implementing appropriate user-defined PrintStream subclasses and making RXTX use that stream. What do you think ? Best regards, Christian ----- Original Message ----- From: "Paul Gettings" To: Sent: Thursday, May 04, 2006 10:41 PM Subject: [Rxtx] RXTX causing stdout messages > When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get > messages on stdout from the JVM: > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > As the only change was the version of RXTX (from 2.1.6), I am unsure > why the messages suddenly appeared. Anyone know how to get rid of > them? > > Thanks. > > -- > 101 USES FOR A DEAD MICROPROCESSOR > (23) Dead cat brush > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri May 5 06:09:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 06:09:46 -0600 (MDT) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <004f01c67005$fc72fee0$016a10ac@NB600> References: <20060504204122.GA6534@earth.utah.edu> <004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: On Fri, 5 May 2006, Christian Klemke wrote: > Hi Paul, > > I was wondering about the same question some days ago and took a look at the > source files. Unfortunately, I found that you can only get rid of that > messages by altering and recompiling the Java code. There is a final static > boolean variable called "devel" in the file "RXTXCommDriver.java" which is > set to "true". This constellation causes the output after the native > libraries have been loaded. No mechanism exists to suppress them otherwise > :-(. > > Trent, does that mean that 2.1.7 is still officially a "development" version > ? When will this value be changed to "false" by default ? With 2.1.8 ? It > would be nice to provide a means to suppress such messages besides that > static flag (maybe by setting a property called > "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The > output can indeed by annoying, especially when used with console > applications, where the message potentially appears "in the middle" of your > own output. Another possibility would be not to use System.out directly, but > instead some PrintStream field which is initially set to System.out but can > programatically be changed. That would allow for any kind of redirection or > suppression by implementing appropriate user-defined PrintStream subclasses > and making RXTX use that stream. What do you think ? > A patch for using properties would be accepted I'm sure. The reason the default is to display the message is not related to the development state of rxtx anymore. The problem is that people first using rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. The message prevents a great deal of email thats easily explained by the message. I question if we should support rxtx 2.0 at all anymore. If you post a patch in bugzilla, we'll put it into CVS this weekend. we'll be going through and doing such things anyhow. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri May 5 13:23:56 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 13:23:56 -0600 (MDT) Subject: [Rxtx] How to read from RxTx parallel port in Win XP In-Reply-To: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> References: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> Message-ID: On Thu, 27 Apr 2006, Worsley, Bob (Development Engineer) wrote: > I'm sorry if this is a dumb question, but I didn't find the answer in > the archives. > > I'm using the RxTx binaries for Windows on a reasonably current notebook > PC running Windows XP. I can send stuff to a printer on the parallel > port (LPT1), but I can't get anything back. > > I wrote a class that has the methods listed below. I write some data to > the printer with the "write" method and then try to read a response > using the "read" method, but I never get any data. I'd greatly > appreciate any help you can give! > > Bob Worsley > bobwoyid2 at yahoo.com > > > > > private ParallelPort parallelPort = null; > private RXTXCommDriver parallelPortDriver = null; > > > public boolean initialize() throws IOException { > if (parallelPort != null) { > return false; // Already initialized > } > > // Create the parallel port; > parallelPortDriver = new RXTXCommDriver(); > parallelPort = > (ParallelPort)parallelPortDriver.getCommPort(address, > CommPortIdentifier.PORT_PARALLEL); > > // Set the parallel port parameters. > try { > parallelPort.enableReceiveTimeout(READ_TIMEOUT); > parallelPort.disableReceiveFraming(); > parallelPort.disableReceiveThreshold(); > //parallelPort.setMode(mode); !!!!errors > } catch (UnsupportedCommOperationException e) { > throw (new IOException("Parallel port with address '" + > address > + "' cannot be configured as specified")); > } > > return true; > } > > > > public void write(final byte[] bytes) throws IOException { > initialize(); > while (busyReading) { > Thread.yield(); > } > busyWriting = true; > if (bytes.length < 1) { > return; > } > OutputStream outputStream = parallelPort.getOutputStream(); > outputStream.write(bytes); > outputStream.flush(); > outputStream.close(); > Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); > busyWriting = false; > } > > > public byte[] read() throws IOException { > > // Read up to MAX_BYTES bytes. > initialize(); > while (busyWriting) { > Thread.yield(); > } > busyReading = true; > byte[] buff = new byte[MAX_BYTES_READ]; > InputStream inputStream = parallelPort.getInputStream(); > // This read blocks until input data is available > int bytesRead = inputStream.read(buff); > inputStream.close(); > // If no data read, create empty array > if (bytesRead == -1) { > bytesRead = 0; > } > byte[] deviceBytes = new byte[bytesRead]; > System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); > if (bytesRead > 0) { > Debug.p("PPIOP.read - got data: '" + new > String(deviceBytes) + "'"); > } > busyReading = false; > return deviceBytes; > } > Hi Bob I've only used rxtx to test a hello world page printing but there are others that have used it. PPIOP? hmm what is this? :) The rxtx parallel support is behind the serial support but should be OK. As you note, the setting of modes is not supported. rxtx uses what is provided when the port is open. Are your asserting the pin for the printer being online? I suspect what often happens is people try to just use the data pins but the C API rxtx uses wants the printer to be online. There should be some posts relating to this in the rxtx mail-list archive. Some APIs are probably reading and writing from the port address (also suggested in your code as something you are looking at). RXTX currently uses a higher level C/C++ API for port access. This can still work if the API thinks the 'printer' is there. -- Trent Jarvi tjarvi at qbang.org From agrodellic at gmail.com Sat May 6 08:39:40 2006 From: agrodellic at gmail.com (Leigh Stewart) Date: Sat, 6 May 2006 10:39:40 -0400 Subject: [Rxtx] sun commapi 3 Message-ID: I think I read here: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html that rxtx-2.0 is basically fracked for now? Does anyone know of a workaround? ie can i somehow get an older version of sun's comm api and use that (not easy to find)? i mean 2.0 must be working for someone...how is it being tested. 2.1 isnt working for me....im getting nasty native exceptions etc, which is why im so set on 2.0... any ideas? From tjarvi at qbang.org Sun May 7 15:40:27 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 7 May 2006 15:40:27 -0600 (MDT) Subject: [Rxtx] sun commapi 3 In-Reply-To: References: Message-ID: On Sat, 6 May 2006, Leigh Stewart wrote: > > 2.1 isnt working for me....im getting nasty native exceptions etc, > which is why im so set on 2.0... any ideas? > Hi Leigh What native exceptions are you seeing? Which OS? The native code is almost identical between rxtx 2.0 and 2.1. Only the names have been changed to protect the inocent. :) ie: javax_comm_... vs gnu_io_... So the odds are very likely that even if you do find commapi 2.0 and get it installed, you will run into the same error. It would be better to just find and fix the problem. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Mon May 8 10:47:20 2006 From: mail at willicon.de (WILLICon) Date: Mon, 08 May 2006 18:47:20 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 Message-ID: <445F7618.3070303@willicon.de> Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/ef37e8ec/attachment-0401.html From tjarvi at qbang.org Mon May 8 16:14:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 May 2006 16:14:51 -0600 (MDT) Subject: [Rxtx] Screenshot of Application using RXTX (fwd) Message-ID: Just though someone may end up searching for 0x0D and 0x0A. Here are the details from his system. SuSE Linux 10.0 (x86_64) Kernel 2.6.13-15.8 j2se 1.4.2_11 (i586) Sun: comm3.0_u1 rxtx: rxtx-2.1-7 ---------- Forwarded message ---------- Date: Sat, 6 May 2006 20:01:46 +0200 From: Michael Poppitz To: taj at www.linux.org.uk Subject: Screenshot of Application using RXTX Hi Trent, the rxtx package works like a charm. Sun's package seemed to replace all 0x0D with 0x0A in received data on my Linux box, which is really annoying when transfering binary data. But rxtx came and saved the day - and turned out to be a lot more convenient as it does not require a configuration file. I use it for connecting to a home made logic analyzer. (http://www.sump.org/projects/analyzer/) Thanks for your great job, Michael -------------- next part -------------- A non-text attachment was scrubbed... Name: la_client.png Type: image/png Size: 16592 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/45494fbb/la_client-0401.png From tjarvi at qbang.org Tue May 9 14:56:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 May 2006 14:56:05 -0600 (MDT) Subject: [Rxtx] RXTX javax.comm: which one to install? In-Reply-To: <20060509161742.43547.qmail@web53814.mail.yahoo.com> References: <20060509161742.43547.qmail@web53814.mail.yahoo.com> Message-ID: On Tue, 9 May 2006, Adenilson Cavalcanti wrote: > Dear Trent Jarvi > > I'm trying to write a small Java app running in linux that interfaces with a device connected to serial port. > > I do have some questions about RXTX and javax.comm state of affairs, since I'm new to Java programming (used to program in plain old C writting to devices using termios and open/write/read syscalls, but this is another story). > > I ask you the favor to clarify this issues (if possible...): > > a) Sun offers to download a file (comm3.0_u1_PUTAUNIXVERSION.zip) which does contain .so files. Does it work out of box? > > b) Case negative, its there that we should use 'librxtx*.so' provided by your site? > > c) Sun's comm3 API version does work with which version of rxtx? > > I already searched google and read documentation available in rxtx site ("Java Comm Serial API How-to") but still have this issues unsolved. Any help will be appreciated. > > Best regards > > Adenilson Hi Adenilson, RXTX does not currently support javax.comm in Sun's CommAPI 3.0. I would recommend using package gnu.io provided by rxtx 2.1. -- Trent Jarvi tjarvi at qbang.org From chris.develder at intec.ugent.be Wed May 10 08:45:40 2006 From: chris.develder at intec.ugent.be (Chris Develder) Date: Wed, 10 May 2006 16:45:40 +0200 Subject: [Rxtx] rxtx troubles on ARM Message-ID: <4461FC94.6040909@intec.ugent.be> Hi all, Sorry to bother you, but I don't seem to get RXTX working on an ARM processor (xscale ixp 425, big endian). I managed to crosscompile the rxtx libs and moved it over to the ARM. Using jamvm (which is the only open source java VM we got working on the ARM), I get the following error result when running SimpleRead from Sun's javax.comm examples (commapi\examples\Simple\SimpleRead) -- see bottom of mail for complete output: "java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver" However, output shows that the RXTXCommDriver code is accessible (cf. debug and devel output of lib versions). So it doesn't seem to be a missing lib/jar issue. The error happens before RXTXCommDriver.initialize() is called, since the first line there is System.out.println("RXTXCommDriver:initialize()"); Any ideas? Cheers, Chris ---------------------------- [root at xxx(ttyp1) /work/cdvelder/xscale/test]# jamvm -Djava.library.path=/work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/jre/lib/arm -classpath /work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/lib/ext/RXTXcomm.jar:./comm.jar:. SimpleRead RXTXCommDriver {} Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTXCommDriver: Jar version = RXTX-2.1-7 native lib Version = RXTX-2.1-7 java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver gnu/io/RXTXCommDriver at javax.comm.CommPortIdentifier.loadDriver (CommPortIdentifier.java:239) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:109) at SimpleRead.main (Unknown Source) java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive (Native Method) at com.sun.comm.Portmapping.registerCommPorts (Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase (Portmapping.java:100) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:138) at SimpleRead.main (Unknown Source) From joachim at buechse.de Fri May 12 00:44:48 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 08:44:48 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) Message-ID: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Good day, I guess that only a selected few (hi Trent) will be able to answer this question, but the answer might be interesting for anyone trying to debug or understand the code. Apparently the MonitorThread is started and stopped in RXTXPort.addEventListener and RXTXPort.removeEventListener. This would indicate that (originally?) the MonitorThread is only required when there is an EventListener. However the MonitorThread is also started in the RXTXPort constructor, which could mean that RXTX won't work at all if it isn't there. It seems to me, that if anyone would add an event listener and later on remove it, he could potentially wreak the port. Because the second action would kill the MonitorThread. For the moment I am only trying to understand the role of and idea behind the MonitorThread. But of course there is a deeper reason thor my question: If the MonitorThread needs to exist anyway, it could be the thread that cleans up the port (ie calls nativeClose) - this would eliminate (a further) problem I am seeing with some USB drivers on Mac OSX. (Close blocks (after releasing the tty, but still) in the USB driver if the device is "not responding"). Greetings, Joachim From tjarvi at qbang.org Fri May 12 07:10:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 12 May 2006 07:10:59 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Fri, 12 May 2006, Joachim Buechse wrote: > Good day, > > I guess that only a selected few (hi Trent) will be able to answer > this question, but the answer might be interesting for anyone trying > to debug or understand the code. > > Apparently the MonitorThread is started and stopped in > RXTXPort.addEventListener and RXTXPort.removeEventListener. This > would indicate that (originally?) the MonitorThread is only required > when there is an EventListener. However the MonitorThread is also > started in the RXTXPort constructor, which could mean that RXTX won't > work at all if it isn't there. > > It seems to me, that if anyone would add an event listener and later > on remove it, he could potentially wreak the port. Because the second > action would kill the MonitorThread. > > > For the moment I am only trying to understand the role of and idea > behind the MonitorThread. But of course there is a deeper reason thor > my question: > > If the MonitorThread needs to exist anyway, it could be the thread > that cleans up the port (ie calls nativeClose) - this would eliminate > (a further) problem I am seeing with some USB drivers on Mac OSX. > (Close blocks (after releasing the tty, but still) in the USB driver > if the device is "not responding"). > Hi Jaochim Before commapi, rxtx did not support events. You could read, write and change port settings. The MonitorThread was added as an afterthought to support commapi events. So the way things are now his historical spaghetti not a well devised plan. It is my opinion that the MonitorThread should exist as long as the port is open. The odd starting of the thread in the constructor and addEventListener was just to get past the obvious problem of people using the port without adding listeners. -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Fri May 12 07:59:50 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 15:59:50 +0200 Subject: [Rxtx] MonitorThread -> ChangeRequest In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: <2B1E508C-8CEE-4AB7-914D-E7BA25C871A2@buechse.de> In this case I suggest removing the starting/stopping of MonitorThread in addEventListener / removeEventListener. This should not affect existing projects. On 12.05.2006, at 15:10, Trent Jarvi wrote: > It is my opinion that the MonitorThread should exist as long as the > port > is open. The odd starting of the thread in the constructor and > addEventListener was just to get past the obvious problem of people > using > the port without adding listeners. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Fri May 12 11:43:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 19:43:21 +0200 Subject: [Rxtx] Spring Cleaning - some suggestions Message-ID: The current implementation of RXTX contains quite a lot of code that will break if it is used from several threads (especially on a multi processor machine). I think it would be nice to clean this up. I suggest the following changes (which keep the current semantics and should not influence existing projects in a negative way): - InterruptedException will never be ignored or reset - read methods will be protected with a Monitor - write methods will be protected with a (separate) Monitor - close() sets the read and write monitors into a "closed" state which will lead to IOExceptions for any following call to RXTXPort.read/write. - close() will wait a finite amount of time (maybe 500ms) for the release of the read and write monitors after that, it will trigger the closing of the file descriptor to abort any pending read or write. - close() will not call close(file_desc). Instead it will "interrupt" (ie set a flag and then, pthread_kill(ABRT)) the MonitorThread, the MonitorThread will call close(file_desc). - the monitors are properly released in a finally block the try of which starts directly after obtaining the monitor. - finally will not call close(file_desc) it will only "interrupt" the MonitorThread (see above) - the native-code (esp read) does not use SA_RESTART but checks Thread.interrupted() when it receives a SIGNAL (ie system call returns with EINTR or other signalling method). The read/write monitors will be allocated from a factory whose mode can be set to fast/normal/advanced. In fast-mode it will create "non thread safe, non synchronized" pseudo-monitors. In default mode, the monitors will store the owning thread. In "advanced" mode setting the monitors into closed state will "interrupt()" threads which are blocked in a native read/write. {Reasoning close behaviour: Calling close on a file descriptor in Windows unblocks any read() or write() on the same file descriptor with an error. On Solaris < 2.7 and MacOS X however the close() will/ can block - until the read or write have finished:-(( Even the JDK people have trouble with this. I dont know how Linux reacts in this case. The best practice for BSD/Solaris is to send a signal to the thread which will usually unblock the read/write with an EINTR - this however is not guarenteed as it also depends on the device driver. So the only resolution that will certainly not block the thread calling RXTXPort.close() (which will often enough be the AWT event dispatcher or the VM finalizer thread) is to call close(fd) from another thread.} {Reasoning read behaviour: It is rather uncommon to receive a signal while reading or writing - it will happen, but checking Thread.interrupted() when it happens will not degrade performance. The checking of Thread.interrupted() can be handled by returning to Java and potententially reentering into the native code if the thread was not interrupted or by calling back into the VM from the native code. On top of this, many functions like read(byte[]) or read(byte [], int, int) are allowed to return less than the requested amount of data. Only int read() is a bit more tricky. } [Trent: From the code I can tell, that you experimented quite a bit with signals. Do you know if the Java Thread.interrupt() triggers a unix signal on Linux/Solaris? If so, which one?? References: - http://java.sun.com/docs/hotspot/VMOptions.html - http://www.hp.com/products1/unix/java/infolibrary/prog_guide/ signals.html ] On OS X (hotspot client jdk-1.4.2) I did not see any signal propagated to the SELECT of the event_loop/MonitorThread (ie no EINTR) when I call monThread.interrupt(). This is a pitty, but thats the way it is. I simply assume this is true for most system calls. How to handle this? Of course it would be possible to install/ deinstall a specific signal handler before/after every native read and to natively send an ABRT signal if RXTXPort.close is called. A more elegant solution might be to have an additional "signaling" socket which is always included in the SELECT. Or the simplest solution: cap the timeout of the select to 500 ms (the loop around it exists already) after every timeout check the Thread.interrupted() flag. From a performance perspective this should be completely invisible... On the other hand, all write() calls need to be preceeded by a SELECT as well, to avoid running into a blocking write. Best regards, Joachim From lyon at docjava.com Sat May 13 05:54:52 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 13 May 2006 07:54:52 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Dmitry suggests that we acquire an implementation of a serial port reference, use it, then release it (i.e., check it back in). Joachim says that making serial ports thread friendly might be a good idea. This is a good idea. The design pattern that is close to this idea is the "Object Pool Design Pattern". # Object Pool Manage the reuse of objects for a type of object that is expensive to create or only a limited number of a kind of object can be created. It has been described at: http://www.developer.com/java/ent/article.php/626171 and in Marks' book, Patterns in Java, Volume 1. However, the Object Pool is intended to pool objects so that each object is just like every other object. The intent of the Parametric Singleton is to enable others to access the same resource at the same time (as long as the same parameters were used in construction). It sounds like we need a NEW Design Pattern (Oh no, Doug is doing it again!). Yes friends, you got me on a role (roll) :) If you like design patterns, you can thank me later. If you don't like design patterns, blame Dmitry, it was his idea ;) And Dave, thanks for the feedback on Singleton abuse. It has led me to change the way I think about application contexts, which we will see, below. We need (drum roll please): The Parametric Object Pool Design Pattern (POP) By Douglas A. Lyon ABSTRACT The goal of the Parametric Singleton design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values, in a given context. In comparison, the goal of the POP design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values and that only one reference to the class is checked out at a time, in a given context. A context is a namespace for holding identifiers during execution. In Java, A context can be changed in any of several ways. For example, creation of a new class loader, the deserialization of an old POP or the creation of a new process all create a new namespace. The POP Design Pattern combines the Parametric Singleton Design Pattern with the check out mechanism of the Object Pool Design Pattern. This enables unique creation of instances of a class. These instances are cached in a table. When a clients asks for an instance with these parameters, the cache is checked. If the instance is not in the cache it is created. If the instance is available, the clients checks out the instance. A reference is left to the clients that checked out the instance. The POP has the role of creating objects uniquely, from parameters. It also has the role of keeping track of which clients has checked out a given object. This is just like a library keeping track of who borrowed a book. If a resource is left unavailable in a system, a deadlock can occur. Deadlock debugging is facilitated by mapping a resource to the clients that have checked it out. We apply our POP Design Pattern to the retrieval of serial ports. The goal of our system is to make sure that serial ports are checked out to only one client at a time, and that they be checked back in when the client is done. The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. Users are discouraged from calling this the Parametric Object Oriented Pool (POOP). Introduction The intent of the POP Design Pattern is to ensure that a class has only one instance for a given set of parameter values. It also provides a point of access that is global to a given context. The POP uses the Singleton Design Pattern to ensure that there is only one POP, in the given context. The POP DP is responsible for checking out a reference to a given instance, and keeping track of that instance. The instance is responsible for sharing that instance. POP requires that users of the DP implement an interface that enables a recall facility. Thus, if there is a contention for a consumed resource, the deadlock can be resolved in an orderly fashion. Motivation A system cannot tolerate multiple instances of some classes with identical parameters used by different instances at the same time. For example, you cannot have two instances use the same serial port, at the same time. You cannot have two instances that are trying to listen to the same socket connection. You cannot have two instances writing to the same file structure at the same time. Further, once a serial port is checked out by a client, it is assigned to the client. This is like the spin-lock service provided by the operating system, only in the application layer. Naturally, deadlock will occur if a resource is not released, therefore the client of the resource is tracked. Recalling a resource is required for the POP DP by virtue of the implementation of an interface. The policy on how to break a deadlock (by honoring the recall) is application specific. As the operating system is often thought of as the arbiter of consumed resources (i.e., tape drives, serial ports, etc.) we frequently leave it to an operating system implementation to resolve these contention issues. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on naming conventions (which are not well standardized). The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. The POP Design Pattern can take on the role of the peer method mapper that homogenizes the API for different operating environments. That is, it can wrapper the different locking mechanisms used in different operating systems. POP that is responsible for keeping track of the instances created and the client that has checked them out. The POP Design Pattern is implemented using the Singleton Design Pattern. In Java, the POP implementation is declared final, so that it cannot be subclassed. The class also has a private constructor, so that other classes cannot instance it. The new design pattern is called the POP design pattern and it provides a way to check out and create instances with given parameters. Applicability Use the POP Design Pattern when: 1. There must be exactly one instance of a class with the given parameters in a given context. 2. The instances must be accessible to clients from a well-known access point. 3. The instances are reusable. 4. Only one client can check out an instance at a time. Structure Insert UML diagram here. Participants The POP Clients that need instances 1. The POP defines an instance upon request from a client, if, and only if, the instance does not already exist. 2. The POP returns the instance to the client. 3. The POP is responsible for creating unique instances from given parameters. 4. The POP is responsible to recalling instances from clients. Collaborations Clients obtain a reference to a POP instance only through the singleton design pattern. If the POP instance is left in an improper state (e.g., the serial port was left open) it is NOT the role of the POP to close the IO port. However, the POP can be requested to get the instance released. Nor is it the role of the POP Design Pattern to open the port. That role is delegate to some other part of the system. Further, it is the role of the POP Design Pattern to check out resources. However, it is still possible to have, multiple threads that have multiple references to the same resource at the same time. Checkout and resource requests are MUTEX locked (i.e., synchronized). Consequences The POP Design Pattern has several benefits: 1. Controlled access to parametrically defined instances. Since the POP encapsulates its instances, there is some limited control over how and when clients access it. 2. Reduced name space. The POP pattern avoids global variables that store instances created from the same parameter. Implementation Here are implementation issues to consider when using the POP pattern: 1. Unique mapping of parameters. The POP pattern requires that there be a mean to isomorphically map the parameter space into the instance space and back again. 2. Ensure unique instances. The POP pattern makes unique instances from parameters, and it does so only once. 3. Cache instances for fast retrieval. The POP must be able to look up instances, given some set of parameters, and do so from some data structure. That is, there must be enough space to hold references to all the instances the program will need. Also, a mechanism is needed to look up and retrieve the instances quickly enough to satisfy the clients. Sample Code To be written....any volunteers? Thanks! - Doug >I don't think I get it > >On Mar 22, 2006, at 9:36 AM, David Garnier wrote: >>Using the singleton pattern in this case is >>just convenient for the programmer. Problems >>arises >>pretty quickly, especially if you attempt to unit-test your classes. > > >so you're saying that something isn't so good >because you can not test it in the convenient >way? >if that's true, I'm totally disagree >change your test, debug whatever, but if >software is efficient at runtime, works fine and >only problem is some unit test >(which is some kind of framework for testing) >then dump that unit test , dump that unit >framework and make something appropriate to the >software >you're testing > >so if Douglas want to use singletons, what's the problem? >and what do you mean by abusing of singleton usage? > >of course singleton doesn't prevent concurrent >access to the resource across the processes >unless >you're using some OS facility to prevent it, besides >singleton as it was introduced is relevant only >and only inside of the same process >otherwise it's not singleton it's something else >(let's say network singleton: so you have remote >invocation facility >and some factory method that return object created by that facility) > >I don't have any problem with using any kind of singletons. > Parametric Singleton idea (if I understand it >right) could be easily implemented in the >following way: >use a map >populate map with instances of some class and key is your parameter >(you can use lazy population too) > >if somebody ask the key check the value if it's null so resource is taken >if somebody returns the resource put it back to the map > >public synchronized static Object getSomeResource(Object parameter); >public synchronized static void returnResource(Object parameter); > >getSomeResource (inside of the same process) could return null in 2 cases >1. if somebody (from other thread for example) already took that resource >2. if OS API said that resource corresponded to >that parameter (serial port with parameter = 1 >(port #)) >is locked and unavailable; >I'm not sure that in case of serial ports we >even need those Parametric Singletons >(unless lock checking is a very expensive operation) >just ask the OS about availability of that >resource and if it's available give it away >and then OS will lock it and therefore in next >time somebody ask it just answer that resource >is locked >and return null > >for example system has 2 serial ports available >so I ask getResource("tty"); >or I ask getResource("Bluetooth-Modem"); > >and if OS is ok you can give tty or Bluetooth-Modem or both > >no need for any additional pattern I think > >back to the problem >mac os x doesn't recognize locking via files, so >it handles locking via some API >an instance of the singleton in each process >should recognize that resource is locked >(by using that API) that's all >we don't have to make things more complicate >then they are just because there is some nice >design pattern or nice unit test framework or whatever >keep things simple, make them work fast, don't introduce middle layers >unless you have really good reason to do so > >of course I could be entirely wrong, so sorry about that in advance > >thanks > > >Dmitry Markman > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx >Good day, > >I guess that only a selected few (hi Trent) will be able to answer? >this question, but the answer might be interesting for anyone trying? >to debug or understand the code. > >Apparently the MonitorThread is started and stopped in? >RXTXPort.addEventListener and RXTXPort.removeEventListener. This? >would indicate that (originally?) the MonitorThread is only required? >when there is an EventListener. However the MonitorThread is also? >started in the RXTXPort constructor, which could mean that RXTX won't? >work at all if it isn't there. > >It seems to me, that if anyone would add an event listener and later? >on remove it, he could potentially wreak the port. Because the second? >action would kill the MonitorThread. > > >For the moment I am only trying to understand the role of and idea? >behind the MonitorThread. But of course there is a deeper reason thor? >my question: > >If the MonitorThread needs to exist anyway, it could be the thread? >that cleans up the port (ie calls nativeClose) - this would eliminate? >(a further) problem I am seeing with some USB drivers on Mac OSX.? >(Close blocks (after releasing the tty, but still) in the USB driver? >if the device is "not responding"). > >Greetings, >Joachim > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Sat May 13 10:07:37 2006 From: joachim at buechse.de (Joachim Buechse) Date: Sat, 13 May 2006 18:07:37 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Douglas, Looking at the current code, leaves me with the feeling, that there is a lot to do. Defining an API that wraps javax.comm to provide what you describe is certainly possible, but I wonder how much benefit it will actually provide. Personally I think the API defined by javax.comm "request/lock" a port with: cp= new CommunicationPort(identifier) "release" a port with: cp.close(); works quite nice for 99% of the applications. In my experience, the most efficient and elegant implementation is to wrap a port/socket/.. into a business object which declares the remote operations that are possible. Ie "uploadFile", "waitForPrompt", "getSerialNumber", "sendContact", "executeCommand", etc Those methods are then either synchronized or guarded by a monitor. I do not see how your design pattern applied to the port resource would help implementing this. [details start, skip if you agree to the above] When I talked about "thread-safe" I didn't mean several independent "sessions" accessing the port concurrently. I think this is a very rare usage. I believe the most common use case for serial ports today is the control of an external device from a PC running a GUI based application. To implement a clean Swing/AWT-GUI one needs to pass any action that can block to a "worker" thread (else the GUI blocks, the application appears dead). While it is possible to use own prespawned thread that will accept Runnables which operate on the port, this is not very elegant. It is more common to spawn a new thread for every action triggered by the user. Additionally the ABORT of a running operation is often implemented via a port.close() delegated to a different thread. - During the lifetime of a port, it will usually be accessed from several different threads. Instance variables need to be set/read in synchronized regions to guarantee a correct operation based on the Java memory model. - Synchronizing the access is usually handled on the application level (synchronizing the reads/writes is usually useless from the applications view because it is not a transaction mechanism). [details end] I am very open to learn about other scenarios where your proposed design pattern applied to the port resource is beneficial to the application implementor. Best regards, Joachim On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > Dmitry suggests that we acquire an implementation of > a serial port reference, use it, then release it (i.e., check it > back in). > > Joachim says that making serial ports thread friendly might be a > good idea. > > This is a good idea. The design pattern that is close to this idea > is the "Object Pool Design Pattern". > # Object Pool From jredman at ergotech.com Sun May 14 14:28:24 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 14:28:24 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers Message-ID: <446792E8.4000506@ergotech.com> Does anyone know of any work to make RXTX work with Ethernet (telent) Terminal Servers? If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? We've used RXTX with upwards of 100 virtual COM ports on Windows and it works well. Linux is more problematic. It would be good to have an OS independent solution to accesses remote Ethernet serial ports. Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From legolas.w at gmail.com Sun May 14 14:26:34 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:56:34 +0430 Subject: [Rxtx] does any one have a working sample of RXTX and LPT port Message-ID: <4467927A.4000008@gmail.com> Hi Thank you for reading my post does any one has a working sample for RXTX and LPT port ? Thanks From legolas.w at gmail.com Sun May 14 14:27:29 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:57:29 +0430 Subject: [Rxtx] does RXTX support Trigerr on parallel port? Message-ID: <446792B1.4040905@gmail.com> Hi does RXTX support trigger on LPT port ? if so , how i can use it ? Thanks From tjarvi at qbang.org Sun May 14 17:40:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 17:40:59 -0600 (MDT) Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: <446792E8.4000506@ergotech.com> References: <446792E8.4000506@ergotech.com> Message-ID: On Sun, 14 May 2006, Jim Redman wrote: > Does anyone know of any work to make RXTX work with Ethernet (telent) > Terminal Servers? > > If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 > Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? > Hi Jim It appears the author of NVTCom has decided to release the library into the public domain. Integration with rxtx is possible but it would be best to contact the author and find out what his intent is. I would suggest contacting the author with a proposal of what you would like to do and take it from there. We could 'take' public domain software but its better to show respect to the authors and respect their wishes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:10:23 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:10:23 -0600 (MDT) Subject: [Rxtx] does any one have a working sample of RXTX and LPT port In-Reply-To: <4467927A.4000008@gmail.com> References: <4467927A.4000008@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > Thank you for reading my post > does any one has a working sample for RXTX and LPT port ? > Thanks Hi Legolas LPT port support in rxtx is spotty. That means some people have sent in patches for what they do and it works well for them. The original code was not very good. It may have been 3 hours work :/ To get started, Sun has some demo programs with their commapi. With rxtx 2.1 you can change their code from using javax.com to gnu.io and it -should- work. But if it does not you can post here and on bugzilla. There has been more interest lately off the list and maybe there will be enough community resources to get what you need going. If you do get a sample program together, we would gladly put it in the contrib directory so the next person can get things going faster. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:12:12 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:12:12 -0600 (MDT) Subject: [Rxtx] does RXTX support Trigerr on parallel port? In-Reply-To: <446792B1.4040905@gmail.com> References: <446792B1.4040905@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > does RXTX support trigger on LPT port ? > if so , how i can use it ? > Hi Legolas As mentioned in the previous post, rxtx parallel support is not very mature. But if you can point to something that describes the trigger feature, we can probably make sure its there and give a quick code example. -- Trent Jarvi tjarvi at qbang.org From jredman at ergotech.com Sun May 14 22:22:48 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 22:22:48 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: References: <446792E8.4000506@ergotech.com> Message-ID: <44680218.4080008@ergotech.com> Trent, Trent Jarvi wrote: > On Sun, 14 May 2006, Jim Redman wrote: > >> Does anyone know of any work to make RXTX work with Ethernet (telent) >> Terminal Servers? >> >> If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 >> Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? >> > > Hi Jim > > It appears the author of NVTCom has decided to release the library into > the public domain. Integration with rxtx is possible but it would be best > to contact the author and find out what his intent is. > > I would suggest contacting the author with a proposal of what you would > like to do and take it from there. We could 'take' public domain software > but its better to show respect to the authors and respect their wishes. > I sent Marco(?), the author of the library, a note before asking the list - I'll let you know the response. If anyone is already working on it, or has an interest and more time and energy than me, I'd hate to duplicate the efforts. If no one is, and no one objects, maybe I'll see what I can do. Jim > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From Christian.Klemke at t-online.de Mon May 15 02:23:06 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Mon, 15 May 2006 10:23:06 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu><004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: <008a01c677f8$cae18590$02fea8c0@NB600> Hi Trent, Hi Paul, I finally found some time to create a simple patch to enable the optional suppression of version output to the console. It is based on a new system property called "gnu.io.rxtx.NoVersionOutput" which can by set to "true" if necessary. I had some problems accessing CVS, therefore I downloaded the rxtx-2.1-7r2 source archive from ftp.qbang.org (which is linked on the rxtx.org download page) and worked with that release. Please find my proposed patch in the attachment ! Regards, Christian ----- Original Message ----- From: "Trent Jarvi" To: "RXTX Developers and Users" Cc: ""Paul Gettings"" Sent: Friday, May 05, 2006 2:09 PM Subject: Re: [Rxtx] RXTX causing stdout messages > On Fri, 5 May 2006, Christian Klemke wrote: > >> Hi Paul, >> >> I was wondering about the same question some days ago and took a look at >> the >> source files. Unfortunately, I found that you can only get rid of that >> messages by altering and recompiling the Java code. There is a final >> static >> boolean variable called "devel" in the file "RXTXCommDriver.java" which >> is >> set to "true". This constellation causes the output after the native >> libraries have been loaded. No mechanism exists to suppress them >> otherwise >> :-(. >> >> Trent, does that mean that 2.1.7 is still officially a "development" >> version >> ? When will this value be changed to "false" by default ? With 2.1.8 ? It >> would be nice to provide a means to suppress such messages besides that >> static flag (maybe by setting a property called >> "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The >> output can indeed by annoying, especially when used with console >> applications, where the message potentially appears "in the middle" of >> your >> own output. Another possibility would be not to use System.out directly, >> but >> instead some PrintStream field which is initially set to System.out but >> can >> programatically be changed. That would allow for any kind of redirection >> or >> suppression by implementing appropriate user-defined PrintStream >> subclasses >> and making RXTX use that stream. What do you think ? >> > > A patch for using properties would be accepted I'm sure. > > The reason the default is to display the message is not related to the > development state of rxtx anymore. The problem is that people first using > rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. > The message prevents a great deal of email thats easily explained by the > message. > > I question if we should support rxtx 2.0 at all anymore. > > If you post a patch in bugzilla, we'll put it into CVS this weekend. > we'll be going through and doing such things anyhow. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_version_output_patch.diff Type: application/octet-stream Size: 991 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060515/3173c2b6/rxtx_version_output_patch-0401.obj From lyon at docjava.com Mon May 15 06:06:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 May 2006 08:06:21 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Joachim makes several good points. Let me see if I can address some of them below: >Hello Douglas, > >Looking at the current code, leaves me with the feeling, that there? >is a lot to do. Yes! >Defining an API that wraps javax.comm to provide what? >you describe is certainly possible, but I wonder how much benefit it? >will actually provide. > >Personally I think the API defined by javax.comm > >"request/lock" a port with: > cp= new CommunicationPort(identifier) >"release" a port with: > cp.close(); > >works quite nice for 99% of the applications. I don't know what percentage of applications turn off locking, the way that I do in my version of the RXTX lib. I do know that this is not safe practice. I also know that it was motivated by the multi-platform nature of my code and that this was the only way I could make things work, at the time. Java does not appear to have a cross-platform standard for locking resources on various platforms. Each OS appears to have its own standard. The question of who breaks deadlocks and how this is done remains open, as this is not an easy question to resolve. Let me continue, below: > >In my experience, the most efficient and elegant implementation is to? >wrap a port/socket/.. into a business object which declares the? >remote operations that are possible. Ie "uploadFile",? >"waitForPrompt", "getSerialNumber", "sendContact", "executeCommand",? >etc Those methods are then either synchronized or guarded by a? >monitor. I do not see how your design pattern applied to the port? >resource would help implementing this. I have no problem with high-level wrappers that are application specific. That is a very good idea, but orthogonal with respect to the issue of deadlocks. More below: > >[details start, skip if you agree to the above] >When I talked about "thread-safe" I didn't mean several independent? >"sessions" accessing the port concurrently. I think this is a very? >rare usage. That is probably why turning locking off works so well! On the other hand, it is not safe and I shouldn't do it. >I believe the most common use case for serial ports today? >is the control of an external device from a PC running a GUI based? >application. To implement a clean Swing/AWT-GUI one needs to pass any? >action that can block to a "worker" thread (else the GUI blocks, the? >application appears dead). While it is possible to use own prespawned? >thread that will accept Runnables which operate on the port, this is? >not very elegant. It is more common to spawn a new thread for every? >action triggered by the user. Additionally the ABORT of a running? >operation is often implemented via a port.close() delegated to a? >different thread. Here lies the heart of serial port concern. An application opens a serial port and then dies. The application is restarted and finds the port locked. How do we clear the lock? Must the application's user reside in the UUCP group? Must installers of the serial port add users to the UUCP group? Should locking be handled at a high-level of abstraction in an operating system independent way? Should the implementation of the locking mechanism be translated into an API that is dependent on the OS convention? Suppose that we restrict the discussion to serial ports. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on inconsistent naming conventions. Hence my feeling that we need to mirror what is done in other API's; we need a locking toolkit that references peer methods, IMHO. >From the Java programming point of view, the locking API is portable across different platforms, but has, as its implementation, a native peer method that uses the conventions of the underlying OS. This enables portable resource locking (in theory!). Consider, for example: org.apache.commons.transaction.locking with: Interface LockManager at: http://jakarta.apache.org/commons/transaction/apidocs/org/apache/commons/transaction/locking/LockManager.html Or, more recently: java.util.concurrent.locks Interface Lock based on Doug Lea's code: http://kickjava.com/src/EDU/oswego/cs/dl/util/concurrent/ReadWriteLock.java.htm Should we incorporate a clean, portable design into serial port use, one that is consistent with current locking APIs? Basically, a comm port is a resource and resources are typically controlled by managers. Thus, I suggest that we make use of a CommPortManager to help control and centralize serial port usage. The question of how this is done remains open, IMHO, but using core API's like: java.util.concurrent.locks might not be amiss. High-level methods (getAllPorts, getAllSerialPorts, getAllParallelPorts, etc...) might be welcome additions. Basic questions like, "what if a port is in use?" remain open, hence my proposal for the new design pattern. Isn't it the CommPortManager's role to break the deadlock? Cheers! - Doug > >- During the lifetime of a port, it will usually be accessed from? >several different threads. Instance variables need to be set/read in? >synchronized regions to guarantee a correct operation based on the? >Java memory model. >- Synchronizing the access is usually handled on the application? >level (synchronizing the reads/writes is usually useless from the? >applications view because it is not a transaction mechanism). >[details end] > >I am very open to learn about other scenarios where your proposed? >design pattern applied to the port resource is beneficial to the? >application implementor. > >Best regards, >Joachim > >On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > >> Dmitry suggests that we acquire an implementation of >> a serial port reference, use it, then release it (i.e., check it? >> back in). >> > > Joachim says that making serial ports thread friendly might be a? >> good idea. >> >> This is a good idea. The design pattern that is close to this idea >> is the "Object Pool Design Pattern". >> # Object Pool > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Mon May 15 06:58:19 2006 From: joachim at buechse.de (Joachim Buechse) Date: Mon, 15 May 2006 14:58:19 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Doug, I agree fully, that locking of the system resource should be abstracted from the user (programmer). Currently this is already the case, but I agree it might be nice to extract the code into a separate class, which uses platform dependent providers to do its job. What I described in my email was not targeted at allocating the system resource, but at handling an already allocated system resource inside the framework. I agree that it may be possible to combine the two - however, I would suggest to do this in phase2. I can contribute a work over of RXTXPort.java which implements clean internal locking and proper close behavior (which I would call phase 1). I could do this this week. However I strongly believe that there is little sense in trying to do this as a series of patches. It will be closer to a rewrite than to a patch. I have already provided a number of suggested patches via Bugzilla, but this is quite inconvenient (for me). My working copy diverges more and more from the master and hence it gets more and more annoying to provide self contained patches. Best regards, Joachim From tjarvi at qbang.org Mon May 15 08:27:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 May 2006 08:27:51 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Mon, 15 May 2006, Joachim Buechse wrote: > Hello Doug, > > I agree fully, that locking of the system resource should be > abstracted from the user (programmer). Currently this is already the > case, but I agree it might be nice to extract the code into a > separate class, which uses platform dependent providers to do its job. > > What I described in my email was not targeted at allocating the > system resource, but at handling an already allocated system resource > inside the framework. I agree that it may be possible to combine the > two - however, I would suggest to do this in phase2. > > I can contribute a work over of RXTXPort.java which implements clean > internal locking and proper close behavior (which I would call phase > 1). I could do this this week. > > However I strongly believe that there is little sense in trying to do > this as a series of patches. It will be closer to a rewrite than to a > patch. I have already provided a number of suggested patches via > Bugzilla, but this is quite inconvenient (for me). My working copy > diverges more and more from the master and hence it gets more and > more annoying to provide self contained patches. > For methodical testing purposes (which does go on) the incremental patches are better. I'm lagging behind in bugzilla but thats soon to change (this week). It has just been rather chaotic up until now. I moved, purchased a house, and jumped into the fire of a feature freeze timeframe at a new job. btw, we see the Solaris close issues on 2.8 also. 9 and 10 are fine. I'll work towards making those test results public and allow others to run new rxtx code through them. We had the OK at one point but setting up the environment is involved. It isn't just a collection of java classes. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Tue May 16 02:01:47 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:01:47 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] Message-ID: <446986EB.209@willicon.de> Hi, any ideas for my problem? Hans -------- Original-Nachricht -------- Betreff: [Rxtx] Problem under Mac OSX 10.3.9 Datum: Mon, 08 May 2006 18:47:20 +0200 Von: WILLICon Antwort an: RXTX Developers and Users An: RXTX Developers and Users Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/b0741c2b/attachment-0401.html From joachim at buechse.de Tue May 16 02:15:08 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 10:15:08 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: Hello Hans, I am using RXTX on OS X for my own project. I do not see the problem you describe. I had some troubles installing it because the current version uses lock files which is non-standard on OS X. I have created a patched version which I currently use. This version does not need to modify user groups and hence does not need an installer. I just pop it in the application directory. If you send me a link where I can download your OSX installer, I will have a quick look. Regards, Joachim On 16.05.2006, at 10:01, WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we > have some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + > spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + > spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always > the value "false". > I can only get the status, while I open the port and catch the > exception. > > Any ideas? > > Hans > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail at willicon.de Tue May 16 02:26:53 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:26:53 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: References: <446986EB.209@willicon.de> Message-ID: <44698CCD.7050709@willicon.de> Joachim, tanks for the answer. I'll send You a mail. Hans Joachim Buechse schrieb: > Hello Hans, > > I am using RXTX on OS X for my own project. I do not see the problem > you describe. > > I had some troubles installing it because the current version uses > lock files which is non-standard on OS X. I have created a patched > version which I currently use. This version does not need to modify > user groups and hence does not need an installer. I just pop it in > the application directory. If you send me a link where I can download > your OSX installer, I will have a quick look. > > Regards, > Joachim > > On 16.05.2006, at 10:01, WILLICon wrote: > > >> Hi, >> >> any ideas for my problem? >> >> Hans >> >> -------- Original-Nachricht -------- >> Betreff: [Rxtx] Problem under Mac OSX 10.3.9 >> Datum: Mon, 08 May 2006 18:47:20 +0200 >> Von: WILLICon >> Antwort an: RXTX Developers and Users >> An: RXTX Developers and Users >> >> >> Hi, >> >> I use for RXTX for communicate with CyclingComputers. >> >> It works good under Win32, Sloaris and Linux but with Mac OSX we >> have some problems. >> >> My users install the Mac OSX serial lib from the actual binary. >> >> After starting the program, they get this error message: >> >> java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while >> loading gnu.io.RXTXCommDriver >> >> Remember, this error comes only under Mac OSX. >> >> That is the code for the error: >> >> Enumeration portList = CommPortIdentifier.getPortIdentifiers(); >> spInUse = getBundleStr("serialPortInUse"); >> spFree = getBundleStr("serialPortFree"); >> while (portList.hasMoreElements()) { >> CommPortIdentifier portId = (CommPortIdentifier) >> portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (osName != null && osName.startsWith("mac")) { >> if (!portId.getName().startsWith("dev/cu.")) { >> continue; >> } >> } >> if (portId.isCurrentlyOwned()) { >> serialPortNames.add(portId.getName() + " - " + >> spInUse); >> } >> else { >> serialPortNames.add(portId.getName() + " - " + >> spFree); >> } >> } >> } >> if (serialPortNames.size() == 0) { >> serialPortNames.add(getBundleStr("serialPortNotFound")); >> } >> >> BTW: The methode isCurrentlyOwned() is not working. I get always >> the value "false". >> I can only get the status, while I open the port and catch the >> exception. >> >> Any ideas? >> >> Hans >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/948333be/attachment-0401.html From jredman at ergotech.com Tue May 16 07:35:52 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 16 May 2006 07:35:52 -0600 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: <4469D538.6070408@ergotech.com> Hans, I have no direct insight, but would note that what you have is a "NoClassDefFoundError" not a "ClassNotFoundException". So the class javax/comm/CommDriver is found, but one of its dependencies is missing. NoClassDefFoundError are a bigger problem to resolve because you get no indication of the real problem. Jim WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we have > some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > * spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always the > value "false". > I can only get the status, while I open the port and catch the exception. > > Any ideas? > > Hans > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.de Tue May 16 08:01:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 16:01:21 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 In-Reply-To: <4469AFC3.6000002@willicon.de> References: <44698EBC.8000008@willicon.de> <8C5680C4-E2BA-42FF-B221-36E1124FA6A4@buechse.de> <4469AFC3.6000002@willicon.de> Message-ID: <9825A602-D6ED-4C28-BF33-9A7C984FACD5@buechse.de> Hallo Hans, you include RXTX 2.17 in your "bikeXexperience.jar" (2.17 uses Interfaces from gnu.io.* not javax.comm.*). Now inspect your error log closely: The class gnu.io.RXTXCommDriver tries to load javax.comm.CommDriver: this is only the case for RXTX 2.07. I assume, that the user has installed Version 2.07 into one of the java.ext.dirs . The VM always tries to load classes from the "system" path first. The current Mac installer distributed with RXTX in fact installs RXTXcomm.jar and librxtxSerial.jnilib into /Library/Java/Extensions. (I wrote some time ago that I consider this as a bad idea because of potential version conflicts-> thanks for delivering the example). For 2.07 it does so without installing the javax.comm classes it seems. I would recommend that you instruct your users to install version 2.17 only. Until RXTX is changed to use TIOCEXCL instead of lock files, you can hardly avoid the installer, as the user needs to be added to a special group and a lockfile directory needs be created. More precisely you are waiting for: http://bugzilla.qbang.org/show_bug.cgi?id=50 [RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL)] Regards, Joachim -------------- next part -------------- A non-text attachment was scrubbed... Name: log.tiff Type: image/tiff Size: 38394 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/e3e52128/log-0401.tiff -------------- next part -------------- > > Ich verwende RXTX 2.17. Das orginal RXTXcomm.jar ist in > CyclingDataManager.jar enthalten. > From tjarvi at qbang.org Wed May 17 23:18:15 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 May 2006 23:18:15 -0600 (MDT) Subject: [Rxtx] update Message-ID: So we have several patches and these have stacked up. I'd like to thank everyone for being patient. Tests for the most intrusive patches look good so far. I still have to get some bits together on my end but it looks like we can catch everything up in CVS this week. I'll try to post a normal list of what went in by whom with links Saturday. But I'm not seeing anything that raises flags yet. I also think I'll be able to submit a patch for nonstandard baud rates. I have to confirm w32 but I think its going to be a one line fix. I don't know if its bugzilla or people tinkering with patch files before submitting but patches are not applying cleanly. So the patches have to be done by hand. This may make things difficult for people hoping to add other patches on top. I'm trying to make that go well but ... -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Thu May 18 02:23:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 May 2006 10:23:47 +0200 Subject: [Rxtx] update In-Reply-To: References: Message-ID: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Hello Trent, in fact I tinkered with the patches (never used this mechanism before, usually I "communicate" via cvs) ... so sorry for any trouble you had applying them. Basicly I edited the patches to make them self contained. Having the tests run with different speeds on different platforms, may well be an effect of caching. I have seen quite interesting propagation delays for the closing flag on my PowerPC system, which makes me doubt, that the propagation of output_buffer_empty_flag works as it should. Maybe the communication mechanism between the two threads should be replaced by something like pthread_cond_*. Could you describe which problems you see on Solaris/SPARC? I'd be interested to see if they exist on OS X (PowerPC) as well... As you seem to work on the stuff at the moment I would like to suggest the following additions (it looks more than it is, I posted some context to make clear where to apply the change). See the comments in braces for what was changed Greetings, Joachim (1) The end of the drain loop could be: --- report("drain_loop: received EINTR in tcdrain\n"); --- (added "in tcdrain" to make debug output clearer) (2) The start of the drain loop should be: --- for(i=0;;i++) { report_verbose("drain_loop: looping\n"); #if defined(__sun__) /* FIXME: No time to test on all OS's for production */ if( eis->eventloop_interrupted ) { goto end; } if (usleep(5000)) { report("drain_loop: received EINTR"); } #else if (usleep(1000000)) { report("drain_loop: received EINTR"); } #endif /* __sun__ */ --- (added a check for "eis->eventloop_interrupted" before the sleep) (3) The end of interrupt_event_loop could (and maybe should) be: --- #if !defined(TIOCSERGETLSR) && !defined(WIN32) /* make sure that the drainloop unblocks from tcdrain */ pthread_kill(index->drain_tid, SIGABRT); /* TODO use wait/join/SIGCHLD/?? instead of sleep? */ usleep(50 * 1000); /* Under normal conditions, SIGABRT will unblock tcdrain. However a non-responding USB device combined with an unclean driver may still block. This is very ugly because it may block the call to close indefinetly. */ if (index->closing != 1) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); index->closing = 1; } #endif report("interruptEventLoop: interrupted\n"); --- (added some comments and pthread_cancel for resisting drain thread) On 18.05.2006, at 07:18, Trent Jarvi wrote: > > So we have several patches and these have stacked up. I'd like to > thank > everyone for being patient. > > Tests for the most intrusive patches look good so far. I still > have to > get some bits together on my end but it looks like we can catch > everything > up in CVS this week. > > I'll try to post a normal list of what went in by whom with links > Saturday. But I'm not seeing anything that raises flags yet. I also > think I'll be able to submit a patch for nonstandard baud rates. > I have > to confirm w32 but I think its going to be a one line fix. > > I don't know if its bugzilla or people tinkering with patch files > before > submitting but patches are not applying cleanly. So the patches > have to > be done by hand. This may make things difficult for people hoping > to add > other patches on top. I'm trying to make that go well but ... > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu May 18 22:28:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 18 May 2006 22:28:00 -0600 (MDT) Subject: [Rxtx] update In-Reply-To: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> References: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Message-ID: On Thu, 18 May 2006, Joachim Buechse wrote: > Hello Trent, > > in fact I tinkered with the patches (never used this mechanism > before, usually I "communicate" via cvs) ... so sorry for any trouble > you had applying them. Basicly I edited the patches to make them self > contained. I think we are close to moving towards that. > > Having the tests run with different speeds on different platforms, > may well be an effect of caching. I have seen quite interesting > propagation delays for the closing flag on my PowerPC system, which > makes me doubt, that the propagation of output_buffer_empty_flag > works as it should. Maybe the communication mechanism between the two > threads should be replaced by something like pthread_cond_*. Could > you describe which problems you see on Solaris/SPARC? I'd be > interested to see if they exist on OS X (PowerPC) as well... This is interesting. I have seen problems with output buffer empty in applications that require it. I'm trying to get a bug list and or test results open for everyone to see but that may take time. But missed output buffer events ... yep. With Sparc, we have seen a few things. One was a kernel race condition that went away when we reimaged and updated 2.8. RXTX was hanging on close, top showed no cpu use but there was 2 second delays just typing on console. The other is our tests now take ~4 times longer on Solaris. Someone is looking at timing just open, close, read, write, ... to see if they can find where the slowdown is. This happened after solaris 2.8. I'll try to share more when/if there is something interesting. This may well not be solvable in userland. > > As you seem to work on the stuff at the moment I would like to > suggest the following additions (it looks more than it is, I posted > some context to make clear where to apply the change). See the > comments in braces for what was changed I'll take a look. This could all come together Saturday but I also have an event to attend that day. I may not wrap this up until Sunday. -- Trent Jarvi tjarvi at qbang.org From andrewlord at internode.on.net Sun May 21 20:10:02 2006 From: andrewlord at internode.on.net (Andrew Lord) Date: Mon, 22 May 2006 11:40:02 +0930 Subject: [Rxtx] Kernel include files do not match kernel Message-ID: <200605221140.03271.andrewlord@internode.on.net> Hi, I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel 2.6.12-18 with the command: ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include However I get the message: ## checking java.version 1.5.0_06 ## checking os.version 2.6.12-18mdk ## ## WARNING: Kernel include files do not match the current kernel ## ## configure: creating ./config.status etc. Is there a problem with the way I'm specifying the 'include' directory ? If not, how else can I specify the correct directory for the include files please ? Cheers, Andrew From tjarvi at qbang.org Sun May 21 20:31:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 May 2006 20:31:31 -0600 (MDT) Subject: [Rxtx] Kernel include files do not match kernel In-Reply-To: <200605221140.03271.andrewlord@internode.on.net> References: <200605221140.03271.andrewlord@internode.on.net> Message-ID: On Mon, 22 May 2006, Andrew Lord wrote: > Hi, > > I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel > 2.6.12-18 with the command: > > ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk > CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include > > However I get the message: > > ## checking java.version 1.5.0_06 > ## checking os.version 2.6.12-18mdk > ## > ## WARNING: Kernel include files do not match the current kernel > ## > ## configure: creating ./config.status > etc. > > Is there a problem with the way I'm specifying the 'include' directory ? If > not, how else can I specify the correct directory for the include files > please ? > Hi Andrew I'm fairly sure your --with-kernel option does nothing. The CPPFLAGS should do what you want. Maybe put an #error message in /usr/src/linux.../incude/linux/version.h But I don't recall a recent problem with version missmatches. It should work. Distros will even ship include files that don't match versions exactly. In theory it should never matter for users. I used to compile new kernels by hand and really didnt have a distro. I didnt have a seperate package of kernel headers for users (myself). When changing a gateway from linux 1.2.12 to 2.1.77, I would worry about such messages. So if you are doing something that weird, the message may be of use to you. If you just see the message on a distro you installed, it is more than likely harmless. -- Trent Jarvi tjarvi at qbang.org From mrogers at spro.net Mon May 22 14:45:39 2006 From: mrogers at spro.net (Mike Rogers) Date: Mon, 22 May 2006 14:45:39 -0600 Subject: [Rxtx] Sun's CommAPI -- think May? Message-ID: <447222F3.9040302@spro.net> Hi, Any word from Sun about progress towards fixing the Java CommAPI v3 "incompatibilities" so RXTX 2.0 can operate within the framework's namespace (javax.comm)? I recall mention of a May time frame. Thanks, Mike From paul.klissner at sun.com Mon May 22 15:09:27 2006 From: paul.klissner at sun.com (Paul Klissner) Date: Mon, 22 May 2006 14:09:27 -0700 Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <447222F3.9040302@spro.net> References: <447222F3.9040302@spro.net> Message-ID: <44722887.8080308@sun.com> Mike Rogers wrote: > Hi, > > Any word from Sun about progress towards fixing the Java CommAPI v3 > "incompatibilities" so RXTX 2.0 can operate within the framework's > namespace (javax.comm)? I recall mention of a May time frame. > > Thanks, > > Mike > We've had a lot of work come in. This hasn't been the only priority. I'm running behind the plan in addressing this, but will be looking at it again soon. Rather than state a new, I'll just say it is in progress, and not off the table. I'll get this fixed as soon as I can. Good timing for asking as we just started discussing javax.comm plans today, and I'll have some cycles to work on it soon. Paul From yhua537 at cse.unsw.edu.au Mon May 22 16:03:05 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Tue, 23 May 2006 08:03:05 +1000 (EST) Subject: [Rxtx] install rxtx in XP Message-ID: Hi Guys, I am new to serial port programming, and have no experience on programming java in xp, but my project require me to builld a communication link between xp and a UART device. Most of the information in the web site seems for linux only. including the commands such as export and chmod. How do I install rxtx in xp? cheers YiQi Huang From mark at mdsh.com Tue May 23 01:24:20 2006 From: mark at mdsh.com (Mark Himsley) Date: Tue, 23 May 2006 08:24:20 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off , it includes DLLs for Windows and the JAR for Java. Follow the Windows instructions in the INSTALL. ie RXTXcomm.jar goes in \jre\lib\ext (under java) rxtxSerial.dll goes in \jre\bin So, assuming a fairly standard Java install, copy RXTXcomm.jar into C:\Program Files\Java\jre1.5.0_06\lib\ext and copy rxtxSerial.dll into C:\Program Files\Java\jre1.5.0_06\bin Yes, it really is that simple. On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > I am new to serial port programming, and have no experience on > programming java in xp, but my project require me to builld a > communication link between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang -- Mark Himsley From joachim at buechse.de Tue May 23 02:51:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 23 May 2006 10:51:47 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) Unless it is absolutely required you should NOT install RXTX in your global Java Runtime Environment. This will for sure create versioning conflicts - if not now, than in the future, if not on your system than at your clients. Instead put the dll in your application directory and include the RXTXcomm.jar in your classpath. This is much safer and not a bit more complicated. Regards, Joachim On 23.05.2006, at 09:24, Mark Himsley wrote: > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR > for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > >> I am new to serial port programming, and have no experience on >> programming java in xp, but my project require me to builld a >> communication link between xp and a UART device. >> >> Most of the information in the web site seems for linux only. >> including >> the commands such as export and chmod. How do I install rxtx in xp? >> >> cheers >> YiQi Huang > > > > -- > Mark Himsley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tod at todbot.com Tue May 23 03:12:22 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 02:12:22 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I totally agree: do not contaminate the Java installation. I put all the RXTX files in a directory and then change my java invocation to be: % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* Alternatively, use Launch4J to create a double-clickable application and keep the RXTX libraries in the directory of the application. -=tod On May 23, 2006, at 1:51 AM, Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > >> Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off >> , it includes DLLs for Windows and the JAR >> for Java. >> >> Follow the Windows instructions in the INSTALL. >> >> ie >> >> RXTXcomm.jar goes in \jre\lib\ext (under java) >> rxtxSerial.dll goes in \jre\bin >> >> So, assuming a fairly standard Java install, copy RXTXcomm.jar into >> C:\Program Files\Java\jre1.5.0_06\lib\ext >> and copy rxtxSerial.dll into >> C:\Program Files\Java\jre1.5.0_06\bin >> >> Yes, it really is that simple. >> >> >> >> On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: >> >>> I am new to serial port programming, and have no experience on >>> programming java in xp, but my project require me to builld a >>> communication link between xp and a UART device. >>> >>> Most of the information in the web site seems for linux only. >>> including >>> the commands such as export and chmod. How do I install rxtx in xp? >>> >>> cheers >>> YiQi Huang >> >> >> >> -- >> Mark Himsley >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From smontgomery at mediaspansoftware.com Tue May 23 08:46:53 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Tue, 23 May 2006 10:46:53 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: Message-ID: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Joachim and Tod mentioned how to keep the files RXTX requires on Windows XP out of the Java installations - thanks gentlemen! Are there similar suggestions for an RXTX install on OS X? The current "canonical" OS X installation instructions "contaminate the Java installation", to use Tod's words. Our app will run fine under 1.4.2 and 5.0 on OS X, and a lot of users will have both. We've already been burned by the recent switch from 1.4.2 to 5.0 as the platform default. Any suggestions welcomed. From tod at todbot.com Tue May 23 13:27:55 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 12:27:55 -0700 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <9BA0F670-A862-42E7-BB2C-130D775ABDF9@todbot.com> Hi Sean, It depends on how you build and deploy your code. If you're using shell scripts, you can do something like this: #!/bin/sh # pick one JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/ Commands/java #JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/ Commands/java $JAVA -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* That both picks which VM to use and uses the RXTX in the directory called 'rxtxlib'. If you want your shell script to be clever, you could test for the existence of the different 'java' executables and go from there (maybe even use different jar files). I am almost positive all OS X systems with Java 1.5 are guaranteed to also have Java 1.4.2. If you're using Jar Builder or XCode, you can specify which JVM to use and add the extra args in the Info.plist file. The paths specified in the 'java' invocation then are based off of the $JAVAROOT variable that the JavaApplicationStub sets for you. For my app, I've have been compiling two sets of jars, one compiled with 1.4.2 and one with 1.5, but they both run under 1.5. So I have a similar shell script that chooses a different 'javac' depending on the need. -=tod On May 23, 2006, at 7:46 AM, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From yhua537 at cse.unsw.edu.au Tue May 23 11:09:37 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 03:09:37 +1000 (EST) Subject: [Rxtx] install rxtx in XP (Mark Himsley, Joachim Buechse, Tod E. Kurt> In-Reply-To: References: Message-ID: > Message: 8 > Date: Tue, 23 May 2006 08:03:05 +1000 (EST) > From: YiQi Huang > Subject: [Rxtx] install rxtx in XP > To: rxtx at qbang.org > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > Hi Guys, > > I am new to serial port programming, and have no experience on programming > java in xp, but my project require me to builld a communication link > between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang > > > ------------------------------ > > Message: 9 > Date: Tue, 23 May 2006 08:24:20 +0100 > From: Mark Himsley > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=us-ascii; format=flowed > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > ------------------------------ > > Message: 10 > Date: Tue, 23 May 2006 10:51:47 +0200 > From: Joachim Buechse > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > > ------------------------------ > > Message: 11 > Date: Tue, 23 May 2006 02:12:22 -0700 > From: "Tod E. Kurt" > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I totally agree: do not contaminate the Java installation. > > I put all the RXTX files in a directory and then change my java > invocation to be: > > % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* > > Alternatively, use Launch4J to create a double-clickable application > and keep the RXTX libraries in the directory of the application. > > -=tod > > Hi, Thanks guys, I don't know if this is the correct way to reply your mecessage, if wrong, please point out. Thank you for Mark to give the detail instructions and Joachim to point out the cons ot installing in the java directory, and specially thanks for Tod to give the instrection in detail. Sorry to ask another stupid question: I have followed Tod's instruction. Now I think i am ready to start hacking. But where is the RXTX API documentation? Is it the same as using normal java comm API? btw, where could i find some examples to start with? Thanks very much cheers YiQi Huang From tjarvi at qbang.org Tue May 23 16:09:32 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 May 2006 16:09:32 -0600 (MDT) Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <44722887.8080308@sun.com> References: <447222F3.9040302@spro.net> <44722887.8080308@sun.com> Message-ID: > Good timing for asking as we just started discussing javax.comm plans > today, and I'll have some cycles to work on it soon. Hi Paul I assume you mean Sun is discussing plans concerning its own internal actions and there is no community involvment at this point. -- Trent Jarvi tjarvi at qbang.org From yhua537 at cse.unsw.edu.au Tue May 23 22:50:01 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 14:50:01 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } From mmester at sps.edu Tue May 23 22:58:21 2006 From: mmester at sps.edu (Michael Mester) Date: Wed, 24 May 2006 00:58:21 -0400 Subject: [Rxtx] install rxtx in XP References: Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below -----Original Message----- From: rxtx-bounces at qbang.org on behalf of YiQi Huang Sent: Wed 5/24/2006 12:50 AM To: RXTX Developers and Users Subject: Re: [Rxtx] install rxtx in XP Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3950 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060523/b36d0c63/attachment-0401.bin From yhua537 at cse.unsw.edu.au Tue May 23 23:05:50 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 15:05:50 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: Yes, Michael you are right, it should be semicolons, But it still can't find the correct library. On Wed, 24 May 2006, Michael Mester wrote: > I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below > > > -----Original Message----- > From: rxtx-bounces at qbang.org on behalf of YiQi Huang > Sent: Wed 5/24/2006 12:50 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] install rxtx in XP > > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > cheers YiQi Huang From tod at todbot.com Wed May 24 00:01:57 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 23:01:57 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Yes, sorry, classpath entries are semicolon-separated on Windows and colon-separated on everything else. Your example code below is importing the wrong set of classes. It should not "import javax.comm.*", instead it should "import gnu.io.*". When I make that change, your example program compiles. The "javax.comm" package is the one released by Sun, the "gnu.io" package is the RXTX one. You might've seen some discussion that the two will be merged or become compatible, but that hasn't happened yet. -=tod On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > > Yes, Michael you are right, it should be semicolons, But it still > can't > find the correct library. > > On Wed, 24 May 2006, Michael Mester wrote: > >> I believe the entries in the classpath need to be seperated with >> semicolons, not a colon as you have in your command below >> >> >> -----Original Message----- >> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >> Sent: Wed 5/24/2006 12:50 AM >> To: RXTX Developers and Users >> Subject: Re: [Rxtx] install rxtx in XP >> >> Hi, >> >> Sorry guys.I follow Tod's instruction, and here is what i did: >> >> put >> RXTXcomm.jar, >> rxtxParallel.dll, >> rxtxSerial.dll >> in >> C:\RXTX_files >> >> and I got a SimpleRead class attached below, compile it with : >> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >> it still saying "cannot find symbol". >> >> Is there anything I did wrong? Do I need the comm.jar from Sun? >> >> Thanks & regards >> YiQi Huang >> >> >> //////////////////////////////////////////////////////// >> // SimpleRead.java >> //////////////////////////////////////////////////////// >> >> import java.io.*; >> import java.util.*; >> import javax.comm.*; >> >> public class SimpleRead >> implements Runnable, SerialPortEventListener { >> static CommPortIdentifier portId; >> static Enumeration portList; >> InputStream inputStream; >> SerialPort serialPort; >> Thread readThread; >> public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == >> CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals("COM1")) { >> //if (portId.getName().equals("/dev/term/a")) { >> SimpleRead reader = new SimpleRead(); >> } >> } >> } >> } >> public SimpleRead() { >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", >> 2000); >> } catch (PortInUseException e) {} >> try { >> inputStream = serialPort.getInputStream(); >> } catch (IOException e) {} >> try { >> serialPort.addEventListener(this); >> } catch (TooManyListenersException e) {} >> serialPort.notifyOnDataAvailable(true); >> try { >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } catch (UnsupportedCommOperationException e) {} >> readThread = new Thread(this); >> readThread.start(); >> } >> public void run() { >> try { >> Thread.sleep(20000); >> } catch (InterruptedException e) {} >> } >> public void serialEvent(SerialPortEvent event) { >> switch(event.getEventType()) { >> case SerialPortEvent.BI: >> case SerialPortEvent.OE: >> case SerialPortEvent.FE: >> case SerialPortEvent.PE: >> case SerialPortEvent.CD: >> case SerialPortEvent.CTS: >> case SerialPortEvent.DSR: >> case SerialPortEvent.RI: >> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >> break; >> case SerialPortEvent.DATA_AVAILABLE: >> byte[] readBuffer = new byte[20]; >> try { >> while (inputStream.available() > 0) { >> int numBytes = inputStream.read(readBuffer); >> } >> System.out.print(new String(readBuffer)); >> } catch (IOException e) {} >> break; >> } >> } >> } >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > cheers > YiQi Huang > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From joachim at buechse.de Wed May 24 00:10:06 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:10:06 +0200 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Hi Sean, my preferred way of dealing with RXTX on OS X is to include the RXTX classes into my application jar and to put the RXTX lib in the same directory as this jar. To make it even more comfortable, you can include the lib in the jar and have some startup code extract it and write it to a temporary file from which you load it with System.load(). Unfortunately the current version of RXTX for OS X requires tinkering with user groups as it is based on lockfiles - and hence it needs the RXTX OS X installer or you need to duplicated this functionality in your own installer. I have created my own native version which is not based on lockfiles but tty locking (the standard way to do it on OSX). I hope that these patches will be integrated soon into the distribution. Regards, Joachim On 23.05.2006, at 16:46, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Wed May 24 00:16:12 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:16:12 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <7017ECFC-B13E-4806-B321-9FFCAC5830F0@buechse.de> I assume you downloaded rxtx-217 (not 207). Instead of importing javax.comm.* you must import gnu.io.* The classes have the same name, but they are not in the same package. On 24.05.2006, at 06:50, YiQi Huang wrote: > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From yhua537 at cse.unsw.edu.au Wed May 24 00:17:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 16:17:45 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Message-ID: Thanks Tod again, i kept reading "gnu.io.*" as "gun.io.*" last few hours after i read some commons from web. Thanks very much Tod. thanks YiQi Huang On Tue, 23 May 2006, Tod E. Kurt wrote: > Yes, sorry, classpath entries are semicolon-separated on Windows and > colon-separated on everything else. > > Your example code below is importing the wrong set of classes. It > should not "import javax.comm.*", instead it should "import > gnu.io.*". When I make that change, your example program compiles. > The "javax.comm" package is the one released by Sun, the "gnu.io" > package is the RXTX one. You might've seen some discussion that the > two will be merged or become compatible, but that hasn't happened yet. > > -=tod > > > On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > >> >> Yes, Michael you are right, it should be semicolons, But it still >> can't >> find the correct library. >> >> On Wed, 24 May 2006, Michael Mester wrote: >> >>> I believe the entries in the classpath need to be seperated with >>> semicolons, not a colon as you have in your command below >>> >>> >>> -----Original Message----- >>> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >>> Sent: Wed 5/24/2006 12:50 AM >>> To: RXTX Developers and Users >>> Subject: Re: [Rxtx] install rxtx in XP >>> >>> Hi, >>> >>> Sorry guys.I follow Tod's instruction, and here is what i did: >>> >>> put >>> RXTXcomm.jar, >>> rxtxParallel.dll, >>> rxtxSerial.dll >>> in >>> C:\RXTX_files >>> >>> and I got a SimpleRead class attached below, compile it with : >>> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >>> it still saying "cannot find symbol". >>> >>> Is there anything I did wrong? Do I need the comm.jar from Sun? >>> >>> Thanks & regards >>> YiQi Huang >>> >>> >>> //////////////////////////////////////////////////////// >>> // SimpleRead.java >>> //////////////////////////////////////////////////////// >>> >>> import java.io.*; >>> import java.util.*; >>> import javax.comm.*; >>> >>> public class SimpleRead >>> implements Runnable, SerialPortEventListener { >>> static CommPortIdentifier portId; >>> static Enumeration portList; >>> InputStream inputStream; >>> SerialPort serialPort; >>> Thread readThread; >>> public static void main(String[] args) { >>> portList = CommPortIdentifier.getPortIdentifiers(); >>> while (portList.hasMoreElements()) { >>> portId = (CommPortIdentifier) portList.nextElement(); >>> if (portId.getPortType() == >>> CommPortIdentifier.PORT_SERIAL) { >>> if (portId.getName().equals("COM1")) { >>> //if (portId.getName().equals("/dev/term/a")) { >>> SimpleRead reader = new SimpleRead(); >>> } >>> } >>> } >>> } >>> public SimpleRead() { >>> try { >>> serialPort = (SerialPort) portId.open("SimpleReadApp", >>> 2000); >>> } catch (PortInUseException e) {} >>> try { >>> inputStream = serialPort.getInputStream(); >>> } catch (IOException e) {} >>> try { >>> serialPort.addEventListener(this); >>> } catch (TooManyListenersException e) {} >>> serialPort.notifyOnDataAvailable(true); >>> try { >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, >>> SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> } catch (UnsupportedCommOperationException e) {} >>> readThread = new Thread(this); >>> readThread.start(); >>> } >>> public void run() { >>> try { >>> Thread.sleep(20000); >>> } catch (InterruptedException e) {} >>> } >>> public void serialEvent(SerialPortEvent event) { >>> switch(event.getEventType()) { >>> case SerialPortEvent.BI: >>> case SerialPortEvent.OE: >>> case SerialPortEvent.FE: >>> case SerialPortEvent.PE: >>> case SerialPortEvent.CD: >>> case SerialPortEvent.CTS: >>> case SerialPortEvent.DSR: >>> case SerialPortEvent.RI: >>> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >>> break; >>> case SerialPortEvent.DATA_AVAILABLE: >>> byte[] readBuffer = new byte[20]; >>> try { >>> while (inputStream.available() > 0) { >>> int numBytes = inputStream.read(readBuffer); >>> } >>> System.out.print(new String(readBuffer)); >>> } catch (IOException e) {} >>> break; >>> } >>> } >>> } >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> >> cheers >> YiQi Huang >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From smontgomery at mediaspansoftware.com Wed May 24 10:24:13 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 12:24:13 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: Tod & Joachim, Thanks for the info, that's very helpful. I'll give that a whirl when I move to rxtx 2.1. I'm still using the older 2.0.7 version for now (don't ask), which probably requires the Sun comm.jar, javax.comm.properties and librxtxSerial.jnilib to be in very specific places in each jvm's file hierarchy. From tjarvi at qbang.org Wed May 24 11:59:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 11:59:16 -0600 (MDT) Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: On Wed, 24 May 2006, Sean Montgomery wrote: > Tod & Joachim, > > Thanks for the info, that's very helpful. I'll give that a whirl > when I move to rxtx 2.1. I'm still using the older 2.0.7 version for > now (don't ask), which probably requires the Sun comm.jar, > javax.comm.properties and librxtxSerial.jnilib to be in very specific > places in each jvm's file hierarchy. > You will need comm.jar from Sun then. It must be Sun's version 2.* or older for Linux or Solaris. I assume they have this in download archives. The default offering from Sun is version 3.0. This version currently does not support rxtx. The older version will probably be fine for your needs. -- Trent Jarvi tjarvi at qbang.org From smontgomery at mediaspansoftware.com Wed May 24 12:19:06 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 14:19:06 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: <3939EFB8-11E1-4E3E-A684-5B3C525577CD@mediaspansoftware.com> Yup, that's right, thanks Trent. I've been using these files for quite a while now. Thanks for bringing it up. I almost didn't mention using 2.0.7 because I didn't want to give any new members of the list the wrong idea! :-) On May 24, 2006, at 1:59 PM, Trent Jarvi wrote: > On Wed, 24 May 2006, Sean Montgomery wrote: > >> Tod & Joachim, >> >> Thanks for the info, that's very helpful. I'll give that a whirl >> when I move to rxtx 2.1. I'm still using the older 2.0.7 version for >> now (don't ask), which probably requires the Sun comm.jar, >> javax.comm.properties and librxtxSerial.jnilib to be in very specific >> places in each jvm's file hierarchy. >> > > You will need comm.jar from Sun then. It must be Sun's version 2.* or > older for Linux or Solaris. I assume they have this in download > archives. > > The default offering from Sun is version 3.0. This version > currently does > not support rxtx. > > The older version will probably be fine for your needs. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mark at mdsh.com Wed May 24 15:55:46 2006 From: mark at mdsh.com (Mark Himsley) Date: Wed, 24 May 2006 22:55:46 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <37B0FC4B1F3237321F093ABE@MacMini.local> On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) That's no problem. BUT, do note that the instructions I elaborated on are in the INSTALL file within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone please update the INSTALL file? > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > > , it includes DLLs for Windows and the JAR > > for Java. > > > > Follow the Windows instructions in the INSTALL. > > > > ie > > > > RXTXcomm.jar goes in \jre\lib\ext (under java) > > rxtxSerial.dll goes in \jre\bin > > > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > > C:\Program Files\Java\jre1.5.0_06\lib\ext > > and copy rxtxSerial.dll into > > C:\Program Files\Java\jre1.5.0_06\bin > > > > Yes, it really is that simple. > > > > > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > > > >> I am new to serial port programming, and have no experience on > >> programming java in xp, but my project require me to builld a > >> communication link between xp and a UART device. > >> > >> Most of the information in the web site seems for linux only. > >> including > >> the commands such as export and chmod. How do I install rxtx in xp? > >> > >> cheers > >> YiQi Huang > > > > > > > > -- > > Mark Himsley > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Mark Himsley From tjarvi at qbang.org Wed May 24 16:41:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 16:41:46 -0600 (MDT) Subject: [Rxtx] install rxtx in XP In-Reply-To: <37B0FC4B1F3237321F093ABE@MacMini.local> References: <37B0FC4B1F3237321F093ABE@MacMini.local> Message-ID: On Wed, 24 May 2006, Mark Himsley wrote: > > > On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > >> I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > That's no problem. > > BUT, do note that the instructions I elaborated on are in the INSTALL file > within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone > please update the INSTALL file? > > The INSTALL file may be updated by anyone at anytime. http://rxtx.qbang.org/wiki/index.php/Installation We are moving it to the wiki so end users may put the type of answers they would like to see in. Sometimes it's best if developers don't give what appears to be cryptic answers. You can even put in that jre/lib/ext is not the right place but you don't understand the classpath solution mentioned on the mail-list and then we know what to add. -- Trent Jarvi tjarvi at qbang.org From stramit at gmail.com Wed May 24 21:45:31 2006 From: stramit at gmail.com (Tim Cooper) Date: Thu, 25 May 2006 13:45:31 +1000 Subject: [Rxtx] Accessing Virtual Com Port Message-ID: Hi, I have to develop an application that talks to a virtual com port (in this case com3) which translates any messages sent across a USB cable to a micro. Using C++ I can talk to this com port and I know that it is configured, present, and working. For the application that I am trying to write I want to use RXTX for the communication. My problem is that the configured virtual port (in windows) is not showing up when I do an enumeration over the available ports. The output I get is (com 3 is not present) : Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 PORT FOUND: COM1 PORT FOUND: LPT1 Is there anything that I need to do to make com3 available to RXTX and my application? Timothy Cooper -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060524/c5591648/attachment-0401.html From antonio.luis at iscte.pt Thu May 25 01:39:13 2006 From: antonio.luis at iscte.pt (=?ISO-8859-1?Q?Ant=F3nio_Lopes?=) Date: Thu, 25 May 2006 08:39:13 +0100 Subject: [Rxtx] RXTX on Pocket PC Message-ID: <44755F21.8060103@iscte.pt> Hello everyone, I've been using RXTX to communicate with serial ports in Windows and it's been quite successful. However, I'm now considering porting my application from Windows to Pocket PC but I can't seem to find the RXTX binaries (*.jar and *.dll) to use in Pocket PC. I've been "digging" on the mailing list's archives and also on the web and I can't find these anywhere. Can anyone in this mailing list give me some pointers on this? Where can I find the necessary files and basic installation instructions? Thanks very much for your help. I very much appreciate any help that you can provide me. Regards, -- Ant?nio Lopes @contact: antonio.luis at iscte.pt @work: ADETTI - ISCTE @web: http://antonio.lopes.googlepages.com/home From doug at dupreeinc.com Fri May 26 15:45:50 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Fri, 26 May 2006 14:45:50 -0700 Subject: [Rxtx] rxtx slow startup Message-ID: <4477770E.9010400@dupreeinc.com> Hello, I hope there are people still reading this mailing list. The archive appeared to not have anything new after 4/2005. I was using the commapi from sun for a project where a java application reads data from test equipment connected to the serial port. I had to upgrade the ftdi vcp driver on my pc and the old sun commapi no longer works with hardware flow control. as an experiment I replaced the javax.com with gnu.io in the SerialDemo.java project that was included with the commapi. This compiled fine using JBuilder 2006 and JRE 1.5.0_05. RXTX also works with the latest ftdi drivers so life is wonderful again... almost... When using the commapi jar the SerialDemo program starts in about 1 second on my system. Using the RXTX jar it takes over 56 seconds to start. Has anyone else seen this problem? Is there a workaround to get the startup performance close to the old commapi? The last thing printed to the console before this delay is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks for your time! Doug From yhua537 at cse.unsw.edu.au Sat May 27 05:46:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 21:46:45 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <4477770E.9010400@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> Message-ID: hi Doug The archive hasn't been update for a long time, But people certainly still reading the list. I don't have enough experience to help on your problem, but without any detail about what your problem doing during that 56 seconds, it is hard to target the your question, I think. cheers YiQi On Fri, 26 May 2006, Doug Thistlethwaite wrote: > Hello, > > I hope there are people still reading this mailing list. The archive > appeared to not have anything new after 4/2005. > > I was using the commapi from sun for a project where a java application > reads data from test equipment connected to the serial port. I had to > upgrade the ftdi vcp driver on my pc and the old sun commapi no longer > works with hardware flow control. as an experiment I replaced the > javax.com with gnu.io in the SerialDemo.java project that was included > with the commapi. This compiled fine using JBuilder 2006 and JRE > 1.5.0_05. RXTX also works with the latest ftdi drivers so life is > wonderful again... almost... > > When using the commapi jar the SerialDemo program starts in about 1 > second on my system. Using the RXTX jar it takes over 56 seconds to > start. Has anyone else seen this problem? Is there a workaround to get > the startup performance close to the old commapi? > > The last thing printed to the console before this delay is: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Thanks for your time! > > Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------- Just a student, Still a student ------------------------------- From yhua537 at cse.unsw.edu.au Sat May 27 06:04:26 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 22:04:26 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: Sorry, I don't think you could understand what I mean .I mean this: Without any detail about what your program is doing during that 56 seconds, it is hard for anyone to target the problem. On Sat, 27 May 2006, YiQi Huang wrote: > hi Doug > > The archive hasn't been update for a long time, But people certainly still > reading the list. > > I don't have enough experience to help on your problem, but without any > detail about what your problem doing during that 56 seconds, it is hard to > target the your question, I think. > > cheers > YiQi > > On Fri, 26 May 2006, Doug Thistlethwaite wrote: > >> Hello, >> >> I hope there are people still reading this mailing list. The archive >> appeared to not have anything new after 4/2005. >> >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From jredman at ergotech.com Sat May 27 08:32:02 2006 From: jredman at ergotech.com (Jim Redman) Date: Sat, 27 May 2006 08:32:02 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: <447862E2.4080506@ergotech.com> Doug, Since you mentioned it, we have a system that is also seems slow. From memory (I don't have one of the slow systems around), I'm not sure that it's consistent, it seems that sometimes it may take longer than others. Since it's part of the bootup it hasn't raised a flag and I haven't researched it. The same code runs much faster on other systems, so now you've got me wondering what's different. The slow system boots DSL (http://www.damnsmalllinux.org/) from a compact flash. FC4 is on my desktop where I haven't noticed a slow down. I think that the rxtx code is the same in both cases with lock files disabled. The slow system has a bunch of serial ports defined, including 4 USB serial ports that do not exist - they are not plugged in. Any clues in there? Jim > On Fri, 26 May 2006, Doug Thistlethwaite wrote: >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Sat May 27 10:41:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 May 2006 10:41:54 -0600 (MDT) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447862E2.4080506@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: On Sat, 27 May 2006, Jim Redman wrote: > Doug, > > Since you mentioned it, we have a system that is also seems slow. From > memory (I don't have one of the slow systems around), I'm not sure that > it's consistent, it seems that sometimes it may take longer than others. > Since it's part of the bootup it hasn't raised a flag and I haven't > researched it. > > The same code runs much faster on other systems, so now you've got me > wondering what's different. > > The slow system boots DSL (http://www.damnsmalllinux.org/) from a > compact flash. FC4 is on my desktop where I haven't noticed a slow > down. I think that the rxtx code is the same in both cases with lock > files disabled. > > The slow system has a bunch of serial ports defined, including 4 USB > serial ports that do not exist - they are not plugged in. > > Any clues in there? > rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. When it does this, it will try to open each port and do a timed out read. most systems will not have entries in device if the port is not there. But some minimal systems will just put all the device files there in case hardware is added. The list of devices scanned used to be ~10-20 times longer than it is today. That was getting very slow. I suspect moving the device files not used to a backup directory would increase the enumeration. I'll look into why the mail-list archive is not updating. The last update was about when I thought I 'fixed' the cron jobs. I probably didn't actually fix it but rather moved the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon May 29 19:46:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 May 2006 19:46:47 -0600 (MDT) Subject: [Rxtx] Mail-List Archives are updating. Message-ID: It was pointed out earlier that the archive is dated. This was a missing crontab entry. The list is currently archived by the week on the web page. It is updated once a day. So every 7 days it starts a new link and updates it daily. I've been limited in what I could do while my cable modem was disconnected this last week. rxtx.org is something I do on my own time. The patches and credits will be comming next. Many of these can be seen in bugzilla right now. -- Trent Jarvi tjarvi at qbang.org From doug at dupreeinc.com Tue May 30 11:18:41 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 10:18:41 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: <447C7E71.4080204@dupreeinc.com> Trent, YiQi, and Jim: Thanks to all for the replies and information! I am just back from a long weekend and I am now trying to figure out what I was doing! :) As for more information. First off, this example is being run under windows XP. I am developing test equipment that communicates with a java application via a serial port. I have been using the commapi for several years and have not had a problem. Recently, I have started a design modification that will replace the RS232 connection with a USB port. I am using the ftdi module for prototyping and I discovered that their virtual com port driver was not compatible with the commapi that Sun released. It turns out that it has problems with hardware flow control ( it works on incoming but not outgoing communications). The way I figured this out was by experimenting with the SerialDemo that was included with the Sum commapi. One nice thing about this example is it has the ability to set incoming and outgoing flow control independently. After I installed RXTX into my JBuilder 2006 IDE, I just replaced all all instances of javax.comm with gnu.io and it compiled and runs without a hitch (except for the slow startup). I Paused the JBuilder IDE during this long pause and the last few entries in the stack trace are: testRead() : -1, gnu.io.RXTXCommDriver registerValidPorts() : 255, gnu.io.RXTXCommDriver registerScannedPorts() : 777, gnu.io.RXTXCommDriver This was all initiated by the following call in the programs init routine: Enumeration en = CommPortIdentifier.getPortIdentifiers(); After looking at this, My guess is that Trent is correct in that the delay is in scanning for ports. I guess one solution would be to not scan for ports, though it would be nice to detect what is available on the system. Is there any way to reduce the number of ports scanned by this function in windows XP? Thanks again for your time, Doug Trent Jarvi wrote: >On Sat, 27 May 2006, Jim Redman wrote: > > > >>Doug, >> >>Since you mentioned it, we have a system that is also seems slow. From >>memory (I don't have one of the slow systems around), I'm not sure that >>it's consistent, it seems that sometimes it may take longer than others. >>Since it's part of the bootup it hasn't raised a flag and I haven't >>researched it. >> >>The same code runs much faster on other systems, so now you've got me >>wondering what's different. >> >>The slow system boots DSL (http://www.damnsmalllinux.org/) from a >>compact flash. FC4 is on my desktop where I haven't noticed a slow >>down. I think that the rxtx code is the same in both cases with lock >>files disabled. >> >>The slow system has a bunch of serial ports defined, including 4 USB >>serial ports that do not exist - they are not plugged in. >> >>Any clues in there? >> >> >> > >rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. > >When it does this, it will try to open each port and do a timed out read. >most systems will not have entries in device if the port is not there. >But some minimal systems will just put all the device files there in case >hardware is added. > >The list of devices scanned used to be ~10-20 times longer than it is >today. That was getting very slow. > >I suspect moving the device files not used to a backup directory would >increase the enumeration. > >I'll look into why the mail-list archive is not updating. The last update >was about when I thought I 'fixed' the cron jobs. I probably didn't >actually fix it but rather moved the problem. > >-- >Trent Jarvi >tjarvi at qbang.org > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/86796453/attachment-0398.html From doug at dupreeinc.com Tue May 30 14:36:09 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 13:36:09 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447C7E71.4080204@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com> Message-ID: <447CACB9.1000801@dupreeinc.com> Hello all, I also notice this pause (not as long however) when I call: CommPortIdentifier.getPortIdentifier(PortName); I would think that if I supply the name of the port, it would not have to go through the same discovery process. If you have any ideas of how to get rid of this startup delay, I would really appreciate it. Thanks, Doug Doug Thistlethwaite wrote: > Trent, YiQi, and Jim: > > Thanks to all for the replies and information! I am just back from a > long weekend and I am now trying to figure out what I was doing! :) > > As for more information. First off, this example is being run under > windows XP. I am developing test equipment that communicates with a > java application via a serial port. I have been using the commapi for > several years and have not had a problem. Recently, I have started a > design modification that will replace the RS232 connection with a USB > port. I am using the ftdi module for prototyping and I discovered > that their virtual com port driver was not compatible with the commapi > that Sun released. It turns out that it has problems with hardware > flow control ( it works on incoming but not outgoing communications). > The way I figured this out was by experimenting with the SerialDemo > that was included with the Sum commapi. One nice thing about this > example is it has the ability to set incoming and outgoing flow > control independently. > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup). > > I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are: > > testRead() : -1, gnu.io.RXTXCommDriver > registerValidPorts() : 255, gnu.io.RXTXCommDriver > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > This was all initiated by the following call in the programs init routine: > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > After looking at this, My guess is that Trent is correct in that the > delay is in scanning for ports. I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system. Is there any way to reduce the number of ports scanned by > this function in windows XP? > > Thanks again for your time, > > Doug > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/edaa5c3c/attachment-0398.html From lynn at swcp.com Tue May 30 15:07:18 2006 From: lynn at swcp.com (lynn@swcp.com) Date: Tue, 30 May 2006 21:07:18 -0000 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CACB9.1000801@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: *IF* the name of the port is supplied, we might want to use the preferences mechanism (java.util.prefs) where we could have previously saved the info for the port. We could do a quick check to see that things have not changed before using it. If things have changed (or never been defined) we would do a full port scan and save detected ports in the preferences. This way if the hardware is not changed, you only pay the time penalty one time. just an idea... Lynn Doug Thistlethwaite said: > This is a multi-part message in MIME format. > --------------070808020900080005070500 > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > Content-Transfer-Encoding: 7bit > > Hello all, > > I also notice this pause (not as long however) when I call: > > CommPortIdentifier.getPortIdentifier(PortName); > > I would think that if I supply the name of the port, it would not have > to go through the same discovery process. If you have any ideas of how > to get rid of this startup delay, I would really appreciate it. > > Thanks, > > Doug > > Doug Thistlethwaite wrote: > > > Trent, YiQi, and Jim: > > > > Thanks to all for the replies and information! I am just back from a > > long weekend and I am now trying to figure out what I was doing! :) > > > > As for more information. First off, this example is being run under > > windows XP. I am developing test equipment that communicates with a > > java application via a serial port. I have been using the commapi for > > several years and have not had a problem. Recently, I have started a > > design modification that will replace the RS232 connection with a USB > > port. I am using the ftdi module for prototyping and I discovered > > that their virtual com port driver was not compatible with the commapi > > that Sun released. It turns out that it has problems with hardware > > flow control ( it works on incoming but not outgoing communications). > > The way I figured this out was by experimenting with the SerialDemo > > that was included with the Sum commapi. One nice thing about this > > example is it has the ability to set incoming and outgoing flow > > control independently. > > > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > > all instances of javax.comm with gnu.io and it compiled and runs > > without a hitch (except for the slow startup). > > > > I Paused the JBuilder IDE during this long pause and the last few > > entries in the stack trace are: > > > > testRead() : -1, gnu.io.RXTXCommDriver > > registerValidPorts() : 255, gnu.io.RXTXCommDriver > > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > > > This was all initiated by the following call in the programs init routine: > > > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > > > After looking at this, My guess is that Trent is correct in that the > > delay is in scanning for ports. I guess one solution would be to not > > scan for ports, though it would be nice to detect what is available on > > the system. Is there any way to reduce the number of ports scanned by > > this function in windows XP? > > > > Thanks again for your time, > > > > Doug > > > > --------------070808020900080005070500 > Content-Type: text/html; charset=ISO-8859-1 > Content-Transfer-Encoding: 7bit > > > > > > > > > Hello all,
>
> I also notice this pause (not as long however) when I call:
>
>          CommPortIdentifier.getPortIdentifier(PortName);
>
> I would think that if I supply the name of the port, it would not have > to go through the same discovery process.  If you have any ideas of how > to get rid of this startup delay, I would really appreciate it.
>
> Thanks,
>
> Doug
>
> Doug Thistlethwaite wrote: >
> > Trent, YiQi, and Jim:
>
> Thanks to all for the replies and information!  I am just back from a > long weekend and I am now trying to figure out what I was doing! :)
>
> As for more information.  First off, this example is being run under > windows XP.  I am developing test equipment that communicates with a > java application via a serial port.  I have been using the commapi for > several years and have not had a problem.  Recently, I have started a > design modification that will replace the RS232 connection with a USB > port.  I am using the ftdi module for prototyping and I discovered that > their virtual com port driver was not compatible with the commapi that > Sun released.  It turns out that it has problems with hardware flow > control ( it works on incoming but not outgoing communications).  The > way I figured this out was by experimenting with the SerialDemo that > was included with the Sum commapi.  One nice thing about this example > is it has the ability to set incoming and outgoing flow control > independently.
>
> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup).
>
> I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are:
>
> testRead() : -1, gnu.io.RXTXCommDriver
> registerValidPorts() : 255, gnu.io.RXTXCommDriver
> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>
> This was all initiated by the following call in the programs init > routine:
>
> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>
> After looking at this,  My guess is that Trent is correct in that the > delay is in scanning for ports.  I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system.  Is there any way to reduce the number of ports scanned by > this function in windows XP? 
>
> Thanks again for your time,
>
> Doug
>
>
> > > > --------------070808020900080005070500-- > -- From jredman at ergotech.com Tue May 30 15:42:35 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 30 May 2006 15:42:35 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: <447CBC4B.2080206@ergotech.com> Lynn, If I understand your idea correctly, I don't think that this would work well for, say, USB ports since these can be easily added/removed by the end user. Jim lynn at swcp.com wrote: > *IF* the name of the port is supplied, we might want to use the preferences > mechanism (java.util.prefs) where we could have previously saved the info for > the port. We could do a quick check to see that things have not changed > before using it. If things have changed (or never been defined) we would do a > full port scan and save detected ports in the preferences. > > This way if the hardware is not changed, you only pay the time penalty one time. > > just an idea... > Lynn > > > Doug Thistlethwaite said: > >> This is a multi-part message in MIME format. >> --------------070808020900080005070500 >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >> Content-Transfer-Encoding: 7bit >> >> Hello all, >> >> I also notice this pause (not as long however) when I call: >> >> CommPortIdentifier.getPortIdentifier(PortName); >> >> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process. If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it. >> >> Thanks, >> >> Doug >> >> Doug Thistlethwaite wrote: >> >>> Trent, YiQi, and Jim: >>> >>> Thanks to all for the replies and information! I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :) >>> >>> As for more information. First off, this example is being run under >>> windows XP. I am developing test equipment that communicates with a >>> java application via a serial port. I have been using the commapi for >>> several years and have not had a problem. Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port. I am using the ftdi module for prototyping and I discovered >>> that their virtual com port driver was not compatible with the commapi >>> that Sun released. It turns out that it has problems with hardware >>> flow control ( it works on incoming but not outgoing communications). >>> The way I figured this out was by experimenting with the SerialDemo >>> that was included with the Sum commapi. One nice thing about this >>> example is it has the ability to set incoming and outgoing flow >>> control independently. >>> >>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup). >>> >>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are: >>> >>> testRead() : -1, gnu.io.RXTXCommDriver >>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>> >>> This was all initiated by the following call in the programs init routine: >>> >>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>> >>> After looking at this, My guess is that Trent is correct in that the >>> delay is in scanning for ports. I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system. Is there any way to reduce the number of ports scanned by >>> this function in windows XP? >>> >>> Thanks again for your time, >>> >>> Doug >>> >> --------------070808020900080005070500 >> Content-Type: text/html; charset=ISO-8859-1 >> Content-Transfer-Encoding: 7bit >> >> >> >> >> >> >> >> >> Hello all,
>>
>> I also notice this pause (not as long however) when I call:
>>
>>         >  CommPortIdentifier.getPortIdentifier(PortName);
>>
>> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process.  If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it.
>>
>> Thanks,
>>
>> Doug
>>
>> Doug Thistlethwaite wrote: >>
>> >> Trent, YiQi, and Jim:
>>
>> Thanks to all for the replies and information!  I am just back from a >> long weekend and I am now trying to figure out what I was doing! :)
>>
>> As for more information.  First off, this example is being run under >> windows XP.  I am developing test equipment that communicates with a >> java application via a serial port.  I have been using the commapi for >> several years and have not had a problem.  Recently, I have started a >> design modification that will replace the RS232 connection with a USB >> port.  I am using the ftdi module for prototyping and I discovered that >> their virtual com port driver was not compatible with the commapi that >> Sun released.  It turns out that it has problems with hardware flow >> control ( it works on incoming but not outgoing communications).  The >> way I figured this out was by experimenting with the SerialDemo that >> was included with the Sum commapi.  One nice thing about this example >> is it has the ability to set incoming and outgoing flow control >> independently.
>>
>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >> all instances of javax.comm with gnu.io and it compiled and runs >> without a hitch (except for the slow startup).
>>
>> I Paused the JBuilder IDE during this long pause and the last few >> entries in the stack trace are:
>>
>> testRead() : -1, gnu.io.RXTXCommDriver
>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>
>> This was all initiated by the following call in the programs init >> routine:
>>
>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>
>> After looking at this,  My guess is that Trent is correct in that the >> delay is in scanning for ports.  I guess one solution would be to not >> scan for ports, though it would be nice to detect what is available on >> the system.  Is there any way to reduce the number of ports scanned by >> this function in windows XP? 
>>
>> Thanks again for your time,
>>
>> Doug
>>
>>
>> >> >> >> --------------070808020900080005070500-- >> > > > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From yhua537 at cse.unsw.edu.au Tue May 30 18:10:23 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 31 May 2006 10:10:23 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CBC4B.2080206@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: Doug, In the SerialDemo, it allow us to save the parameters into a file, and use it when your program start up. Would this help? YiQi On Tue, 30 May 2006, Jim Redman wrote: > Lynn, > > If I understand your idea correctly, I don't think that this would work > well for, say, USB ports since these can be easily added/removed by the > end user. > > Jim > > lynn at swcp.com wrote: >> *IF* the name of the port is supplied, we might want to use the preferences >> mechanism (java.util.prefs) where we could have previously saved the info for >> the port. We could do a quick check to see that things have not changed >> before using it. If things have changed (or never been defined) we would do a >> full port scan and save detected ports in the preferences. >> >> This way if the hardware is not changed, you only pay the time penalty one time. >> >> just an idea... >> Lynn >> >> >> Doug Thistlethwaite said: >> >>> This is a multi-part message in MIME format. >>> --------------070808020900080005070500 >>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>> Content-Transfer-Encoding: 7bit >>> >>> Hello all, >>> >>> I also notice this pause (not as long however) when I call: >>> >>> CommPortIdentifier.getPortIdentifier(PortName); >>> >>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process. If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it. >>> >>> Thanks, >>> >>> Doug >>> >>> Doug Thistlethwaite wrote: >>> >>>> Trent, YiQi, and Jim: >>>> >>>> Thanks to all for the replies and information! I am just back from a >>>> long weekend and I am now trying to figure out what I was doing! :) >>>> >>>> As for more information. First off, this example is being run under >>>> windows XP. I am developing test equipment that communicates with a >>>> java application via a serial port. I have been using the commapi for >>>> several years and have not had a problem. Recently, I have started a >>>> design modification that will replace the RS232 connection with a USB >>>> port. I am using the ftdi module for prototyping and I discovered >>>> that their virtual com port driver was not compatible with the commapi >>>> that Sun released. It turns out that it has problems with hardware >>>> flow control ( it works on incoming but not outgoing communications). >>>> The way I figured this out was by experimenting with the SerialDemo >>>> that was included with the Sum commapi. One nice thing about this >>>> example is it has the ability to set incoming and outgoing flow >>>> control independently. >>>> >>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>> all instances of javax.comm with gnu.io and it compiled and runs >>>> without a hitch (except for the slow startup). >>>> >>>> I Paused the JBuilder IDE during this long pause and the last few >>>> entries in the stack trace are: >>>> >>>> testRead() : -1, gnu.io.RXTXCommDriver >>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>> >>>> This was all initiated by the following call in the programs init routine: >>>> >>>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>> >>>> After looking at this, My guess is that Trent is correct in that the >>>> delay is in scanning for ports. I guess one solution would be to not >>>> scan for ports, though it would be nice to detect what is available on >>>> the system. Is there any way to reduce the number of ports scanned by >>>> this function in windows XP? >>>> >>>> Thanks again for your time, >>>> >>>> Doug >>>> >>> --------------070808020900080005070500 >>> Content-Type: text/html; charset=ISO-8859-1 >>> Content-Transfer-Encoding: 7bit >>> >>> >>> >>> >>> >>> >>> >>> >>> Hello all,
>>>
>>> I also notice this pause (not as long however) when I call:
>>>
>>>         >>  CommPortIdentifier.getPortIdentifier(PortName);
>>>
>>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process.  If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it.
>>>
>>> Thanks,
>>>
>>> Doug
>>>
>>> Doug Thistlethwaite wrote: >>>
>>> >>> Trent, YiQi, and Jim:
>>>
>>> Thanks to all for the replies and information!  I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :)
>>>
>>> As for more information.  First off, this example is being run under >>> windows XP.  I am developing test equipment that communicates with a >>> java application via a serial port.  I have been using the commapi for >>> several years and have not had a problem.  Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port.  I am using the ftdi module for prototyping and I discovered that >>> their virtual com port driver was not compatible with the commapi that >>> Sun released.  It turns out that it has problems with hardware flow >>> control ( it works on incoming but not outgoing communications).  The >>> way I figured this out was by experimenting with the SerialDemo that >>> was included with the Sum commapi.  One nice thing about this example >>> is it has the ability to set incoming and outgoing flow control >>> independently.
>>>
>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup).
>>>
>>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are:
>>>
>>> testRead() : -1, gnu.io.RXTXCommDriver
>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>
>>> This was all initiated by the following call in the programs init >>> routine:
>>>
>>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>
>>> After looking at this,  My guess is that Trent is correct in that the >>> delay is in scanning for ports.  I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system.  Is there any way to reduce the number of ports scanned by >>> this function in windows XP? 
>>>
>>> Thanks again for your time,
>>>
>>> Doug
>>>
>>>
>>> >>> >>> >>> --------------070808020900080005070500-- >>> >> >> >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From halbleib at rechnerbetriebsgruppe.de Wed May 31 02:06:16 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 10:06:16 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp Message-ID: <447D4E78.30302@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, I getting an error while reloading my app in tomcat. At the first start everything runs well, but if i reload mit webapp by tomcat manager i get the following error. java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader Is there a possibility to unload the native library rxtxSerial.dll? thx for all help! regards tom -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 b8FT80HQ1xlbDLnRecDANCc= =heb1 -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 02:52:17 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 10:52:17 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D4E78.30302@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> Message-ID: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Hello Tom, To the best of my knowledge it is impossible to unload native libraries once loaded into the JVM. The exception you see stems from the fact, that Tomcat creates a new classloader when you "reload" the weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar is loaded from the session class loader. Try to add RXTXComm.jar to your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. Regards, Joachim On 31.05.2006, at 10:06, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 > b8FT80HQ1xlbDLnRecDANCc= > =heb1 > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From halbleib at rechnerbetriebsgruppe.de Wed May 31 03:28:35 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 11:28:35 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Message-ID: <447D61C3.1030807@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Joachim, I'm still not getting it. How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml-file? Perhaps web.xml? Regards, Tom Joachim Buechse schrieb: > Hello Tom, > > To the best of my knowledge it is impossible to unload native > libraries once loaded into the JVM. The exception you see stems from > the fact, that Tomcat creates a new classloader when you "reload" the > weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar > is loaded from the session class loader. Try to add RXTXComm.jar to > your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. > > Regards, > Joachim > > On 31.05.2006, at 10:06, Tom Halbleib wrote: > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL tzNy+/0iIUfkYYgt1+UT1ko= =pkpY -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 04:03:42 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 12:03:42 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D61C3.1030807@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> <447D61C3.1030807@rechnerbetriebsgruppe.de> Message-ID: -Xbootclasspath/a: is a start option to the java vm. Google is your friend in finding how to modfiy it and what it means: tomcat modifying bootclasspath Regards, Joachim On 31.05.2006, at 11:28, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Joachim, > > I'm still not getting it. > How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml- > file? > Perhaps web.xml? > > Regards, > Tom > > Joachim Buechse schrieb: >> Hello Tom, >> >> To the best of my knowledge it is impossible to unload native >> libraries once loaded into the JVM. The exception you see stems from >> the fact, that Tomcat creates a new classloader when you "reload" the >> weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar >> is loaded from the session class loader. Try to add RXTXComm.jar to >> your bootlclasspath (-Xbootclasspath/a:) and the problem should go >> away. >> >> Regards, >> Joachim >> >> On 31.05.2006, at 10:06, Tom Halbleib wrote: >> >> Hi all, >> >> I getting an error while reloading my app in tomcat. At the first >> start >> everything runs well, but if i reload mit webapp by tomcat manager >> i get >> the following error. >> >> java.lang.UnsatisfiedLinkError: Native Library >> C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in >> another classloader thrown while loading gnu.io.RXTXCommDriver >> Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: >> Native >> Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already >> loaded >> in another classloader >> >> >> Is there a possibility to unload the native library rxtxSerial.dll? >> >> thx for all help! >> >> regards >> >> tom > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL > tzNy+/0iIUfkYYgt1+UT1ko= > =pkpY > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From impakt01 at optusnet.com.au Wed May 31 06:55:42 2006 From: impakt01 at optusnet.com.au (Daren) Date: Wed, 31 May 2006 22:55:42 +1000 Subject: [Rxtx] (no subject) Message-ID: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/ade7ad37/attachment-0398.html From doug at dupreeinc.com Wed May 31 10:19:19 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 31 May 2006 09:19:19 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: <447DC207.3070702@dupreeinc.com> I am not sure what you are saying. The Save parameters menu option saves the current settings (baud, data bits, etc.). The long pause (~60 seconds) is when the application first starts (before loading the saved parameters). This does bring up a question, though I hate this type of kludge approach to getting this library to work... What exactly is a PortIdentifier? Is it always the same? If I stored the results from "CommPortIdentifier.getPortIdentifier(PortName);" in a file, could I use this the next time the program is executed? In this case I am using a virtual com port driver to connect to the device through a USB port. Doug YiQi Huang wrote: >Doug, > >In the SerialDemo, it allow us to save the parameters into a file, and use >it when your program start up. Would this help? > >YiQi > >On Tue, 30 May 2006, Jim Redman wrote: > > > >>Lynn, >> >>If I understand your idea correctly, I don't think that this would work >>well for, say, USB ports since these can be easily added/removed by the >>end user. >> >>Jim >> >>lynn at swcp.com wrote: >> >> >>>*IF* the name of the port is supplied, we might want to use the preferences >>>mechanism (java.util.prefs) where we could have previously saved the info for >>>the port. We could do a quick check to see that things have not changed >>>before using it. If things have changed (or never been defined) we would do a >>>full port scan and save detected ports in the preferences. >>> >>>This way if the hardware is not changed, you only pay the time penalty one time. >>> >>>just an idea... >>>Lynn >>> >>> >>>Doug Thistlethwaite said: >>> >>> >>> >>>>This is a multi-part message in MIME format. >>>>--------------070808020900080005070500 >>>>Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>>>Content-Transfer-Encoding: 7bit >>>> >>>>Hello all, >>>> >>>>I also notice this pause (not as long however) when I call: >>>> >>>> CommPortIdentifier.getPortIdentifier(PortName); >>>> >>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process. If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it. >>>> >>>>Thanks, >>>> >>>>Doug >>>> >>>>Doug Thistlethwaite wrote: >>>> >>>> >>>> >>>>>Trent, YiQi, and Jim: >>>>> >>>>>Thanks to all for the replies and information! I am just back from a >>>>>long weekend and I am now trying to figure out what I was doing! :) >>>>> >>>>>As for more information. First off, this example is being run under >>>>>windows XP. I am developing test equipment that communicates with a >>>>>java application via a serial port. I have been using the commapi for >>>>>several years and have not had a problem. Recently, I have started a >>>>>design modification that will replace the RS232 connection with a USB >>>>>port. I am using the ftdi module for prototyping and I discovered >>>>>that their virtual com port driver was not compatible with the commapi >>>>>that Sun released. It turns out that it has problems with hardware >>>>>flow control ( it works on incoming but not outgoing communications). >>>>>The way I figured this out was by experimenting with the SerialDemo >>>>>that was included with the Sum commapi. One nice thing about this >>>>>example is it has the ability to set incoming and outgoing flow >>>>>control independently. >>>>> >>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>>without a hitch (except for the slow startup). >>>>> >>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>>entries in the stack trace are: >>>>> >>>>>testRead() : -1, gnu.io.RXTXCommDriver >>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>>> >>>>>This was all initiated by the following call in the programs init routine: >>>>> >>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>>> >>>>>After looking at this, My guess is that Trent is correct in that the >>>>>delay is in scanning for ports. I guess one solution would be to not >>>>>scan for ports, though it would be nice to detect what is available on >>>>>the system. Is there any way to reduce the number of ports scanned by >>>>>this function in windows XP? >>>>> >>>>>Thanks again for your time, >>>>> >>>>>Doug >>>>> >>>>> >>>>> >>>>--------------070808020900080005070500 >>>>Content-Type: text/html; charset=ISO-8859-1 >>>>Content-Transfer-Encoding: 7bit >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>>Hello all,
>>>>
>>>>I also notice this pause (not as long however) when I call:
>>>>
>>>>        >>>> >>>> >>> CommPortIdentifier.getPortIdentifier(PortName);
>>> >>> >>>>
>>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process.  If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it.
>>>>
>>>>Thanks,
>>>>
>>>>Doug
>>>>
>>>>Doug Thistlethwaite wrote: >>>>
>>>> >>>>Trent, YiQi, and Jim:
>>>>
>>>>Thanks to all for the replies and information!  I am just back from a >>>>long weekend and I am now trying to figure out what I was doing! :)
>>>>
>>>>As for more information.  First off, this example is being run under >>>>windows XP.  I am developing test equipment that communicates with a >>>>java application via a serial port.  I have been using the commapi for >>>>several years and have not had a problem.  Recently, I have started a >>>>design modification that will replace the RS232 connection with a USB >>>>port.  I am using the ftdi module for prototyping and I discovered that >>>>their virtual com port driver was not compatible with the commapi that >>>>Sun released.  It turns out that it has problems with hardware flow >>>>control ( it works on incoming but not outgoing communications).  The >>>>way I figured this out was by experimenting with the SerialDemo that >>>>was included with the Sum commapi.  One nice thing about this example >>>>is it has the ability to set incoming and outgoing flow control >>>>independently.
>>>>
>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>without a hitch (except for the slow startup).
>>>>
>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>entries in the stack trace are:
>>>>
>>>>testRead() : -1, gnu.io.RXTXCommDriver
>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>>
>>>>This was all initiated by the following call in the programs init >>>>routine:
>>>>
>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>>
>>>>After looking at this,  My guess is that Trent is correct in that the >>>>delay is in scanning for ports.  I guess one solution would be to not >>>>scan for ports, though it would be nice to detect what is available on >>>>the system.  Is there any way to reduce the number of ports scanned by >>>>this function in windows XP? 
>>>>
>>>>Thanks again for your time,
>>>>
>>>>Doug
>>>>
>>>>
>>>> >>>> >>>> >>>>--------------070808020900080005070500-- >>>> >>>> >>>> >>> >>> >>> >>-- >>Jim Redman >>(505) 662 5156 x85 >>http://www.ergotech.com >>_______________________________________________ >>Rxtx mailing list >>Rxtx at qbang.org >>http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > >cheers >YiQi Huang >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/61d4d4c9/attachment-0397.html From impakt01 at optusnet.com.au Wed May 31 17:02:54 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 09:02:54 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Message-ID: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Hi all, I downloaded 2.1.7-pre16 and managed to build it and get it going. I made the changes as suggested by Peter Smith in an old post, by adding his code to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. Still not working, it opens the port at 9600 according to portmon.exe . Has anyone managed to get this going at a custom rate? Here is the post I'm referring to: http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 Thanks, Daren ________________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Daren Sent: Wednesday, 31 May 2006 10:56 PM To: rxtx at qbang.org Subject: [Rxtx] (no subject) Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren From tjarvi at qbang.org Wed May 31 21:44:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 May 2006 21:44:01 -0600 (MDT) Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> References: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Message-ID: On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org From impakt01 at optusnet.com.au Wed May 31 22:06:04 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 14:06:04 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: Message-ID: <200606010406.k51464X2010447@mail03.syd.optusnet.com.au> Trent, I have managed to successfully open the port at this speed using Realterm (available on sourceforge). From memory this uses DLPortIO. Using portmon.exe with realterm, even there it says that the port has opened at 1953. I changed termios.c:560 to dcb->BaudRate = 1953 ; and it still opens the port at 9600. Daren -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Thursday, 1 June 2006 1:44 PM To: RXTX Developers and Users Subject: Re: [Rxtx] custom baud rate win32 On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From smontgomery at mediaspansoftware.com Mon May 1 09:52:28 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 11:52:28 -0400 Subject: [Rxtx] RXTX, Java COMM and Windows Server 2003 on x64 experiences? Message-ID: Just wondering if anybody here has had to deploy RXTX or the javax.comm on Windows Server 2003 machines running on x64 (i.e. Xeon EM64T) and would like to relate how things went. From Sun's site, the Supported System Configurations pages give the options for that system: Java 5.0: - 32-bit Java 5.0 running on the OS in the 32-bit mode - 64-bit Java 5.0 running on the OS in the 64-bit native mode Java 1.4.2: - no options listed for EM64T processors, but potentially the standard 32-bit Java 1.4.2 could run on the OS in 32-bit mode? I guess the two main points of failure would be 1) the JVM itself and 2) the jni components. Make that three: there's gotta be hardware vendor driver support for the OS in the various modes, too. Guess I better go look at Keyspan's website... Thanks in advance for any info anyone might be able to provide. From smontgomery at mediaspansoftware.com Mon May 1 10:18:33 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 12:18:33 -0400 Subject: [Rxtx] Mailing list archive out of date? Message-ID: The mailing list archive at: http://mailman.qbang.org/pipermail/rxtx/ only shows emails through the end of March. Is there a new archive somewhere else? Didn't see anything mentioned on the wiki. From p.cain at phasefale.com.au Mon May 1 22:33:09 2006 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 02 May 2006 14:33:09 +1000 Subject: [Rxtx] RXTX and the Linux kernel. Message-ID: <4456E105.5080106@phasefale.com.au> Hi, First off the problem I am having isn't caused by RXTX itself but I'm hoping someone out there may have some knowledge that may help me. Background: I have an application monitoring a control system through a standard PC serial port which I talk to with rxtx-2.0.5. The application runs on RedHat7.3 kernel version 2.4.18 using Java 1.4. This configuration has been in use for several years and has proved to be stable. But it has become necessary for me to upgrade the OS but I'm running into problems with the serial communications. Its not that the comms don't work on the new OS (its never that simple) the comms work for a variable period of time (sometimes several hours) and then just stop, nothing on the data lines and control lines all indicate that data could flow. The new OS is Ubuntu 5.10 running kernel version 2.6.12. I have installed the OS and software on a PC and had it perform ok, then install the new OS and same software on the very same hardware and experienced the problems of them comms stopping. In the new OS I'm using Java5 to run the app but since I have experience the problem I reverted back to Java1.4 which didn't fix the problem. I've moved the app to a different system RedHat FC3 running 2.6.14 had experienced the problem. Not wanting to go through all the thing I have tried but I have established that it seems to be the 2.6 versions of the kernel that seem to be the problem and not an individual distribution of Linux. I should point out that I am using the same jar and library files for each java and OS combination. So I'm just wondering if anyone has had or heard of problems similar to these ? Or perhaps might know of what changed in the Linux serial driver (something I'm having a hard time establishing). I'm starting to run low on ideas of what to try so any help would be much appreciated. -- Peter Cain Senior Programmer Phasefale Pty Ltd From tjarvi at qbang.org Wed May 3 07:31:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 May 2006 07:31:00 -0600 (MDT) Subject: [Rxtx] Re: Concering ircomm and RXTX In-Reply-To: References: Message-ID: On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From legolas.w at gmail.com Wed May 3 08:46:23 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 19:16:23 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <4458C23F.2000003@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From legolas.w at gmail.com Wed May 3 13:10:57 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 23:40:57 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <44590041.80706@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From Lars.Hennig at wow-portal.com Thu May 4 00:39:15 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Thu, 4 May 2006 08:39:15 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: Message-ID: Hi, I could not find any solution. I therefore decided to to my own native implementation. Allthough it only supports the functions I need, it works pretty well now for me. I think the main problem there is the use of a wrong Windows API function and not setting an timeout. Regards, Lars Hennig W?rth Online World GmbH Tel. (0049)7181-258183 Mob. (0049)160-3522889 Fax. (0049)7940-153299 Lars.Hennig at wow-portal.com Gesendet von: rxtx-bounces at qbang.org 09.04.2006 10:42 Bitte antworten zu RXTX Developers and Users An d.herwald at dsh-elektronik.de, RXTX Developers and Users Kopie Thema Re: [Rxtx] USB Serialport - disconnection problems WV Proj./Teilpr.: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/7b39f374/attachment-0402.html From Pawan.Kharbanda at dot.state.co.us Thu May 4 11:00:58 2006 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Thu, 4 May 2006 11:00:58 -0600 Subject: [Rxtx] Dangling Lock Files Message-ID: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Hi, I have been using RXTX API's for the Serial Communication for quite some time now and for some of the devices we are opening and closing the connection every 2 minutes. This works great for few days and then suddenly I start seeing some "Port in Use Exception" and I see that the Lock files are still in the /var/lock folder after manually removing the lock files it works good for few hours and I see the same problem again. Can somebody explain me the scenarios why I am seeing the dangling Lock files? I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise Servers. Thanks Pawan Kharbanda -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/ba0e9261/attachment-0402.html From tjarvi at qbang.org Thu May 4 14:10:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:10:30 -0600 (MDT) Subject: [Rxtx] Dangling Lock Files In-Reply-To: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> References: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Message-ID: On Thu, 4 May 2006, Kharbanda, Pawan wrote: > Hi, > I have been using RXTX API's for the Serial Communication for quite > some time now and for some of the devices we are opening and closing the > connection every 2 minutes. This works great for few days and then > suddenly I start seeing some "Port in Use Exception" and I see that the > Lock files are still in the /var/lock folder after manually removing the > lock files it works good for few hours and I see the same problem again. > Can somebody explain me the scenarios why I am seeing the dangling Lock > files? > > I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise > Servers. Hi Pawan The next time it happens, look in the lockfile. There will be a pid. ps aux |grep 'pid' I think you will see that the application is still running for some reason. RXTX does a kill -0 on the pid to see if its alive. If not, it will remove the lockfile. So I suspect the previous program did not exit as you expected. -- Trent Jarvi tjarvi at qbang.org From Scott.Hughes at dalsemi.com Thu May 4 14:23:11 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 4 May 2006 15:23:11 -0500 Subject: [Rxtx] Wiki instructions... Message-ID: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire demo apps, when I stumbled across this tip on the wiki to add yourself to the uucp group: It may be simpler to just run usermod -G uucp jarvi Taken from: http://rxtx.qbang.org/wiki/index.php/Installation This does not work as advertised. I should have read the man page for usermod before I tried that out. If there are any groups which are not listed after the -G switch, the user is removed from those groups. On Ubuntu, this is bad... I removed myself from the Admin group, which removed my sudo priviledges. Ubuntu has no root account, so I've disabled the only account which could fix it. Anyone know of a good workaround? Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor From tjarvi at qbang.org Thu May 4 14:32:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:32:09 -0600 (MDT) Subject: [Rxtx] Wiki instructions... In-Reply-To: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> Message-ID: On Thu, 4 May 2006, Scott Hughes wrote: > I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire > demo apps, when I stumbled across this tip on the wiki to add yourself to > the uucp group: > > It may be simpler to just run > > usermod -G uucp jarvi > > Taken from: > http://rxtx.qbang.org/wiki/index.php/Installation > > This does not work as advertised. I should have read the man page for > usermod before I tried that out. If there are any groups which are not > listed after the -G switch, the user is removed from those groups. On > Ubuntu, this is bad... I removed myself from the Admin group, which removed > my sudo priviledges. Ubuntu has no root account, so I've disabled the only > account which could fix it. > > Anyone know of a good workaround? > Yikes This will get your permissions back: in grub/lilo/.. pass the following option to the kernel init=/bin/sh You are now root. when it boots, mount -o remount,rw / add yourself to the groups, reboot to get normal init going. Thats about all I can think of without sudo/root. -- Trent Jarvi tjarvi at qbang.org From Gettings at earth.utah.edu Thu May 4 14:41:22 2006 From: Gettings at earth.utah.edu (Paul Gettings) Date: Thu, 4 May 2006 14:41:22 -0600 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <20060504204122.GA6534@earth.utah.edu> When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get messages on stdout from the JVM: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 As the only change was the version of RXTX (from 2.1.6), I am unsure why the messages suddenly appeared. Anyone know how to get rid of them? Thanks. -- 101 USES FOR A DEAD MICROPROCESSOR (23) Dead cat brush From mmester at sps.edu Mon May 1 21:22:28 2006 From: mmester at sps.edu (Michael Mester) Date: Mon, 1 May 2006 23:22:28 -0400 Subject: [Rxtx] Windows PortInUseException Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> I'm trying to get simple serial communication going with RxTx under Windows XP. I can enumerate the ports fine, but I always run into problems when I try to open one. I get a PortInUseException, but the owner application is "Unknown" and the port is never open. I've tried this on several different systems and all of them give the same behavior. The only thing I can thiunk of that might be causing the problem is that fact that I had to put the serial .dll file in system32 instead of the reccommended folder, because it didn't work in the folder the documentation gives. The library loads fine, though, so I'm not sure whether that makes sense, and I don't know how to fix it anyway. Any help is greatly appreciated. Below is the output of the program, right up to the PortInUseException and the NullPointerException it causes (because the serial port object is not instantiated). C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI Starting GPSTalkerGUI... Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 gnu.io.PortInUseException: Unknown Application Exception in thread "main" java.lang.NullPointerException at GPSTalkerGUI.(GPSTalkerGUI.java:102) at GPSTalkerGUI.main(GPSTalkerGUI.java:161) Again, thank you very much for any help you can give. From lshellman at qwest.net Wed May 3 01:38:34 2006 From: lshellman at qwest.net (Lucious Shellman) Date: Wed, 03 May 2006 01:38:34 -0600 Subject: [Rxtx] Help needed: Project using parallel port Message-ID: <1146641914.8337.14.camel@localhost.localdomain> I was looking for a way to access the parallel port on a PC using Java. Searching the Internet, I came across this site (rxtx.org). What I am trying to do is detect logic levels from a TTL logic IC on the parallel port. I am not trying to do classic parallel port communication. I just want to detect whether a line(s) is (are) high or low. I am using Windows 98. Can rxtx be used to do this? If yes, is there a tutorial for using rxtx posted on the Internet that someone can direct me to. If you need more information, feel free to e-mail me. Unfortunately for me, I need the information ASAP. Thanks. lshellman at qwest.net From webmaster at egyhelp.com Wed May 3 18:43:39 2006 From: webmaster at egyhelp.com (Mohamed Samy) Date: Thu, 4 May 2006 02:43:39 +0200 Subject: [Rxtx] RE: Concering ircomm and RXTX In-Reply-To: Message-ID: <20060503184362.SM01044@Geek> Hey, I issue the command "modprobe ircomm-tty" yet no ttyircomm appears, while the ircomm appear by "modprobe ircomm" so forgive me but I am bit lost. Even searching google for the keyword "ttyircomm" only returns 3 matches. So any way I can start the ttyircomm???? Thanks a lot. -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Wednesday, May 03, 2006 3:31 PM To: Mohamed Samy; rxtx at qbang.org Cc: taj at www.linux.org.uk Subject: Re: Concering ircomm and RXTX On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 4 15:49:49 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 15:49:49 -0600 (MDT) Subject: [Rxtx] Windows PortInUseException In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> Message-ID: On Mon, 1 May 2006, Michael Mester wrote: > > I'm trying to get simple serial communication going with RxTx under > Windows XP. I can enumerate the ports fine, but I always run into > problems when I try to open one. I get a PortInUseException, but the > owner application is "Unknown" and the port is never open. I've tried > this on several different systems and all of them give the same > behavior. The only thing I can thiunk of that might be causing the > problem is that fact that I had to put the serial .dll file in system32 > instead of the reccommended folder, because it didn't work in the folder > the documentation gives. The library loads fine, though, so I'm not sure > whether that makes sense, and I don't know how to fix it anyway. Any > help is greatly appreciated. Below is the output of the program, right > up to the PortInUseException and the NullPointerException it causes > (because the serial port object is not instantiated). > > C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI > Starting GPSTalkerGUI... > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > gnu.io.PortInUseException: Unknown Application > Exception in thread "main" java.lang.NullPointerException > at GPSTalkerGUI.(GPSTalkerGUI.java:102) > at GPSTalkerGUI.main(GPSTalkerGUI.java:161) > Perhaps you are trying to open the port twice in your code? rxtx does open the ports, do a timed out read and then close the ports during enumeration. I think the port is being opened fine. The Unknown Application is always reported. On linux, there is some code that finds the actual application but on windows, its always unknown. If the port enumeration is returning the ports you expect, rxtx has opened the port and closed it with success. The port should open. There is also example code in the contrib directory that comes with rxtx source that has examples you can modify to work. -- Trent Jarvi tjarvi at qbang.org From Christian.Klemke at t-online.de Thu May 4 23:37:23 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Fri, 5 May 2006 07:37:23 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu> Message-ID: <004f01c67005$fc72fee0$016a10ac@NB600> Hi Paul, I was wondering about the same question some days ago and took a look at the source files. Unfortunately, I found that you can only get rid of that messages by altering and recompiling the Java code. There is a final static boolean variable called "devel" in the file "RXTXCommDriver.java" which is set to "true". This constellation causes the output after the native libraries have been loaded. No mechanism exists to suppress them otherwise :-(. Trent, does that mean that 2.1.7 is still officially a "development" version ? When will this value be changed to "false" by default ? With 2.1.8 ? It would be nice to provide a means to suppress such messages besides that static flag (maybe by setting a property called "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The output can indeed by annoying, especially when used with console applications, where the message potentially appears "in the middle" of your own output. Another possibility would be not to use System.out directly, but instead some PrintStream field which is initially set to System.out but can programatically be changed. That would allow for any kind of redirection or suppression by implementing appropriate user-defined PrintStream subclasses and making RXTX use that stream. What do you think ? Best regards, Christian ----- Original Message ----- From: "Paul Gettings" To: Sent: Thursday, May 04, 2006 10:41 PM Subject: [Rxtx] RXTX causing stdout messages > When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get > messages on stdout from the JVM: > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > As the only change was the version of RXTX (from 2.1.6), I am unsure > why the messages suddenly appeared. Anyone know how to get rid of > them? > > Thanks. > > -- > 101 USES FOR A DEAD MICROPROCESSOR > (23) Dead cat brush > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri May 5 06:09:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 06:09:46 -0600 (MDT) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <004f01c67005$fc72fee0$016a10ac@NB600> References: <20060504204122.GA6534@earth.utah.edu> <004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: On Fri, 5 May 2006, Christian Klemke wrote: > Hi Paul, > > I was wondering about the same question some days ago and took a look at the > source files. Unfortunately, I found that you can only get rid of that > messages by altering and recompiling the Java code. There is a final static > boolean variable called "devel" in the file "RXTXCommDriver.java" which is > set to "true". This constellation causes the output after the native > libraries have been loaded. No mechanism exists to suppress them otherwise > :-(. > > Trent, does that mean that 2.1.7 is still officially a "development" version > ? When will this value be changed to "false" by default ? With 2.1.8 ? It > would be nice to provide a means to suppress such messages besides that > static flag (maybe by setting a property called > "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The > output can indeed by annoying, especially when used with console > applications, where the message potentially appears "in the middle" of your > own output. Another possibility would be not to use System.out directly, but > instead some PrintStream field which is initially set to System.out but can > programatically be changed. That would allow for any kind of redirection or > suppression by implementing appropriate user-defined PrintStream subclasses > and making RXTX use that stream. What do you think ? > A patch for using properties would be accepted I'm sure. The reason the default is to display the message is not related to the development state of rxtx anymore. The problem is that people first using rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. The message prevents a great deal of email thats easily explained by the message. I question if we should support rxtx 2.0 at all anymore. If you post a patch in bugzilla, we'll put it into CVS this weekend. we'll be going through and doing such things anyhow. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri May 5 13:23:56 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 13:23:56 -0600 (MDT) Subject: [Rxtx] How to read from RxTx parallel port in Win XP In-Reply-To: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> References: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> Message-ID: On Thu, 27 Apr 2006, Worsley, Bob (Development Engineer) wrote: > I'm sorry if this is a dumb question, but I didn't find the answer in > the archives. > > I'm using the RxTx binaries for Windows on a reasonably current notebook > PC running Windows XP. I can send stuff to a printer on the parallel > port (LPT1), but I can't get anything back. > > I wrote a class that has the methods listed below. I write some data to > the printer with the "write" method and then try to read a response > using the "read" method, but I never get any data. I'd greatly > appreciate any help you can give! > > Bob Worsley > bobwoyid2 at yahoo.com > > > > > private ParallelPort parallelPort = null; > private RXTXCommDriver parallelPortDriver = null; > > > public boolean initialize() throws IOException { > if (parallelPort != null) { > return false; // Already initialized > } > > // Create the parallel port; > parallelPortDriver = new RXTXCommDriver(); > parallelPort = > (ParallelPort)parallelPortDriver.getCommPort(address, > CommPortIdentifier.PORT_PARALLEL); > > // Set the parallel port parameters. > try { > parallelPort.enableReceiveTimeout(READ_TIMEOUT); > parallelPort.disableReceiveFraming(); > parallelPort.disableReceiveThreshold(); > //parallelPort.setMode(mode); !!!!errors > } catch (UnsupportedCommOperationException e) { > throw (new IOException("Parallel port with address '" + > address > + "' cannot be configured as specified")); > } > > return true; > } > > > > public void write(final byte[] bytes) throws IOException { > initialize(); > while (busyReading) { > Thread.yield(); > } > busyWriting = true; > if (bytes.length < 1) { > return; > } > OutputStream outputStream = parallelPort.getOutputStream(); > outputStream.write(bytes); > outputStream.flush(); > outputStream.close(); > Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); > busyWriting = false; > } > > > public byte[] read() throws IOException { > > // Read up to MAX_BYTES bytes. > initialize(); > while (busyWriting) { > Thread.yield(); > } > busyReading = true; > byte[] buff = new byte[MAX_BYTES_READ]; > InputStream inputStream = parallelPort.getInputStream(); > // This read blocks until input data is available > int bytesRead = inputStream.read(buff); > inputStream.close(); > // If no data read, create empty array > if (bytesRead == -1) { > bytesRead = 0; > } > byte[] deviceBytes = new byte[bytesRead]; > System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); > if (bytesRead > 0) { > Debug.p("PPIOP.read - got data: '" + new > String(deviceBytes) + "'"); > } > busyReading = false; > return deviceBytes; > } > Hi Bob I've only used rxtx to test a hello world page printing but there are others that have used it. PPIOP? hmm what is this? :) The rxtx parallel support is behind the serial support but should be OK. As you note, the setting of modes is not supported. rxtx uses what is provided when the port is open. Are your asserting the pin for the printer being online? I suspect what often happens is people try to just use the data pins but the C API rxtx uses wants the printer to be online. There should be some posts relating to this in the rxtx mail-list archive. Some APIs are probably reading and writing from the port address (also suggested in your code as something you are looking at). RXTX currently uses a higher level C/C++ API for port access. This can still work if the API thinks the 'printer' is there. -- Trent Jarvi tjarvi at qbang.org From agrodellic at gmail.com Sat May 6 08:39:40 2006 From: agrodellic at gmail.com (Leigh Stewart) Date: Sat, 6 May 2006 10:39:40 -0400 Subject: [Rxtx] sun commapi 3 Message-ID: I think I read here: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html that rxtx-2.0 is basically fracked for now? Does anyone know of a workaround? ie can i somehow get an older version of sun's comm api and use that (not easy to find)? i mean 2.0 must be working for someone...how is it being tested. 2.1 isnt working for me....im getting nasty native exceptions etc, which is why im so set on 2.0... any ideas? From tjarvi at qbang.org Sun May 7 15:40:27 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 7 May 2006 15:40:27 -0600 (MDT) Subject: [Rxtx] sun commapi 3 In-Reply-To: References: Message-ID: On Sat, 6 May 2006, Leigh Stewart wrote: > > 2.1 isnt working for me....im getting nasty native exceptions etc, > which is why im so set on 2.0... any ideas? > Hi Leigh What native exceptions are you seeing? Which OS? The native code is almost identical between rxtx 2.0 and 2.1. Only the names have been changed to protect the inocent. :) ie: javax_comm_... vs gnu_io_... So the odds are very likely that even if you do find commapi 2.0 and get it installed, you will run into the same error. It would be better to just find and fix the problem. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Mon May 8 10:47:20 2006 From: mail at willicon.de (WILLICon) Date: Mon, 08 May 2006 18:47:20 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 Message-ID: <445F7618.3070303@willicon.de> Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/ef37e8ec/attachment-0402.html From tjarvi at qbang.org Mon May 8 16:14:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 May 2006 16:14:51 -0600 (MDT) Subject: [Rxtx] Screenshot of Application using RXTX (fwd) Message-ID: Just though someone may end up searching for 0x0D and 0x0A. Here are the details from his system. SuSE Linux 10.0 (x86_64) Kernel 2.6.13-15.8 j2se 1.4.2_11 (i586) Sun: comm3.0_u1 rxtx: rxtx-2.1-7 ---------- Forwarded message ---------- Date: Sat, 6 May 2006 20:01:46 +0200 From: Michael Poppitz To: taj at www.linux.org.uk Subject: Screenshot of Application using RXTX Hi Trent, the rxtx package works like a charm. Sun's package seemed to replace all 0x0D with 0x0A in received data on my Linux box, which is really annoying when transfering binary data. But rxtx came and saved the day - and turned out to be a lot more convenient as it does not require a configuration file. I use it for connecting to a home made logic analyzer. (http://www.sump.org/projects/analyzer/) Thanks for your great job, Michael -------------- next part -------------- A non-text attachment was scrubbed... Name: la_client.png Type: image/png Size: 16592 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/45494fbb/la_client-0402.png From tjarvi at qbang.org Tue May 9 14:56:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 May 2006 14:56:05 -0600 (MDT) Subject: [Rxtx] RXTX javax.comm: which one to install? In-Reply-To: <20060509161742.43547.qmail@web53814.mail.yahoo.com> References: <20060509161742.43547.qmail@web53814.mail.yahoo.com> Message-ID: On Tue, 9 May 2006, Adenilson Cavalcanti wrote: > Dear Trent Jarvi > > I'm trying to write a small Java app running in linux that interfaces with a device connected to serial port. > > I do have some questions about RXTX and javax.comm state of affairs, since I'm new to Java programming (used to program in plain old C writting to devices using termios and open/write/read syscalls, but this is another story). > > I ask you the favor to clarify this issues (if possible...): > > a) Sun offers to download a file (comm3.0_u1_PUTAUNIXVERSION.zip) which does contain .so files. Does it work out of box? > > b) Case negative, its there that we should use 'librxtx*.so' provided by your site? > > c) Sun's comm3 API version does work with which version of rxtx? > > I already searched google and read documentation available in rxtx site ("Java Comm Serial API How-to") but still have this issues unsolved. Any help will be appreciated. > > Best regards > > Adenilson Hi Adenilson, RXTX does not currently support javax.comm in Sun's CommAPI 3.0. I would recommend using package gnu.io provided by rxtx 2.1. -- Trent Jarvi tjarvi at qbang.org From chris.develder at intec.ugent.be Wed May 10 08:45:40 2006 From: chris.develder at intec.ugent.be (Chris Develder) Date: Wed, 10 May 2006 16:45:40 +0200 Subject: [Rxtx] rxtx troubles on ARM Message-ID: <4461FC94.6040909@intec.ugent.be> Hi all, Sorry to bother you, but I don't seem to get RXTX working on an ARM processor (xscale ixp 425, big endian). I managed to crosscompile the rxtx libs and moved it over to the ARM. Using jamvm (which is the only open source java VM we got working on the ARM), I get the following error result when running SimpleRead from Sun's javax.comm examples (commapi\examples\Simple\SimpleRead) -- see bottom of mail for complete output: "java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver" However, output shows that the RXTXCommDriver code is accessible (cf. debug and devel output of lib versions). So it doesn't seem to be a missing lib/jar issue. The error happens before RXTXCommDriver.initialize() is called, since the first line there is System.out.println("RXTXCommDriver:initialize()"); Any ideas? Cheers, Chris ---------------------------- [root at xxx(ttyp1) /work/cdvelder/xscale/test]# jamvm -Djava.library.path=/work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/jre/lib/arm -classpath /work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/lib/ext/RXTXcomm.jar:./comm.jar:. SimpleRead RXTXCommDriver {} Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTXCommDriver: Jar version = RXTX-2.1-7 native lib Version = RXTX-2.1-7 java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver gnu/io/RXTXCommDriver at javax.comm.CommPortIdentifier.loadDriver (CommPortIdentifier.java:239) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:109) at SimpleRead.main (Unknown Source) java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive (Native Method) at com.sun.comm.Portmapping.registerCommPorts (Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase (Portmapping.java:100) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:138) at SimpleRead.main (Unknown Source) From joachim at buechse.de Fri May 12 00:44:48 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 08:44:48 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) Message-ID: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Good day, I guess that only a selected few (hi Trent) will be able to answer this question, but the answer might be interesting for anyone trying to debug or understand the code. Apparently the MonitorThread is started and stopped in RXTXPort.addEventListener and RXTXPort.removeEventListener. This would indicate that (originally?) the MonitorThread is only required when there is an EventListener. However the MonitorThread is also started in the RXTXPort constructor, which could mean that RXTX won't work at all if it isn't there. It seems to me, that if anyone would add an event listener and later on remove it, he could potentially wreak the port. Because the second action would kill the MonitorThread. For the moment I am only trying to understand the role of and idea behind the MonitorThread. But of course there is a deeper reason thor my question: If the MonitorThread needs to exist anyway, it could be the thread that cleans up the port (ie calls nativeClose) - this would eliminate (a further) problem I am seeing with some USB drivers on Mac OSX. (Close blocks (after releasing the tty, but still) in the USB driver if the device is "not responding"). Greetings, Joachim From tjarvi at qbang.org Fri May 12 07:10:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 12 May 2006 07:10:59 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Fri, 12 May 2006, Joachim Buechse wrote: > Good day, > > I guess that only a selected few (hi Trent) will be able to answer > this question, but the answer might be interesting for anyone trying > to debug or understand the code. > > Apparently the MonitorThread is started and stopped in > RXTXPort.addEventListener and RXTXPort.removeEventListener. This > would indicate that (originally?) the MonitorThread is only required > when there is an EventListener. However the MonitorThread is also > started in the RXTXPort constructor, which could mean that RXTX won't > work at all if it isn't there. > > It seems to me, that if anyone would add an event listener and later > on remove it, he could potentially wreak the port. Because the second > action would kill the MonitorThread. > > > For the moment I am only trying to understand the role of and idea > behind the MonitorThread. But of course there is a deeper reason thor > my question: > > If the MonitorThread needs to exist anyway, it could be the thread > that cleans up the port (ie calls nativeClose) - this would eliminate > (a further) problem I am seeing with some USB drivers on Mac OSX. > (Close blocks (after releasing the tty, but still) in the USB driver > if the device is "not responding"). > Hi Jaochim Before commapi, rxtx did not support events. You could read, write and change port settings. The MonitorThread was added as an afterthought to support commapi events. So the way things are now his historical spaghetti not a well devised plan. It is my opinion that the MonitorThread should exist as long as the port is open. The odd starting of the thread in the constructor and addEventListener was just to get past the obvious problem of people using the port without adding listeners. -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Fri May 12 07:59:50 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 15:59:50 +0200 Subject: [Rxtx] MonitorThread -> ChangeRequest In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: <2B1E508C-8CEE-4AB7-914D-E7BA25C871A2@buechse.de> In this case I suggest removing the starting/stopping of MonitorThread in addEventListener / removeEventListener. This should not affect existing projects. On 12.05.2006, at 15:10, Trent Jarvi wrote: > It is my opinion that the MonitorThread should exist as long as the > port > is open. The odd starting of the thread in the constructor and > addEventListener was just to get past the obvious problem of people > using > the port without adding listeners. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Fri May 12 11:43:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 19:43:21 +0200 Subject: [Rxtx] Spring Cleaning - some suggestions Message-ID: The current implementation of RXTX contains quite a lot of code that will break if it is used from several threads (especially on a multi processor machine). I think it would be nice to clean this up. I suggest the following changes (which keep the current semantics and should not influence existing projects in a negative way): - InterruptedException will never be ignored or reset - read methods will be protected with a Monitor - write methods will be protected with a (separate) Monitor - close() sets the read and write monitors into a "closed" state which will lead to IOExceptions for any following call to RXTXPort.read/write. - close() will wait a finite amount of time (maybe 500ms) for the release of the read and write monitors after that, it will trigger the closing of the file descriptor to abort any pending read or write. - close() will not call close(file_desc). Instead it will "interrupt" (ie set a flag and then, pthread_kill(ABRT)) the MonitorThread, the MonitorThread will call close(file_desc). - the monitors are properly released in a finally block the try of which starts directly after obtaining the monitor. - finally will not call close(file_desc) it will only "interrupt" the MonitorThread (see above) - the native-code (esp read) does not use SA_RESTART but checks Thread.interrupted() when it receives a SIGNAL (ie system call returns with EINTR or other signalling method). The read/write monitors will be allocated from a factory whose mode can be set to fast/normal/advanced. In fast-mode it will create "non thread safe, non synchronized" pseudo-monitors. In default mode, the monitors will store the owning thread. In "advanced" mode setting the monitors into closed state will "interrupt()" threads which are blocked in a native read/write. {Reasoning close behaviour: Calling close on a file descriptor in Windows unblocks any read() or write() on the same file descriptor with an error. On Solaris < 2.7 and MacOS X however the close() will/ can block - until the read or write have finished:-(( Even the JDK people have trouble with this. I dont know how Linux reacts in this case. The best practice for BSD/Solaris is to send a signal to the thread which will usually unblock the read/write with an EINTR - this however is not guarenteed as it also depends on the device driver. So the only resolution that will certainly not block the thread calling RXTXPort.close() (which will often enough be the AWT event dispatcher or the VM finalizer thread) is to call close(fd) from another thread.} {Reasoning read behaviour: It is rather uncommon to receive a signal while reading or writing - it will happen, but checking Thread.interrupted() when it happens will not degrade performance. The checking of Thread.interrupted() can be handled by returning to Java and potententially reentering into the native code if the thread was not interrupted or by calling back into the VM from the native code. On top of this, many functions like read(byte[]) or read(byte [], int, int) are allowed to return less than the requested amount of data. Only int read() is a bit more tricky. } [Trent: From the code I can tell, that you experimented quite a bit with signals. Do you know if the Java Thread.interrupt() triggers a unix signal on Linux/Solaris? If so, which one?? References: - http://java.sun.com/docs/hotspot/VMOptions.html - http://www.hp.com/products1/unix/java/infolibrary/prog_guide/ signals.html ] On OS X (hotspot client jdk-1.4.2) I did not see any signal propagated to the SELECT of the event_loop/MonitorThread (ie no EINTR) when I call monThread.interrupt(). This is a pitty, but thats the way it is. I simply assume this is true for most system calls. How to handle this? Of course it would be possible to install/ deinstall a specific signal handler before/after every native read and to natively send an ABRT signal if RXTXPort.close is called. A more elegant solution might be to have an additional "signaling" socket which is always included in the SELECT. Or the simplest solution: cap the timeout of the select to 500 ms (the loop around it exists already) after every timeout check the Thread.interrupted() flag. From a performance perspective this should be completely invisible... On the other hand, all write() calls need to be preceeded by a SELECT as well, to avoid running into a blocking write. Best regards, Joachim From lyon at docjava.com Sat May 13 05:54:52 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 13 May 2006 07:54:52 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Dmitry suggests that we acquire an implementation of a serial port reference, use it, then release it (i.e., check it back in). Joachim says that making serial ports thread friendly might be a good idea. This is a good idea. The design pattern that is close to this idea is the "Object Pool Design Pattern". # Object Pool Manage the reuse of objects for a type of object that is expensive to create or only a limited number of a kind of object can be created. It has been described at: http://www.developer.com/java/ent/article.php/626171 and in Marks' book, Patterns in Java, Volume 1. However, the Object Pool is intended to pool objects so that each object is just like every other object. The intent of the Parametric Singleton is to enable others to access the same resource at the same time (as long as the same parameters were used in construction). It sounds like we need a NEW Design Pattern (Oh no, Doug is doing it again!). Yes friends, you got me on a role (roll) :) If you like design patterns, you can thank me later. If you don't like design patterns, blame Dmitry, it was his idea ;) And Dave, thanks for the feedback on Singleton abuse. It has led me to change the way I think about application contexts, which we will see, below. We need (drum roll please): The Parametric Object Pool Design Pattern (POP) By Douglas A. Lyon ABSTRACT The goal of the Parametric Singleton design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values, in a given context. In comparison, the goal of the POP design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values and that only one reference to the class is checked out at a time, in a given context. A context is a namespace for holding identifiers during execution. In Java, A context can be changed in any of several ways. For example, creation of a new class loader, the deserialization of an old POP or the creation of a new process all create a new namespace. The POP Design Pattern combines the Parametric Singleton Design Pattern with the check out mechanism of the Object Pool Design Pattern. This enables unique creation of instances of a class. These instances are cached in a table. When a clients asks for an instance with these parameters, the cache is checked. If the instance is not in the cache it is created. If the instance is available, the clients checks out the instance. A reference is left to the clients that checked out the instance. The POP has the role of creating objects uniquely, from parameters. It also has the role of keeping track of which clients has checked out a given object. This is just like a library keeping track of who borrowed a book. If a resource is left unavailable in a system, a deadlock can occur. Deadlock debugging is facilitated by mapping a resource to the clients that have checked it out. We apply our POP Design Pattern to the retrieval of serial ports. The goal of our system is to make sure that serial ports are checked out to only one client at a time, and that they be checked back in when the client is done. The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. Users are discouraged from calling this the Parametric Object Oriented Pool (POOP). Introduction The intent of the POP Design Pattern is to ensure that a class has only one instance for a given set of parameter values. It also provides a point of access that is global to a given context. The POP uses the Singleton Design Pattern to ensure that there is only one POP, in the given context. The POP DP is responsible for checking out a reference to a given instance, and keeping track of that instance. The instance is responsible for sharing that instance. POP requires that users of the DP implement an interface that enables a recall facility. Thus, if there is a contention for a consumed resource, the deadlock can be resolved in an orderly fashion. Motivation A system cannot tolerate multiple instances of some classes with identical parameters used by different instances at the same time. For example, you cannot have two instances use the same serial port, at the same time. You cannot have two instances that are trying to listen to the same socket connection. You cannot have two instances writing to the same file structure at the same time. Further, once a serial port is checked out by a client, it is assigned to the client. This is like the spin-lock service provided by the operating system, only in the application layer. Naturally, deadlock will occur if a resource is not released, therefore the client of the resource is tracked. Recalling a resource is required for the POP DP by virtue of the implementation of an interface. The policy on how to break a deadlock (by honoring the recall) is application specific. As the operating system is often thought of as the arbiter of consumed resources (i.e., tape drives, serial ports, etc.) we frequently leave it to an operating system implementation to resolve these contention issues. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on naming conventions (which are not well standardized). The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. The POP Design Pattern can take on the role of the peer method mapper that homogenizes the API for different operating environments. That is, it can wrapper the different locking mechanisms used in different operating systems. POP that is responsible for keeping track of the instances created and the client that has checked them out. The POP Design Pattern is implemented using the Singleton Design Pattern. In Java, the POP implementation is declared final, so that it cannot be subclassed. The class also has a private constructor, so that other classes cannot instance it. The new design pattern is called the POP design pattern and it provides a way to check out and create instances with given parameters. Applicability Use the POP Design Pattern when: 1. There must be exactly one instance of a class with the given parameters in a given context. 2. The instances must be accessible to clients from a well-known access point. 3. The instances are reusable. 4. Only one client can check out an instance at a time. Structure Insert UML diagram here. Participants The POP Clients that need instances 1. The POP defines an instance upon request from a client, if, and only if, the instance does not already exist. 2. The POP returns the instance to the client. 3. The POP is responsible for creating unique instances from given parameters. 4. The POP is responsible to recalling instances from clients. Collaborations Clients obtain a reference to a POP instance only through the singleton design pattern. If the POP instance is left in an improper state (e.g., the serial port was left open) it is NOT the role of the POP to close the IO port. However, the POP can be requested to get the instance released. Nor is it the role of the POP Design Pattern to open the port. That role is delegate to some other part of the system. Further, it is the role of the POP Design Pattern to check out resources. However, it is still possible to have, multiple threads that have multiple references to the same resource at the same time. Checkout and resource requests are MUTEX locked (i.e., synchronized). Consequences The POP Design Pattern has several benefits: 1. Controlled access to parametrically defined instances. Since the POP encapsulates its instances, there is some limited control over how and when clients access it. 2. Reduced name space. The POP pattern avoids global variables that store instances created from the same parameter. Implementation Here are implementation issues to consider when using the POP pattern: 1. Unique mapping of parameters. The POP pattern requires that there be a mean to isomorphically map the parameter space into the instance space and back again. 2. Ensure unique instances. The POP pattern makes unique instances from parameters, and it does so only once. 3. Cache instances for fast retrieval. The POP must be able to look up instances, given some set of parameters, and do so from some data structure. That is, there must be enough space to hold references to all the instances the program will need. Also, a mechanism is needed to look up and retrieve the instances quickly enough to satisfy the clients. Sample Code To be written....any volunteers? Thanks! - Doug >I don't think I get it > >On Mar 22, 2006, at 9:36 AM, David Garnier wrote: >>Using the singleton pattern in this case is >>just convenient for the programmer. Problems >>arises >>pretty quickly, especially if you attempt to unit-test your classes. > > >so you're saying that something isn't so good >because you can not test it in the convenient >way? >if that's true, I'm totally disagree >change your test, debug whatever, but if >software is efficient at runtime, works fine and >only problem is some unit test >(which is some kind of framework for testing) >then dump that unit test , dump that unit >framework and make something appropriate to the >software >you're testing > >so if Douglas want to use singletons, what's the problem? >and what do you mean by abusing of singleton usage? > >of course singleton doesn't prevent concurrent >access to the resource across the processes >unless >you're using some OS facility to prevent it, besides >singleton as it was introduced is relevant only >and only inside of the same process >otherwise it's not singleton it's something else >(let's say network singleton: so you have remote >invocation facility >and some factory method that return object created by that facility) > >I don't have any problem with using any kind of singletons. > Parametric Singleton idea (if I understand it >right) could be easily implemented in the >following way: >use a map >populate map with instances of some class and key is your parameter >(you can use lazy population too) > >if somebody ask the key check the value if it's null so resource is taken >if somebody returns the resource put it back to the map > >public synchronized static Object getSomeResource(Object parameter); >public synchronized static void returnResource(Object parameter); > >getSomeResource (inside of the same process) could return null in 2 cases >1. if somebody (from other thread for example) already took that resource >2. if OS API said that resource corresponded to >that parameter (serial port with parameter = 1 >(port #)) >is locked and unavailable; >I'm not sure that in case of serial ports we >even need those Parametric Singletons >(unless lock checking is a very expensive operation) >just ask the OS about availability of that >resource and if it's available give it away >and then OS will lock it and therefore in next >time somebody ask it just answer that resource >is locked >and return null > >for example system has 2 serial ports available >so I ask getResource("tty"); >or I ask getResource("Bluetooth-Modem"); > >and if OS is ok you can give tty or Bluetooth-Modem or both > >no need for any additional pattern I think > >back to the problem >mac os x doesn't recognize locking via files, so >it handles locking via some API >an instance of the singleton in each process >should recognize that resource is locked >(by using that API) that's all >we don't have to make things more complicate >then they are just because there is some nice >design pattern or nice unit test framework or whatever >keep things simple, make them work fast, don't introduce middle layers >unless you have really good reason to do so > >of course I could be entirely wrong, so sorry about that in advance > >thanks > > >Dmitry Markman > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx >Good day, > >I guess that only a selected few (hi Trent) will be able to answer? >this question, but the answer might be interesting for anyone trying? >to debug or understand the code. > >Apparently the MonitorThread is started and stopped in? >RXTXPort.addEventListener and RXTXPort.removeEventListener. This? >would indicate that (originally?) the MonitorThread is only required? >when there is an EventListener. However the MonitorThread is also? >started in the RXTXPort constructor, which could mean that RXTX won't? >work at all if it isn't there. > >It seems to me, that if anyone would add an event listener and later? >on remove it, he could potentially wreak the port. Because the second? >action would kill the MonitorThread. > > >For the moment I am only trying to understand the role of and idea? >behind the MonitorThread. But of course there is a deeper reason thor? >my question: > >If the MonitorThread needs to exist anyway, it could be the thread? >that cleans up the port (ie calls nativeClose) - this would eliminate? >(a further) problem I am seeing with some USB drivers on Mac OSX.? >(Close blocks (after releasing the tty, but still) in the USB driver? >if the device is "not responding"). > >Greetings, >Joachim > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Sat May 13 10:07:37 2006 From: joachim at buechse.de (Joachim Buechse) Date: Sat, 13 May 2006 18:07:37 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Douglas, Looking at the current code, leaves me with the feeling, that there is a lot to do. Defining an API that wraps javax.comm to provide what you describe is certainly possible, but I wonder how much benefit it will actually provide. Personally I think the API defined by javax.comm "request/lock" a port with: cp= new CommunicationPort(identifier) "release" a port with: cp.close(); works quite nice for 99% of the applications. In my experience, the most efficient and elegant implementation is to wrap a port/socket/.. into a business object which declares the remote operations that are possible. Ie "uploadFile", "waitForPrompt", "getSerialNumber", "sendContact", "executeCommand", etc Those methods are then either synchronized or guarded by a monitor. I do not see how your design pattern applied to the port resource would help implementing this. [details start, skip if you agree to the above] When I talked about "thread-safe" I didn't mean several independent "sessions" accessing the port concurrently. I think this is a very rare usage. I believe the most common use case for serial ports today is the control of an external device from a PC running a GUI based application. To implement a clean Swing/AWT-GUI one needs to pass any action that can block to a "worker" thread (else the GUI blocks, the application appears dead). While it is possible to use own prespawned thread that will accept Runnables which operate on the port, this is not very elegant. It is more common to spawn a new thread for every action triggered by the user. Additionally the ABORT of a running operation is often implemented via a port.close() delegated to a different thread. - During the lifetime of a port, it will usually be accessed from several different threads. Instance variables need to be set/read in synchronized regions to guarantee a correct operation based on the Java memory model. - Synchronizing the access is usually handled on the application level (synchronizing the reads/writes is usually useless from the applications view because it is not a transaction mechanism). [details end] I am very open to learn about other scenarios where your proposed design pattern applied to the port resource is beneficial to the application implementor. Best regards, Joachim On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > Dmitry suggests that we acquire an implementation of > a serial port reference, use it, then release it (i.e., check it > back in). > > Joachim says that making serial ports thread friendly might be a > good idea. > > This is a good idea. The design pattern that is close to this idea > is the "Object Pool Design Pattern". > # Object Pool From jredman at ergotech.com Sun May 14 14:28:24 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 14:28:24 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers Message-ID: <446792E8.4000506@ergotech.com> Does anyone know of any work to make RXTX work with Ethernet (telent) Terminal Servers? If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? We've used RXTX with upwards of 100 virtual COM ports on Windows and it works well. Linux is more problematic. It would be good to have an OS independent solution to accesses remote Ethernet serial ports. Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From legolas.w at gmail.com Sun May 14 14:26:34 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:56:34 +0430 Subject: [Rxtx] does any one have a working sample of RXTX and LPT port Message-ID: <4467927A.4000008@gmail.com> Hi Thank you for reading my post does any one has a working sample for RXTX and LPT port ? Thanks From legolas.w at gmail.com Sun May 14 14:27:29 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:57:29 +0430 Subject: [Rxtx] does RXTX support Trigerr on parallel port? Message-ID: <446792B1.4040905@gmail.com> Hi does RXTX support trigger on LPT port ? if so , how i can use it ? Thanks From tjarvi at qbang.org Sun May 14 17:40:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 17:40:59 -0600 (MDT) Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: <446792E8.4000506@ergotech.com> References: <446792E8.4000506@ergotech.com> Message-ID: On Sun, 14 May 2006, Jim Redman wrote: > Does anyone know of any work to make RXTX work with Ethernet (telent) > Terminal Servers? > > If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 > Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? > Hi Jim It appears the author of NVTCom has decided to release the library into the public domain. Integration with rxtx is possible but it would be best to contact the author and find out what his intent is. I would suggest contacting the author with a proposal of what you would like to do and take it from there. We could 'take' public domain software but its better to show respect to the authors and respect their wishes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:10:23 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:10:23 -0600 (MDT) Subject: [Rxtx] does any one have a working sample of RXTX and LPT port In-Reply-To: <4467927A.4000008@gmail.com> References: <4467927A.4000008@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > Thank you for reading my post > does any one has a working sample for RXTX and LPT port ? > Thanks Hi Legolas LPT port support in rxtx is spotty. That means some people have sent in patches for what they do and it works well for them. The original code was not very good. It may have been 3 hours work :/ To get started, Sun has some demo programs with their commapi. With rxtx 2.1 you can change their code from using javax.com to gnu.io and it -should- work. But if it does not you can post here and on bugzilla. There has been more interest lately off the list and maybe there will be enough community resources to get what you need going. If you do get a sample program together, we would gladly put it in the contrib directory so the next person can get things going faster. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:12:12 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:12:12 -0600 (MDT) Subject: [Rxtx] does RXTX support Trigerr on parallel port? In-Reply-To: <446792B1.4040905@gmail.com> References: <446792B1.4040905@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > does RXTX support trigger on LPT port ? > if so , how i can use it ? > Hi Legolas As mentioned in the previous post, rxtx parallel support is not very mature. But if you can point to something that describes the trigger feature, we can probably make sure its there and give a quick code example. -- Trent Jarvi tjarvi at qbang.org From jredman at ergotech.com Sun May 14 22:22:48 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 22:22:48 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: References: <446792E8.4000506@ergotech.com> Message-ID: <44680218.4080008@ergotech.com> Trent, Trent Jarvi wrote: > On Sun, 14 May 2006, Jim Redman wrote: > >> Does anyone know of any work to make RXTX work with Ethernet (telent) >> Terminal Servers? >> >> If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 >> Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? >> > > Hi Jim > > It appears the author of NVTCom has decided to release the library into > the public domain. Integration with rxtx is possible but it would be best > to contact the author and find out what his intent is. > > I would suggest contacting the author with a proposal of what you would > like to do and take it from there. We could 'take' public domain software > but its better to show respect to the authors and respect their wishes. > I sent Marco(?), the author of the library, a note before asking the list - I'll let you know the response. If anyone is already working on it, or has an interest and more time and energy than me, I'd hate to duplicate the efforts. If no one is, and no one objects, maybe I'll see what I can do. Jim > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From Christian.Klemke at t-online.de Mon May 15 02:23:06 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Mon, 15 May 2006 10:23:06 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu><004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: <008a01c677f8$cae18590$02fea8c0@NB600> Hi Trent, Hi Paul, I finally found some time to create a simple patch to enable the optional suppression of version output to the console. It is based on a new system property called "gnu.io.rxtx.NoVersionOutput" which can by set to "true" if necessary. I had some problems accessing CVS, therefore I downloaded the rxtx-2.1-7r2 source archive from ftp.qbang.org (which is linked on the rxtx.org download page) and worked with that release. Please find my proposed patch in the attachment ! Regards, Christian ----- Original Message ----- From: "Trent Jarvi" To: "RXTX Developers and Users" Cc: ""Paul Gettings"" Sent: Friday, May 05, 2006 2:09 PM Subject: Re: [Rxtx] RXTX causing stdout messages > On Fri, 5 May 2006, Christian Klemke wrote: > >> Hi Paul, >> >> I was wondering about the same question some days ago and took a look at >> the >> source files. Unfortunately, I found that you can only get rid of that >> messages by altering and recompiling the Java code. There is a final >> static >> boolean variable called "devel" in the file "RXTXCommDriver.java" which >> is >> set to "true". This constellation causes the output after the native >> libraries have been loaded. No mechanism exists to suppress them >> otherwise >> :-(. >> >> Trent, does that mean that 2.1.7 is still officially a "development" >> version >> ? When will this value be changed to "false" by default ? With 2.1.8 ? It >> would be nice to provide a means to suppress such messages besides that >> static flag (maybe by setting a property called >> "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The >> output can indeed by annoying, especially when used with console >> applications, where the message potentially appears "in the middle" of >> your >> own output. Another possibility would be not to use System.out directly, >> but >> instead some PrintStream field which is initially set to System.out but >> can >> programatically be changed. That would allow for any kind of redirection >> or >> suppression by implementing appropriate user-defined PrintStream >> subclasses >> and making RXTX use that stream. What do you think ? >> > > A patch for using properties would be accepted I'm sure. > > The reason the default is to display the message is not related to the > development state of rxtx anymore. The problem is that people first using > rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. > The message prevents a great deal of email thats easily explained by the > message. > > I question if we should support rxtx 2.0 at all anymore. > > If you post a patch in bugzilla, we'll put it into CVS this weekend. > we'll be going through and doing such things anyhow. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_version_output_patch.diff Type: application/octet-stream Size: 991 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060515/3173c2b6/rxtx_version_output_patch-0402.obj From lyon at docjava.com Mon May 15 06:06:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 May 2006 08:06:21 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Joachim makes several good points. Let me see if I can address some of them below: >Hello Douglas, > >Looking at the current code, leaves me with the feeling, that there? >is a lot to do. Yes! >Defining an API that wraps javax.comm to provide what? >you describe is certainly possible, but I wonder how much benefit it? >will actually provide. > >Personally I think the API defined by javax.comm > >"request/lock" a port with: > cp= new CommunicationPort(identifier) >"release" a port with: > cp.close(); > >works quite nice for 99% of the applications. I don't know what percentage of applications turn off locking, the way that I do in my version of the RXTX lib. I do know that this is not safe practice. I also know that it was motivated by the multi-platform nature of my code and that this was the only way I could make things work, at the time. Java does not appear to have a cross-platform standard for locking resources on various platforms. Each OS appears to have its own standard. The question of who breaks deadlocks and how this is done remains open, as this is not an easy question to resolve. Let me continue, below: > >In my experience, the most efficient and elegant implementation is to? >wrap a port/socket/.. into a business object which declares the? >remote operations that are possible. Ie "uploadFile",? >"waitForPrompt", "getSerialNumber", "sendContact", "executeCommand",? >etc Those methods are then either synchronized or guarded by a? >monitor. I do not see how your design pattern applied to the port? >resource would help implementing this. I have no problem with high-level wrappers that are application specific. That is a very good idea, but orthogonal with respect to the issue of deadlocks. More below: > >[details start, skip if you agree to the above] >When I talked about "thread-safe" I didn't mean several independent? >"sessions" accessing the port concurrently. I think this is a very? >rare usage. That is probably why turning locking off works so well! On the other hand, it is not safe and I shouldn't do it. >I believe the most common use case for serial ports today? >is the control of an external device from a PC running a GUI based? >application. To implement a clean Swing/AWT-GUI one needs to pass any? >action that can block to a "worker" thread (else the GUI blocks, the? >application appears dead). While it is possible to use own prespawned? >thread that will accept Runnables which operate on the port, this is? >not very elegant. It is more common to spawn a new thread for every? >action triggered by the user. Additionally the ABORT of a running? >operation is often implemented via a port.close() delegated to a? >different thread. Here lies the heart of serial port concern. An application opens a serial port and then dies. The application is restarted and finds the port locked. How do we clear the lock? Must the application's user reside in the UUCP group? Must installers of the serial port add users to the UUCP group? Should locking be handled at a high-level of abstraction in an operating system independent way? Should the implementation of the locking mechanism be translated into an API that is dependent on the OS convention? Suppose that we restrict the discussion to serial ports. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on inconsistent naming conventions. Hence my feeling that we need to mirror what is done in other API's; we need a locking toolkit that references peer methods, IMHO. >From the Java programming point of view, the locking API is portable across different platforms, but has, as its implementation, a native peer method that uses the conventions of the underlying OS. This enables portable resource locking (in theory!). Consider, for example: org.apache.commons.transaction.locking with: Interface LockManager at: http://jakarta.apache.org/commons/transaction/apidocs/org/apache/commons/transaction/locking/LockManager.html Or, more recently: java.util.concurrent.locks Interface Lock based on Doug Lea's code: http://kickjava.com/src/EDU/oswego/cs/dl/util/concurrent/ReadWriteLock.java.htm Should we incorporate a clean, portable design into serial port use, one that is consistent with current locking APIs? Basically, a comm port is a resource and resources are typically controlled by managers. Thus, I suggest that we make use of a CommPortManager to help control and centralize serial port usage. The question of how this is done remains open, IMHO, but using core API's like: java.util.concurrent.locks might not be amiss. High-level methods (getAllPorts, getAllSerialPorts, getAllParallelPorts, etc...) might be welcome additions. Basic questions like, "what if a port is in use?" remain open, hence my proposal for the new design pattern. Isn't it the CommPortManager's role to break the deadlock? Cheers! - Doug > >- During the lifetime of a port, it will usually be accessed from? >several different threads. Instance variables need to be set/read in? >synchronized regions to guarantee a correct operation based on the? >Java memory model. >- Synchronizing the access is usually handled on the application? >level (synchronizing the reads/writes is usually useless from the? >applications view because it is not a transaction mechanism). >[details end] > >I am very open to learn about other scenarios where your proposed? >design pattern applied to the port resource is beneficial to the? >application implementor. > >Best regards, >Joachim > >On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > >> Dmitry suggests that we acquire an implementation of >> a serial port reference, use it, then release it (i.e., check it? >> back in). >> > > Joachim says that making serial ports thread friendly might be a? >> good idea. >> >> This is a good idea. The design pattern that is close to this idea >> is the "Object Pool Design Pattern". >> # Object Pool > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Mon May 15 06:58:19 2006 From: joachim at buechse.de (Joachim Buechse) Date: Mon, 15 May 2006 14:58:19 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Doug, I agree fully, that locking of the system resource should be abstracted from the user (programmer). Currently this is already the case, but I agree it might be nice to extract the code into a separate class, which uses platform dependent providers to do its job. What I described in my email was not targeted at allocating the system resource, but at handling an already allocated system resource inside the framework. I agree that it may be possible to combine the two - however, I would suggest to do this in phase2. I can contribute a work over of RXTXPort.java which implements clean internal locking and proper close behavior (which I would call phase 1). I could do this this week. However I strongly believe that there is little sense in trying to do this as a series of patches. It will be closer to a rewrite than to a patch. I have already provided a number of suggested patches via Bugzilla, but this is quite inconvenient (for me). My working copy diverges more and more from the master and hence it gets more and more annoying to provide self contained patches. Best regards, Joachim From tjarvi at qbang.org Mon May 15 08:27:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 May 2006 08:27:51 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Mon, 15 May 2006, Joachim Buechse wrote: > Hello Doug, > > I agree fully, that locking of the system resource should be > abstracted from the user (programmer). Currently this is already the > case, but I agree it might be nice to extract the code into a > separate class, which uses platform dependent providers to do its job. > > What I described in my email was not targeted at allocating the > system resource, but at handling an already allocated system resource > inside the framework. I agree that it may be possible to combine the > two - however, I would suggest to do this in phase2. > > I can contribute a work over of RXTXPort.java which implements clean > internal locking and proper close behavior (which I would call phase > 1). I could do this this week. > > However I strongly believe that there is little sense in trying to do > this as a series of patches. It will be closer to a rewrite than to a > patch. I have already provided a number of suggested patches via > Bugzilla, but this is quite inconvenient (for me). My working copy > diverges more and more from the master and hence it gets more and > more annoying to provide self contained patches. > For methodical testing purposes (which does go on) the incremental patches are better. I'm lagging behind in bugzilla but thats soon to change (this week). It has just been rather chaotic up until now. I moved, purchased a house, and jumped into the fire of a feature freeze timeframe at a new job. btw, we see the Solaris close issues on 2.8 also. 9 and 10 are fine. I'll work towards making those test results public and allow others to run new rxtx code through them. We had the OK at one point but setting up the environment is involved. It isn't just a collection of java classes. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Tue May 16 02:01:47 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:01:47 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] Message-ID: <446986EB.209@willicon.de> Hi, any ideas for my problem? Hans -------- Original-Nachricht -------- Betreff: [Rxtx] Problem under Mac OSX 10.3.9 Datum: Mon, 08 May 2006 18:47:20 +0200 Von: WILLICon Antwort an: RXTX Developers and Users An: RXTX Developers and Users Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/b0741c2b/attachment-0402.html From joachim at buechse.de Tue May 16 02:15:08 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 10:15:08 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: Hello Hans, I am using RXTX on OS X for my own project. I do not see the problem you describe. I had some troubles installing it because the current version uses lock files which is non-standard on OS X. I have created a patched version which I currently use. This version does not need to modify user groups and hence does not need an installer. I just pop it in the application directory. If you send me a link where I can download your OSX installer, I will have a quick look. Regards, Joachim On 16.05.2006, at 10:01, WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we > have some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + > spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + > spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always > the value "false". > I can only get the status, while I open the port and catch the > exception. > > Any ideas? > > Hans > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail at willicon.de Tue May 16 02:26:53 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:26:53 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: References: <446986EB.209@willicon.de> Message-ID: <44698CCD.7050709@willicon.de> Joachim, tanks for the answer. I'll send You a mail. Hans Joachim Buechse schrieb: > Hello Hans, > > I am using RXTX on OS X for my own project. I do not see the problem > you describe. > > I had some troubles installing it because the current version uses > lock files which is non-standard on OS X. I have created a patched > version which I currently use. This version does not need to modify > user groups and hence does not need an installer. I just pop it in > the application directory. If you send me a link where I can download > your OSX installer, I will have a quick look. > > Regards, > Joachim > > On 16.05.2006, at 10:01, WILLICon wrote: > > >> Hi, >> >> any ideas for my problem? >> >> Hans >> >> -------- Original-Nachricht -------- >> Betreff: [Rxtx] Problem under Mac OSX 10.3.9 >> Datum: Mon, 08 May 2006 18:47:20 +0200 >> Von: WILLICon >> Antwort an: RXTX Developers and Users >> An: RXTX Developers and Users >> >> >> Hi, >> >> I use for RXTX for communicate with CyclingComputers. >> >> It works good under Win32, Sloaris and Linux but with Mac OSX we >> have some problems. >> >> My users install the Mac OSX serial lib from the actual binary. >> >> After starting the program, they get this error message: >> >> java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while >> loading gnu.io.RXTXCommDriver >> >> Remember, this error comes only under Mac OSX. >> >> That is the code for the error: >> >> Enumeration portList = CommPortIdentifier.getPortIdentifiers(); >> spInUse = getBundleStr("serialPortInUse"); >> spFree = getBundleStr("serialPortFree"); >> while (portList.hasMoreElements()) { >> CommPortIdentifier portId = (CommPortIdentifier) >> portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (osName != null && osName.startsWith("mac")) { >> if (!portId.getName().startsWith("dev/cu.")) { >> continue; >> } >> } >> if (portId.isCurrentlyOwned()) { >> serialPortNames.add(portId.getName() + " - " + >> spInUse); >> } >> else { >> serialPortNames.add(portId.getName() + " - " + >> spFree); >> } >> } >> } >> if (serialPortNames.size() == 0) { >> serialPortNames.add(getBundleStr("serialPortNotFound")); >> } >> >> BTW: The methode isCurrentlyOwned() is not working. I get always >> the value "false". >> I can only get the status, while I open the port and catch the >> exception. >> >> Any ideas? >> >> Hans >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/948333be/attachment-0402.html From jredman at ergotech.com Tue May 16 07:35:52 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 16 May 2006 07:35:52 -0600 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: <4469D538.6070408@ergotech.com> Hans, I have no direct insight, but would note that what you have is a "NoClassDefFoundError" not a "ClassNotFoundException". So the class javax/comm/CommDriver is found, but one of its dependencies is missing. NoClassDefFoundError are a bigger problem to resolve because you get no indication of the real problem. Jim WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we have > some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > * spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always the > value "false". > I can only get the status, while I open the port and catch the exception. > > Any ideas? > > Hans > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.de Tue May 16 08:01:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 16:01:21 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 In-Reply-To: <4469AFC3.6000002@willicon.de> References: <44698EBC.8000008@willicon.de> <8C5680C4-E2BA-42FF-B221-36E1124FA6A4@buechse.de> <4469AFC3.6000002@willicon.de> Message-ID: <9825A602-D6ED-4C28-BF33-9A7C984FACD5@buechse.de> Hallo Hans, you include RXTX 2.17 in your "bikeXexperience.jar" (2.17 uses Interfaces from gnu.io.* not javax.comm.*). Now inspect your error log closely: The class gnu.io.RXTXCommDriver tries to load javax.comm.CommDriver: this is only the case for RXTX 2.07. I assume, that the user has installed Version 2.07 into one of the java.ext.dirs . The VM always tries to load classes from the "system" path first. The current Mac installer distributed with RXTX in fact installs RXTXcomm.jar and librxtxSerial.jnilib into /Library/Java/Extensions. (I wrote some time ago that I consider this as a bad idea because of potential version conflicts-> thanks for delivering the example). For 2.07 it does so without installing the javax.comm classes it seems. I would recommend that you instruct your users to install version 2.17 only. Until RXTX is changed to use TIOCEXCL instead of lock files, you can hardly avoid the installer, as the user needs to be added to a special group and a lockfile directory needs be created. More precisely you are waiting for: http://bugzilla.qbang.org/show_bug.cgi?id=50 [RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL)] Regards, Joachim -------------- next part -------------- A non-text attachment was scrubbed... Name: log.tiff Type: image/tiff Size: 38394 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/e3e52128/log-0402.tiff -------------- next part -------------- > > Ich verwende RXTX 2.17. Das orginal RXTXcomm.jar ist in > CyclingDataManager.jar enthalten. > From tjarvi at qbang.org Wed May 17 23:18:15 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 May 2006 23:18:15 -0600 (MDT) Subject: [Rxtx] update Message-ID: So we have several patches and these have stacked up. I'd like to thank everyone for being patient. Tests for the most intrusive patches look good so far. I still have to get some bits together on my end but it looks like we can catch everything up in CVS this week. I'll try to post a normal list of what went in by whom with links Saturday. But I'm not seeing anything that raises flags yet. I also think I'll be able to submit a patch for nonstandard baud rates. I have to confirm w32 but I think its going to be a one line fix. I don't know if its bugzilla or people tinkering with patch files before submitting but patches are not applying cleanly. So the patches have to be done by hand. This may make things difficult for people hoping to add other patches on top. I'm trying to make that go well but ... -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Thu May 18 02:23:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 May 2006 10:23:47 +0200 Subject: [Rxtx] update In-Reply-To: References: Message-ID: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Hello Trent, in fact I tinkered with the patches (never used this mechanism before, usually I "communicate" via cvs) ... so sorry for any trouble you had applying them. Basicly I edited the patches to make them self contained. Having the tests run with different speeds on different platforms, may well be an effect of caching. I have seen quite interesting propagation delays for the closing flag on my PowerPC system, which makes me doubt, that the propagation of output_buffer_empty_flag works as it should. Maybe the communication mechanism between the two threads should be replaced by something like pthread_cond_*. Could you describe which problems you see on Solaris/SPARC? I'd be interested to see if they exist on OS X (PowerPC) as well... As you seem to work on the stuff at the moment I would like to suggest the following additions (it looks more than it is, I posted some context to make clear where to apply the change). See the comments in braces for what was changed Greetings, Joachim (1) The end of the drain loop could be: --- report("drain_loop: received EINTR in tcdrain\n"); --- (added "in tcdrain" to make debug output clearer) (2) The start of the drain loop should be: --- for(i=0;;i++) { report_verbose("drain_loop: looping\n"); #if defined(__sun__) /* FIXME: No time to test on all OS's for production */ if( eis->eventloop_interrupted ) { goto end; } if (usleep(5000)) { report("drain_loop: received EINTR"); } #else if (usleep(1000000)) { report("drain_loop: received EINTR"); } #endif /* __sun__ */ --- (added a check for "eis->eventloop_interrupted" before the sleep) (3) The end of interrupt_event_loop could (and maybe should) be: --- #if !defined(TIOCSERGETLSR) && !defined(WIN32) /* make sure that the drainloop unblocks from tcdrain */ pthread_kill(index->drain_tid, SIGABRT); /* TODO use wait/join/SIGCHLD/?? instead of sleep? */ usleep(50 * 1000); /* Under normal conditions, SIGABRT will unblock tcdrain. However a non-responding USB device combined with an unclean driver may still block. This is very ugly because it may block the call to close indefinetly. */ if (index->closing != 1) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); index->closing = 1; } #endif report("interruptEventLoop: interrupted\n"); --- (added some comments and pthread_cancel for resisting drain thread) On 18.05.2006, at 07:18, Trent Jarvi wrote: > > So we have several patches and these have stacked up. I'd like to > thank > everyone for being patient. > > Tests for the most intrusive patches look good so far. I still > have to > get some bits together on my end but it looks like we can catch > everything > up in CVS this week. > > I'll try to post a normal list of what went in by whom with links > Saturday. But I'm not seeing anything that raises flags yet. I also > think I'll be able to submit a patch for nonstandard baud rates. > I have > to confirm w32 but I think its going to be a one line fix. > > I don't know if its bugzilla or people tinkering with patch files > before > submitting but patches are not applying cleanly. So the patches > have to > be done by hand. This may make things difficult for people hoping > to add > other patches on top. I'm trying to make that go well but ... > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu May 18 22:28:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 18 May 2006 22:28:00 -0600 (MDT) Subject: [Rxtx] update In-Reply-To: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> References: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Message-ID: On Thu, 18 May 2006, Joachim Buechse wrote: > Hello Trent, > > in fact I tinkered with the patches (never used this mechanism > before, usually I "communicate" via cvs) ... so sorry for any trouble > you had applying them. Basicly I edited the patches to make them self > contained. I think we are close to moving towards that. > > Having the tests run with different speeds on different platforms, > may well be an effect of caching. I have seen quite interesting > propagation delays for the closing flag on my PowerPC system, which > makes me doubt, that the propagation of output_buffer_empty_flag > works as it should. Maybe the communication mechanism between the two > threads should be replaced by something like pthread_cond_*. Could > you describe which problems you see on Solaris/SPARC? I'd be > interested to see if they exist on OS X (PowerPC) as well... This is interesting. I have seen problems with output buffer empty in applications that require it. I'm trying to get a bug list and or test results open for everyone to see but that may take time. But missed output buffer events ... yep. With Sparc, we have seen a few things. One was a kernel race condition that went away when we reimaged and updated 2.8. RXTX was hanging on close, top showed no cpu use but there was 2 second delays just typing on console. The other is our tests now take ~4 times longer on Solaris. Someone is looking at timing just open, close, read, write, ... to see if they can find where the slowdown is. This happened after solaris 2.8. I'll try to share more when/if there is something interesting. This may well not be solvable in userland. > > As you seem to work on the stuff at the moment I would like to > suggest the following additions (it looks more than it is, I posted > some context to make clear where to apply the change). See the > comments in braces for what was changed I'll take a look. This could all come together Saturday but I also have an event to attend that day. I may not wrap this up until Sunday. -- Trent Jarvi tjarvi at qbang.org From andrewlord at internode.on.net Sun May 21 20:10:02 2006 From: andrewlord at internode.on.net (Andrew Lord) Date: Mon, 22 May 2006 11:40:02 +0930 Subject: [Rxtx] Kernel include files do not match kernel Message-ID: <200605221140.03271.andrewlord@internode.on.net> Hi, I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel 2.6.12-18 with the command: ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include However I get the message: ## checking java.version 1.5.0_06 ## checking os.version 2.6.12-18mdk ## ## WARNING: Kernel include files do not match the current kernel ## ## configure: creating ./config.status etc. Is there a problem with the way I'm specifying the 'include' directory ? If not, how else can I specify the correct directory for the include files please ? Cheers, Andrew From tjarvi at qbang.org Sun May 21 20:31:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 May 2006 20:31:31 -0600 (MDT) Subject: [Rxtx] Kernel include files do not match kernel In-Reply-To: <200605221140.03271.andrewlord@internode.on.net> References: <200605221140.03271.andrewlord@internode.on.net> Message-ID: On Mon, 22 May 2006, Andrew Lord wrote: > Hi, > > I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel > 2.6.12-18 with the command: > > ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk > CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include > > However I get the message: > > ## checking java.version 1.5.0_06 > ## checking os.version 2.6.12-18mdk > ## > ## WARNING: Kernel include files do not match the current kernel > ## > ## configure: creating ./config.status > etc. > > Is there a problem with the way I'm specifying the 'include' directory ? If > not, how else can I specify the correct directory for the include files > please ? > Hi Andrew I'm fairly sure your --with-kernel option does nothing. The CPPFLAGS should do what you want. Maybe put an #error message in /usr/src/linux.../incude/linux/version.h But I don't recall a recent problem with version missmatches. It should work. Distros will even ship include files that don't match versions exactly. In theory it should never matter for users. I used to compile new kernels by hand and really didnt have a distro. I didnt have a seperate package of kernel headers for users (myself). When changing a gateway from linux 1.2.12 to 2.1.77, I would worry about such messages. So if you are doing something that weird, the message may be of use to you. If you just see the message on a distro you installed, it is more than likely harmless. -- Trent Jarvi tjarvi at qbang.org From mrogers at spro.net Mon May 22 14:45:39 2006 From: mrogers at spro.net (Mike Rogers) Date: Mon, 22 May 2006 14:45:39 -0600 Subject: [Rxtx] Sun's CommAPI -- think May? Message-ID: <447222F3.9040302@spro.net> Hi, Any word from Sun about progress towards fixing the Java CommAPI v3 "incompatibilities" so RXTX 2.0 can operate within the framework's namespace (javax.comm)? I recall mention of a May time frame. Thanks, Mike From paul.klissner at sun.com Mon May 22 15:09:27 2006 From: paul.klissner at sun.com (Paul Klissner) Date: Mon, 22 May 2006 14:09:27 -0700 Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <447222F3.9040302@spro.net> References: <447222F3.9040302@spro.net> Message-ID: <44722887.8080308@sun.com> Mike Rogers wrote: > Hi, > > Any word from Sun about progress towards fixing the Java CommAPI v3 > "incompatibilities" so RXTX 2.0 can operate within the framework's > namespace (javax.comm)? I recall mention of a May time frame. > > Thanks, > > Mike > We've had a lot of work come in. This hasn't been the only priority. I'm running behind the plan in addressing this, but will be looking at it again soon. Rather than state a new, I'll just say it is in progress, and not off the table. I'll get this fixed as soon as I can. Good timing for asking as we just started discussing javax.comm plans today, and I'll have some cycles to work on it soon. Paul From yhua537 at cse.unsw.edu.au Mon May 22 16:03:05 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Tue, 23 May 2006 08:03:05 +1000 (EST) Subject: [Rxtx] install rxtx in XP Message-ID: Hi Guys, I am new to serial port programming, and have no experience on programming java in xp, but my project require me to builld a communication link between xp and a UART device. Most of the information in the web site seems for linux only. including the commands such as export and chmod. How do I install rxtx in xp? cheers YiQi Huang From mark at mdsh.com Tue May 23 01:24:20 2006 From: mark at mdsh.com (Mark Himsley) Date: Tue, 23 May 2006 08:24:20 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off , it includes DLLs for Windows and the JAR for Java. Follow the Windows instructions in the INSTALL. ie RXTXcomm.jar goes in \jre\lib\ext (under java) rxtxSerial.dll goes in \jre\bin So, assuming a fairly standard Java install, copy RXTXcomm.jar into C:\Program Files\Java\jre1.5.0_06\lib\ext and copy rxtxSerial.dll into C:\Program Files\Java\jre1.5.0_06\bin Yes, it really is that simple. On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > I am new to serial port programming, and have no experience on > programming java in xp, but my project require me to builld a > communication link between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang -- Mark Himsley From joachim at buechse.de Tue May 23 02:51:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 23 May 2006 10:51:47 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) Unless it is absolutely required you should NOT install RXTX in your global Java Runtime Environment. This will for sure create versioning conflicts - if not now, than in the future, if not on your system than at your clients. Instead put the dll in your application directory and include the RXTXcomm.jar in your classpath. This is much safer and not a bit more complicated. Regards, Joachim On 23.05.2006, at 09:24, Mark Himsley wrote: > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR > for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > >> I am new to serial port programming, and have no experience on >> programming java in xp, but my project require me to builld a >> communication link between xp and a UART device. >> >> Most of the information in the web site seems for linux only. >> including >> the commands such as export and chmod. How do I install rxtx in xp? >> >> cheers >> YiQi Huang > > > > -- > Mark Himsley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tod at todbot.com Tue May 23 03:12:22 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 02:12:22 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I totally agree: do not contaminate the Java installation. I put all the RXTX files in a directory and then change my java invocation to be: % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* Alternatively, use Launch4J to create a double-clickable application and keep the RXTX libraries in the directory of the application. -=tod On May 23, 2006, at 1:51 AM, Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > >> Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off >> , it includes DLLs for Windows and the JAR >> for Java. >> >> Follow the Windows instructions in the INSTALL. >> >> ie >> >> RXTXcomm.jar goes in \jre\lib\ext (under java) >> rxtxSerial.dll goes in \jre\bin >> >> So, assuming a fairly standard Java install, copy RXTXcomm.jar into >> C:\Program Files\Java\jre1.5.0_06\lib\ext >> and copy rxtxSerial.dll into >> C:\Program Files\Java\jre1.5.0_06\bin >> >> Yes, it really is that simple. >> >> >> >> On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: >> >>> I am new to serial port programming, and have no experience on >>> programming java in xp, but my project require me to builld a >>> communication link between xp and a UART device. >>> >>> Most of the information in the web site seems for linux only. >>> including >>> the commands such as export and chmod. How do I install rxtx in xp? >>> >>> cheers >>> YiQi Huang >> >> >> >> -- >> Mark Himsley >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From smontgomery at mediaspansoftware.com Tue May 23 08:46:53 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Tue, 23 May 2006 10:46:53 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: Message-ID: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Joachim and Tod mentioned how to keep the files RXTX requires on Windows XP out of the Java installations - thanks gentlemen! Are there similar suggestions for an RXTX install on OS X? The current "canonical" OS X installation instructions "contaminate the Java installation", to use Tod's words. Our app will run fine under 1.4.2 and 5.0 on OS X, and a lot of users will have both. We've already been burned by the recent switch from 1.4.2 to 5.0 as the platform default. Any suggestions welcomed. From tod at todbot.com Tue May 23 13:27:55 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 12:27:55 -0700 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <9BA0F670-A862-42E7-BB2C-130D775ABDF9@todbot.com> Hi Sean, It depends on how you build and deploy your code. If you're using shell scripts, you can do something like this: #!/bin/sh # pick one JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/ Commands/java #JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/ Commands/java $JAVA -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* That both picks which VM to use and uses the RXTX in the directory called 'rxtxlib'. If you want your shell script to be clever, you could test for the existence of the different 'java' executables and go from there (maybe even use different jar files). I am almost positive all OS X systems with Java 1.5 are guaranteed to also have Java 1.4.2. If you're using Jar Builder or XCode, you can specify which JVM to use and add the extra args in the Info.plist file. The paths specified in the 'java' invocation then are based off of the $JAVAROOT variable that the JavaApplicationStub sets for you. For my app, I've have been compiling two sets of jars, one compiled with 1.4.2 and one with 1.5, but they both run under 1.5. So I have a similar shell script that chooses a different 'javac' depending on the need. -=tod On May 23, 2006, at 7:46 AM, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From yhua537 at cse.unsw.edu.au Tue May 23 11:09:37 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 03:09:37 +1000 (EST) Subject: [Rxtx] install rxtx in XP (Mark Himsley, Joachim Buechse, Tod E. Kurt> In-Reply-To: References: Message-ID: > Message: 8 > Date: Tue, 23 May 2006 08:03:05 +1000 (EST) > From: YiQi Huang > Subject: [Rxtx] install rxtx in XP > To: rxtx at qbang.org > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > Hi Guys, > > I am new to serial port programming, and have no experience on programming > java in xp, but my project require me to builld a communication link > between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang > > > ------------------------------ > > Message: 9 > Date: Tue, 23 May 2006 08:24:20 +0100 > From: Mark Himsley > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=us-ascii; format=flowed > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > ------------------------------ > > Message: 10 > Date: Tue, 23 May 2006 10:51:47 +0200 > From: Joachim Buechse > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > > ------------------------------ > > Message: 11 > Date: Tue, 23 May 2006 02:12:22 -0700 > From: "Tod E. Kurt" > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I totally agree: do not contaminate the Java installation. > > I put all the RXTX files in a directory and then change my java > invocation to be: > > % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* > > Alternatively, use Launch4J to create a double-clickable application > and keep the RXTX libraries in the directory of the application. > > -=tod > > Hi, Thanks guys, I don't know if this is the correct way to reply your mecessage, if wrong, please point out. Thank you for Mark to give the detail instructions and Joachim to point out the cons ot installing in the java directory, and specially thanks for Tod to give the instrection in detail. Sorry to ask another stupid question: I have followed Tod's instruction. Now I think i am ready to start hacking. But where is the RXTX API documentation? Is it the same as using normal java comm API? btw, where could i find some examples to start with? Thanks very much cheers YiQi Huang From tjarvi at qbang.org Tue May 23 16:09:32 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 May 2006 16:09:32 -0600 (MDT) Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <44722887.8080308@sun.com> References: <447222F3.9040302@spro.net> <44722887.8080308@sun.com> Message-ID: > Good timing for asking as we just started discussing javax.comm plans > today, and I'll have some cycles to work on it soon. Hi Paul I assume you mean Sun is discussing plans concerning its own internal actions and there is no community involvment at this point. -- Trent Jarvi tjarvi at qbang.org From yhua537 at cse.unsw.edu.au Tue May 23 22:50:01 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 14:50:01 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } From mmester at sps.edu Tue May 23 22:58:21 2006 From: mmester at sps.edu (Michael Mester) Date: Wed, 24 May 2006 00:58:21 -0400 Subject: [Rxtx] install rxtx in XP References: Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below -----Original Message----- From: rxtx-bounces at qbang.org on behalf of YiQi Huang Sent: Wed 5/24/2006 12:50 AM To: RXTX Developers and Users Subject: Re: [Rxtx] install rxtx in XP Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3950 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060523/b36d0c63/attachment-0402.bin From yhua537 at cse.unsw.edu.au Tue May 23 23:05:50 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 15:05:50 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: Yes, Michael you are right, it should be semicolons, But it still can't find the correct library. On Wed, 24 May 2006, Michael Mester wrote: > I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below > > > -----Original Message----- > From: rxtx-bounces at qbang.org on behalf of YiQi Huang > Sent: Wed 5/24/2006 12:50 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] install rxtx in XP > > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > cheers YiQi Huang From tod at todbot.com Wed May 24 00:01:57 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 23:01:57 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Yes, sorry, classpath entries are semicolon-separated on Windows and colon-separated on everything else. Your example code below is importing the wrong set of classes. It should not "import javax.comm.*", instead it should "import gnu.io.*". When I make that change, your example program compiles. The "javax.comm" package is the one released by Sun, the "gnu.io" package is the RXTX one. You might've seen some discussion that the two will be merged or become compatible, but that hasn't happened yet. -=tod On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > > Yes, Michael you are right, it should be semicolons, But it still > can't > find the correct library. > > On Wed, 24 May 2006, Michael Mester wrote: > >> I believe the entries in the classpath need to be seperated with >> semicolons, not a colon as you have in your command below >> >> >> -----Original Message----- >> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >> Sent: Wed 5/24/2006 12:50 AM >> To: RXTX Developers and Users >> Subject: Re: [Rxtx] install rxtx in XP >> >> Hi, >> >> Sorry guys.I follow Tod's instruction, and here is what i did: >> >> put >> RXTXcomm.jar, >> rxtxParallel.dll, >> rxtxSerial.dll >> in >> C:\RXTX_files >> >> and I got a SimpleRead class attached below, compile it with : >> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >> it still saying "cannot find symbol". >> >> Is there anything I did wrong? Do I need the comm.jar from Sun? >> >> Thanks & regards >> YiQi Huang >> >> >> //////////////////////////////////////////////////////// >> // SimpleRead.java >> //////////////////////////////////////////////////////// >> >> import java.io.*; >> import java.util.*; >> import javax.comm.*; >> >> public class SimpleRead >> implements Runnable, SerialPortEventListener { >> static CommPortIdentifier portId; >> static Enumeration portList; >> InputStream inputStream; >> SerialPort serialPort; >> Thread readThread; >> public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == >> CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals("COM1")) { >> //if (portId.getName().equals("/dev/term/a")) { >> SimpleRead reader = new SimpleRead(); >> } >> } >> } >> } >> public SimpleRead() { >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", >> 2000); >> } catch (PortInUseException e) {} >> try { >> inputStream = serialPort.getInputStream(); >> } catch (IOException e) {} >> try { >> serialPort.addEventListener(this); >> } catch (TooManyListenersException e) {} >> serialPort.notifyOnDataAvailable(true); >> try { >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } catch (UnsupportedCommOperationException e) {} >> readThread = new Thread(this); >> readThread.start(); >> } >> public void run() { >> try { >> Thread.sleep(20000); >> } catch (InterruptedException e) {} >> } >> public void serialEvent(SerialPortEvent event) { >> switch(event.getEventType()) { >> case SerialPortEvent.BI: >> case SerialPortEvent.OE: >> case SerialPortEvent.FE: >> case SerialPortEvent.PE: >> case SerialPortEvent.CD: >> case SerialPortEvent.CTS: >> case SerialPortEvent.DSR: >> case SerialPortEvent.RI: >> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >> break; >> case SerialPortEvent.DATA_AVAILABLE: >> byte[] readBuffer = new byte[20]; >> try { >> while (inputStream.available() > 0) { >> int numBytes = inputStream.read(readBuffer); >> } >> System.out.print(new String(readBuffer)); >> } catch (IOException e) {} >> break; >> } >> } >> } >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > cheers > YiQi Huang > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From joachim at buechse.de Wed May 24 00:10:06 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:10:06 +0200 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Hi Sean, my preferred way of dealing with RXTX on OS X is to include the RXTX classes into my application jar and to put the RXTX lib in the same directory as this jar. To make it even more comfortable, you can include the lib in the jar and have some startup code extract it and write it to a temporary file from which you load it with System.load(). Unfortunately the current version of RXTX for OS X requires tinkering with user groups as it is based on lockfiles - and hence it needs the RXTX OS X installer or you need to duplicated this functionality in your own installer. I have created my own native version which is not based on lockfiles but tty locking (the standard way to do it on OSX). I hope that these patches will be integrated soon into the distribution. Regards, Joachim On 23.05.2006, at 16:46, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Wed May 24 00:16:12 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:16:12 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <7017ECFC-B13E-4806-B321-9FFCAC5830F0@buechse.de> I assume you downloaded rxtx-217 (not 207). Instead of importing javax.comm.* you must import gnu.io.* The classes have the same name, but they are not in the same package. On 24.05.2006, at 06:50, YiQi Huang wrote: > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From yhua537 at cse.unsw.edu.au Wed May 24 00:17:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 16:17:45 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Message-ID: Thanks Tod again, i kept reading "gnu.io.*" as "gun.io.*" last few hours after i read some commons from web. Thanks very much Tod. thanks YiQi Huang On Tue, 23 May 2006, Tod E. Kurt wrote: > Yes, sorry, classpath entries are semicolon-separated on Windows and > colon-separated on everything else. > > Your example code below is importing the wrong set of classes. It > should not "import javax.comm.*", instead it should "import > gnu.io.*". When I make that change, your example program compiles. > The "javax.comm" package is the one released by Sun, the "gnu.io" > package is the RXTX one. You might've seen some discussion that the > two will be merged or become compatible, but that hasn't happened yet. > > -=tod > > > On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > >> >> Yes, Michael you are right, it should be semicolons, But it still >> can't >> find the correct library. >> >> On Wed, 24 May 2006, Michael Mester wrote: >> >>> I believe the entries in the classpath need to be seperated with >>> semicolons, not a colon as you have in your command below >>> >>> >>> -----Original Message----- >>> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >>> Sent: Wed 5/24/2006 12:50 AM >>> To: RXTX Developers and Users >>> Subject: Re: [Rxtx] install rxtx in XP >>> >>> Hi, >>> >>> Sorry guys.I follow Tod's instruction, and here is what i did: >>> >>> put >>> RXTXcomm.jar, >>> rxtxParallel.dll, >>> rxtxSerial.dll >>> in >>> C:\RXTX_files >>> >>> and I got a SimpleRead class attached below, compile it with : >>> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >>> it still saying "cannot find symbol". >>> >>> Is there anything I did wrong? Do I need the comm.jar from Sun? >>> >>> Thanks & regards >>> YiQi Huang >>> >>> >>> //////////////////////////////////////////////////////// >>> // SimpleRead.java >>> //////////////////////////////////////////////////////// >>> >>> import java.io.*; >>> import java.util.*; >>> import javax.comm.*; >>> >>> public class SimpleRead >>> implements Runnable, SerialPortEventListener { >>> static CommPortIdentifier portId; >>> static Enumeration portList; >>> InputStream inputStream; >>> SerialPort serialPort; >>> Thread readThread; >>> public static void main(String[] args) { >>> portList = CommPortIdentifier.getPortIdentifiers(); >>> while (portList.hasMoreElements()) { >>> portId = (CommPortIdentifier) portList.nextElement(); >>> if (portId.getPortType() == >>> CommPortIdentifier.PORT_SERIAL) { >>> if (portId.getName().equals("COM1")) { >>> //if (portId.getName().equals("/dev/term/a")) { >>> SimpleRead reader = new SimpleRead(); >>> } >>> } >>> } >>> } >>> public SimpleRead() { >>> try { >>> serialPort = (SerialPort) portId.open("SimpleReadApp", >>> 2000); >>> } catch (PortInUseException e) {} >>> try { >>> inputStream = serialPort.getInputStream(); >>> } catch (IOException e) {} >>> try { >>> serialPort.addEventListener(this); >>> } catch (TooManyListenersException e) {} >>> serialPort.notifyOnDataAvailable(true); >>> try { >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, >>> SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> } catch (UnsupportedCommOperationException e) {} >>> readThread = new Thread(this); >>> readThread.start(); >>> } >>> public void run() { >>> try { >>> Thread.sleep(20000); >>> } catch (InterruptedException e) {} >>> } >>> public void serialEvent(SerialPortEvent event) { >>> switch(event.getEventType()) { >>> case SerialPortEvent.BI: >>> case SerialPortEvent.OE: >>> case SerialPortEvent.FE: >>> case SerialPortEvent.PE: >>> case SerialPortEvent.CD: >>> case SerialPortEvent.CTS: >>> case SerialPortEvent.DSR: >>> case SerialPortEvent.RI: >>> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >>> break; >>> case SerialPortEvent.DATA_AVAILABLE: >>> byte[] readBuffer = new byte[20]; >>> try { >>> while (inputStream.available() > 0) { >>> int numBytes = inputStream.read(readBuffer); >>> } >>> System.out.print(new String(readBuffer)); >>> } catch (IOException e) {} >>> break; >>> } >>> } >>> } >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> >> cheers >> YiQi Huang >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From smontgomery at mediaspansoftware.com Wed May 24 10:24:13 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 12:24:13 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: Tod & Joachim, Thanks for the info, that's very helpful. I'll give that a whirl when I move to rxtx 2.1. I'm still using the older 2.0.7 version for now (don't ask), which probably requires the Sun comm.jar, javax.comm.properties and librxtxSerial.jnilib to be in very specific places in each jvm's file hierarchy. From tjarvi at qbang.org Wed May 24 11:59:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 11:59:16 -0600 (MDT) Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: On Wed, 24 May 2006, Sean Montgomery wrote: > Tod & Joachim, > > Thanks for the info, that's very helpful. I'll give that a whirl > when I move to rxtx 2.1. I'm still using the older 2.0.7 version for > now (don't ask), which probably requires the Sun comm.jar, > javax.comm.properties and librxtxSerial.jnilib to be in very specific > places in each jvm's file hierarchy. > You will need comm.jar from Sun then. It must be Sun's version 2.* or older for Linux or Solaris. I assume they have this in download archives. The default offering from Sun is version 3.0. This version currently does not support rxtx. The older version will probably be fine for your needs. -- Trent Jarvi tjarvi at qbang.org From smontgomery at mediaspansoftware.com Wed May 24 12:19:06 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 14:19:06 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: <3939EFB8-11E1-4E3E-A684-5B3C525577CD@mediaspansoftware.com> Yup, that's right, thanks Trent. I've been using these files for quite a while now. Thanks for bringing it up. I almost didn't mention using 2.0.7 because I didn't want to give any new members of the list the wrong idea! :-) On May 24, 2006, at 1:59 PM, Trent Jarvi wrote: > On Wed, 24 May 2006, Sean Montgomery wrote: > >> Tod & Joachim, >> >> Thanks for the info, that's very helpful. I'll give that a whirl >> when I move to rxtx 2.1. I'm still using the older 2.0.7 version for >> now (don't ask), which probably requires the Sun comm.jar, >> javax.comm.properties and librxtxSerial.jnilib to be in very specific >> places in each jvm's file hierarchy. >> > > You will need comm.jar from Sun then. It must be Sun's version 2.* or > older for Linux or Solaris. I assume they have this in download > archives. > > The default offering from Sun is version 3.0. This version > currently does > not support rxtx. > > The older version will probably be fine for your needs. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mark at mdsh.com Wed May 24 15:55:46 2006 From: mark at mdsh.com (Mark Himsley) Date: Wed, 24 May 2006 22:55:46 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <37B0FC4B1F3237321F093ABE@MacMini.local> On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) That's no problem. BUT, do note that the instructions I elaborated on are in the INSTALL file within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone please update the INSTALL file? > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > > , it includes DLLs for Windows and the JAR > > for Java. > > > > Follow the Windows instructions in the INSTALL. > > > > ie > > > > RXTXcomm.jar goes in \jre\lib\ext (under java) > > rxtxSerial.dll goes in \jre\bin > > > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > > C:\Program Files\Java\jre1.5.0_06\lib\ext > > and copy rxtxSerial.dll into > > C:\Program Files\Java\jre1.5.0_06\bin > > > > Yes, it really is that simple. > > > > > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > > > >> I am new to serial port programming, and have no experience on > >> programming java in xp, but my project require me to builld a > >> communication link between xp and a UART device. > >> > >> Most of the information in the web site seems for linux only. > >> including > >> the commands such as export and chmod. How do I install rxtx in xp? > >> > >> cheers > >> YiQi Huang > > > > > > > > -- > > Mark Himsley > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Mark Himsley From tjarvi at qbang.org Wed May 24 16:41:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 16:41:46 -0600 (MDT) Subject: [Rxtx] install rxtx in XP In-Reply-To: <37B0FC4B1F3237321F093ABE@MacMini.local> References: <37B0FC4B1F3237321F093ABE@MacMini.local> Message-ID: On Wed, 24 May 2006, Mark Himsley wrote: > > > On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > >> I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > That's no problem. > > BUT, do note that the instructions I elaborated on are in the INSTALL file > within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone > please update the INSTALL file? > > The INSTALL file may be updated by anyone at anytime. http://rxtx.qbang.org/wiki/index.php/Installation We are moving it to the wiki so end users may put the type of answers they would like to see in. Sometimes it's best if developers don't give what appears to be cryptic answers. You can even put in that jre/lib/ext is not the right place but you don't understand the classpath solution mentioned on the mail-list and then we know what to add. -- Trent Jarvi tjarvi at qbang.org From stramit at gmail.com Wed May 24 21:45:31 2006 From: stramit at gmail.com (Tim Cooper) Date: Thu, 25 May 2006 13:45:31 +1000 Subject: [Rxtx] Accessing Virtual Com Port Message-ID: Hi, I have to develop an application that talks to a virtual com port (in this case com3) which translates any messages sent across a USB cable to a micro. Using C++ I can talk to this com port and I know that it is configured, present, and working. For the application that I am trying to write I want to use RXTX for the communication. My problem is that the configured virtual port (in windows) is not showing up when I do an enumeration over the available ports. The output I get is (com 3 is not present) : Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 PORT FOUND: COM1 PORT FOUND: LPT1 Is there anything that I need to do to make com3 available to RXTX and my application? Timothy Cooper -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060524/c5591648/attachment-0402.html From antonio.luis at iscte.pt Thu May 25 01:39:13 2006 From: antonio.luis at iscte.pt (=?ISO-8859-1?Q?Ant=F3nio_Lopes?=) Date: Thu, 25 May 2006 08:39:13 +0100 Subject: [Rxtx] RXTX on Pocket PC Message-ID: <44755F21.8060103@iscte.pt> Hello everyone, I've been using RXTX to communicate with serial ports in Windows and it's been quite successful. However, I'm now considering porting my application from Windows to Pocket PC but I can't seem to find the RXTX binaries (*.jar and *.dll) to use in Pocket PC. I've been "digging" on the mailing list's archives and also on the web and I can't find these anywhere. Can anyone in this mailing list give me some pointers on this? Where can I find the necessary files and basic installation instructions? Thanks very much for your help. I very much appreciate any help that you can provide me. Regards, -- Ant?nio Lopes @contact: antonio.luis at iscte.pt @work: ADETTI - ISCTE @web: http://antonio.lopes.googlepages.com/home From doug at dupreeinc.com Fri May 26 15:45:50 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Fri, 26 May 2006 14:45:50 -0700 Subject: [Rxtx] rxtx slow startup Message-ID: <4477770E.9010400@dupreeinc.com> Hello, I hope there are people still reading this mailing list. The archive appeared to not have anything new after 4/2005. I was using the commapi from sun for a project where a java application reads data from test equipment connected to the serial port. I had to upgrade the ftdi vcp driver on my pc and the old sun commapi no longer works with hardware flow control. as an experiment I replaced the javax.com with gnu.io in the SerialDemo.java project that was included with the commapi. This compiled fine using JBuilder 2006 and JRE 1.5.0_05. RXTX also works with the latest ftdi drivers so life is wonderful again... almost... When using the commapi jar the SerialDemo program starts in about 1 second on my system. Using the RXTX jar it takes over 56 seconds to start. Has anyone else seen this problem? Is there a workaround to get the startup performance close to the old commapi? The last thing printed to the console before this delay is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks for your time! Doug From yhua537 at cse.unsw.edu.au Sat May 27 05:46:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 21:46:45 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <4477770E.9010400@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> Message-ID: hi Doug The archive hasn't been update for a long time, But people certainly still reading the list. I don't have enough experience to help on your problem, but without any detail about what your problem doing during that 56 seconds, it is hard to target the your question, I think. cheers YiQi On Fri, 26 May 2006, Doug Thistlethwaite wrote: > Hello, > > I hope there are people still reading this mailing list. The archive > appeared to not have anything new after 4/2005. > > I was using the commapi from sun for a project where a java application > reads data from test equipment connected to the serial port. I had to > upgrade the ftdi vcp driver on my pc and the old sun commapi no longer > works with hardware flow control. as an experiment I replaced the > javax.com with gnu.io in the SerialDemo.java project that was included > with the commapi. This compiled fine using JBuilder 2006 and JRE > 1.5.0_05. RXTX also works with the latest ftdi drivers so life is > wonderful again... almost... > > When using the commapi jar the SerialDemo program starts in about 1 > second on my system. Using the RXTX jar it takes over 56 seconds to > start. Has anyone else seen this problem? Is there a workaround to get > the startup performance close to the old commapi? > > The last thing printed to the console before this delay is: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Thanks for your time! > > Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------- Just a student, Still a student ------------------------------- From yhua537 at cse.unsw.edu.au Sat May 27 06:04:26 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 22:04:26 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: Sorry, I don't think you could understand what I mean .I mean this: Without any detail about what your program is doing during that 56 seconds, it is hard for anyone to target the problem. On Sat, 27 May 2006, YiQi Huang wrote: > hi Doug > > The archive hasn't been update for a long time, But people certainly still > reading the list. > > I don't have enough experience to help on your problem, but without any > detail about what your problem doing during that 56 seconds, it is hard to > target the your question, I think. > > cheers > YiQi > > On Fri, 26 May 2006, Doug Thistlethwaite wrote: > >> Hello, >> >> I hope there are people still reading this mailing list. The archive >> appeared to not have anything new after 4/2005. >> >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From jredman at ergotech.com Sat May 27 08:32:02 2006 From: jredman at ergotech.com (Jim Redman) Date: Sat, 27 May 2006 08:32:02 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: <447862E2.4080506@ergotech.com> Doug, Since you mentioned it, we have a system that is also seems slow. From memory (I don't have one of the slow systems around), I'm not sure that it's consistent, it seems that sometimes it may take longer than others. Since it's part of the bootup it hasn't raised a flag and I haven't researched it. The same code runs much faster on other systems, so now you've got me wondering what's different. The slow system boots DSL (http://www.damnsmalllinux.org/) from a compact flash. FC4 is on my desktop where I haven't noticed a slow down. I think that the rxtx code is the same in both cases with lock files disabled. The slow system has a bunch of serial ports defined, including 4 USB serial ports that do not exist - they are not plugged in. Any clues in there? Jim > On Fri, 26 May 2006, Doug Thistlethwaite wrote: >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Sat May 27 10:41:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 May 2006 10:41:54 -0600 (MDT) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447862E2.4080506@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: On Sat, 27 May 2006, Jim Redman wrote: > Doug, > > Since you mentioned it, we have a system that is also seems slow. From > memory (I don't have one of the slow systems around), I'm not sure that > it's consistent, it seems that sometimes it may take longer than others. > Since it's part of the bootup it hasn't raised a flag and I haven't > researched it. > > The same code runs much faster on other systems, so now you've got me > wondering what's different. > > The slow system boots DSL (http://www.damnsmalllinux.org/) from a > compact flash. FC4 is on my desktop where I haven't noticed a slow > down. I think that the rxtx code is the same in both cases with lock > files disabled. > > The slow system has a bunch of serial ports defined, including 4 USB > serial ports that do not exist - they are not plugged in. > > Any clues in there? > rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. When it does this, it will try to open each port and do a timed out read. most systems will not have entries in device if the port is not there. But some minimal systems will just put all the device files there in case hardware is added. The list of devices scanned used to be ~10-20 times longer than it is today. That was getting very slow. I suspect moving the device files not used to a backup directory would increase the enumeration. I'll look into why the mail-list archive is not updating. The last update was about when I thought I 'fixed' the cron jobs. I probably didn't actually fix it but rather moved the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon May 29 19:46:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 May 2006 19:46:47 -0600 (MDT) Subject: [Rxtx] Mail-List Archives are updating. Message-ID: It was pointed out earlier that the archive is dated. This was a missing crontab entry. The list is currently archived by the week on the web page. It is updated once a day. So every 7 days it starts a new link and updates it daily. I've been limited in what I could do while my cable modem was disconnected this last week. rxtx.org is something I do on my own time. The patches and credits will be comming next. Many of these can be seen in bugzilla right now. -- Trent Jarvi tjarvi at qbang.org From doug at dupreeinc.com Tue May 30 11:18:41 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 10:18:41 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: <447C7E71.4080204@dupreeinc.com> Trent, YiQi, and Jim: Thanks to all for the replies and information! I am just back from a long weekend and I am now trying to figure out what I was doing! :) As for more information. First off, this example is being run under windows XP. I am developing test equipment that communicates with a java application via a serial port. I have been using the commapi for several years and have not had a problem. Recently, I have started a design modification that will replace the RS232 connection with a USB port. I am using the ftdi module for prototyping and I discovered that their virtual com port driver was not compatible with the commapi that Sun released. It turns out that it has problems with hardware flow control ( it works on incoming but not outgoing communications). The way I figured this out was by experimenting with the SerialDemo that was included with the Sum commapi. One nice thing about this example is it has the ability to set incoming and outgoing flow control independently. After I installed RXTX into my JBuilder 2006 IDE, I just replaced all all instances of javax.comm with gnu.io and it compiled and runs without a hitch (except for the slow startup). I Paused the JBuilder IDE during this long pause and the last few entries in the stack trace are: testRead() : -1, gnu.io.RXTXCommDriver registerValidPorts() : 255, gnu.io.RXTXCommDriver registerScannedPorts() : 777, gnu.io.RXTXCommDriver This was all initiated by the following call in the programs init routine: Enumeration en = CommPortIdentifier.getPortIdentifiers(); After looking at this, My guess is that Trent is correct in that the delay is in scanning for ports. I guess one solution would be to not scan for ports, though it would be nice to detect what is available on the system. Is there any way to reduce the number of ports scanned by this function in windows XP? Thanks again for your time, Doug Trent Jarvi wrote: >On Sat, 27 May 2006, Jim Redman wrote: > > > >>Doug, >> >>Since you mentioned it, we have a system that is also seems slow. From >>memory (I don't have one of the slow systems around), I'm not sure that >>it's consistent, it seems that sometimes it may take longer than others. >>Since it's part of the bootup it hasn't raised a flag and I haven't >>researched it. >> >>The same code runs much faster on other systems, so now you've got me >>wondering what's different. >> >>The slow system boots DSL (http://www.damnsmalllinux.org/) from a >>compact flash. FC4 is on my desktop where I haven't noticed a slow >>down. I think that the rxtx code is the same in both cases with lock >>files disabled. >> >>The slow system has a bunch of serial ports defined, including 4 USB >>serial ports that do not exist - they are not plugged in. >> >>Any clues in there? >> >> >> > >rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. > >When it does this, it will try to open each port and do a timed out read. >most systems will not have entries in device if the port is not there. >But some minimal systems will just put all the device files there in case >hardware is added. > >The list of devices scanned used to be ~10-20 times longer than it is >today. That was getting very slow. > >I suspect moving the device files not used to a backup directory would >increase the enumeration. > >I'll look into why the mail-list archive is not updating. The last update >was about when I thought I 'fixed' the cron jobs. I probably didn't >actually fix it but rather moved the problem. > >-- >Trent Jarvi >tjarvi at qbang.org > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/86796453/attachment-0399.html From doug at dupreeinc.com Tue May 30 14:36:09 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 13:36:09 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447C7E71.4080204@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com> Message-ID: <447CACB9.1000801@dupreeinc.com> Hello all, I also notice this pause (not as long however) when I call: CommPortIdentifier.getPortIdentifier(PortName); I would think that if I supply the name of the port, it would not have to go through the same discovery process. If you have any ideas of how to get rid of this startup delay, I would really appreciate it. Thanks, Doug Doug Thistlethwaite wrote: > Trent, YiQi, and Jim: > > Thanks to all for the replies and information! I am just back from a > long weekend and I am now trying to figure out what I was doing! :) > > As for more information. First off, this example is being run under > windows XP. I am developing test equipment that communicates with a > java application via a serial port. I have been using the commapi for > several years and have not had a problem. Recently, I have started a > design modification that will replace the RS232 connection with a USB > port. I am using the ftdi module for prototyping and I discovered > that their virtual com port driver was not compatible with the commapi > that Sun released. It turns out that it has problems with hardware > flow control ( it works on incoming but not outgoing communications). > The way I figured this out was by experimenting with the SerialDemo > that was included with the Sum commapi. One nice thing about this > example is it has the ability to set incoming and outgoing flow > control independently. > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup). > > I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are: > > testRead() : -1, gnu.io.RXTXCommDriver > registerValidPorts() : 255, gnu.io.RXTXCommDriver > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > This was all initiated by the following call in the programs init routine: > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > After looking at this, My guess is that Trent is correct in that the > delay is in scanning for ports. I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system. Is there any way to reduce the number of ports scanned by > this function in windows XP? > > Thanks again for your time, > > Doug > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/edaa5c3c/attachment-0399.html From lynn at swcp.com Tue May 30 15:07:18 2006 From: lynn at swcp.com (lynn@swcp.com) Date: Tue, 30 May 2006 21:07:18 -0000 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CACB9.1000801@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: *IF* the name of the port is supplied, we might want to use the preferences mechanism (java.util.prefs) where we could have previously saved the info for the port. We could do a quick check to see that things have not changed before using it. If things have changed (or never been defined) we would do a full port scan and save detected ports in the preferences. This way if the hardware is not changed, you only pay the time penalty one time. just an idea... Lynn Doug Thistlethwaite said: > This is a multi-part message in MIME format. > --------------070808020900080005070500 > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > Content-Transfer-Encoding: 7bit > > Hello all, > > I also notice this pause (not as long however) when I call: > > CommPortIdentifier.getPortIdentifier(PortName); > > I would think that if I supply the name of the port, it would not have > to go through the same discovery process. If you have any ideas of how > to get rid of this startup delay, I would really appreciate it. > > Thanks, > > Doug > > Doug Thistlethwaite wrote: > > > Trent, YiQi, and Jim: > > > > Thanks to all for the replies and information! I am just back from a > > long weekend and I am now trying to figure out what I was doing! :) > > > > As for more information. First off, this example is being run under > > windows XP. I am developing test equipment that communicates with a > > java application via a serial port. I have been using the commapi for > > several years and have not had a problem. Recently, I have started a > > design modification that will replace the RS232 connection with a USB > > port. I am using the ftdi module for prototyping and I discovered > > that their virtual com port driver was not compatible with the commapi > > that Sun released. It turns out that it has problems with hardware > > flow control ( it works on incoming but not outgoing communications). > > The way I figured this out was by experimenting with the SerialDemo > > that was included with the Sum commapi. One nice thing about this > > example is it has the ability to set incoming and outgoing flow > > control independently. > > > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > > all instances of javax.comm with gnu.io and it compiled and runs > > without a hitch (except for the slow startup). > > > > I Paused the JBuilder IDE during this long pause and the last few > > entries in the stack trace are: > > > > testRead() : -1, gnu.io.RXTXCommDriver > > registerValidPorts() : 255, gnu.io.RXTXCommDriver > > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > > > This was all initiated by the following call in the programs init routine: > > > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > > > After looking at this, My guess is that Trent is correct in that the > > delay is in scanning for ports. I guess one solution would be to not > > scan for ports, though it would be nice to detect what is available on > > the system. Is there any way to reduce the number of ports scanned by > > this function in windows XP? > > > > Thanks again for your time, > > > > Doug > > > > --------------070808020900080005070500 > Content-Type: text/html; charset=ISO-8859-1 > Content-Transfer-Encoding: 7bit > > > > > > > > > Hello all,
>
> I also notice this pause (not as long however) when I call:
>
>          CommPortIdentifier.getPortIdentifier(PortName);
>
> I would think that if I supply the name of the port, it would not have > to go through the same discovery process.  If you have any ideas of how > to get rid of this startup delay, I would really appreciate it.
>
> Thanks,
>
> Doug
>
> Doug Thistlethwaite wrote: >
> > Trent, YiQi, and Jim:
>
> Thanks to all for the replies and information!  I am just back from a > long weekend and I am now trying to figure out what I was doing! :)
>
> As for more information.  First off, this example is being run under > windows XP.  I am developing test equipment that communicates with a > java application via a serial port.  I have been using the commapi for > several years and have not had a problem.  Recently, I have started a > design modification that will replace the RS232 connection with a USB > port.  I am using the ftdi module for prototyping and I discovered that > their virtual com port driver was not compatible with the commapi that > Sun released.  It turns out that it has problems with hardware flow > control ( it works on incoming but not outgoing communications).  The > way I figured this out was by experimenting with the SerialDemo that > was included with the Sum commapi.  One nice thing about this example > is it has the ability to set incoming and outgoing flow control > independently.
>
> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup).
>
> I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are:
>
> testRead() : -1, gnu.io.RXTXCommDriver
> registerValidPorts() : 255, gnu.io.RXTXCommDriver
> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>
> This was all initiated by the following call in the programs init > routine:
>
> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>
> After looking at this,  My guess is that Trent is correct in that the > delay is in scanning for ports.  I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system.  Is there any way to reduce the number of ports scanned by > this function in windows XP? 
>
> Thanks again for your time,
>
> Doug
>
>
> > > > --------------070808020900080005070500-- > -- From jredman at ergotech.com Tue May 30 15:42:35 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 30 May 2006 15:42:35 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: <447CBC4B.2080206@ergotech.com> Lynn, If I understand your idea correctly, I don't think that this would work well for, say, USB ports since these can be easily added/removed by the end user. Jim lynn at swcp.com wrote: > *IF* the name of the port is supplied, we might want to use the preferences > mechanism (java.util.prefs) where we could have previously saved the info for > the port. We could do a quick check to see that things have not changed > before using it. If things have changed (or never been defined) we would do a > full port scan and save detected ports in the preferences. > > This way if the hardware is not changed, you only pay the time penalty one time. > > just an idea... > Lynn > > > Doug Thistlethwaite said: > >> This is a multi-part message in MIME format. >> --------------070808020900080005070500 >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >> Content-Transfer-Encoding: 7bit >> >> Hello all, >> >> I also notice this pause (not as long however) when I call: >> >> CommPortIdentifier.getPortIdentifier(PortName); >> >> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process. If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it. >> >> Thanks, >> >> Doug >> >> Doug Thistlethwaite wrote: >> >>> Trent, YiQi, and Jim: >>> >>> Thanks to all for the replies and information! I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :) >>> >>> As for more information. First off, this example is being run under >>> windows XP. I am developing test equipment that communicates with a >>> java application via a serial port. I have been using the commapi for >>> several years and have not had a problem. Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port. I am using the ftdi module for prototyping and I discovered >>> that their virtual com port driver was not compatible with the commapi >>> that Sun released. It turns out that it has problems with hardware >>> flow control ( it works on incoming but not outgoing communications). >>> The way I figured this out was by experimenting with the SerialDemo >>> that was included with the Sum commapi. One nice thing about this >>> example is it has the ability to set incoming and outgoing flow >>> control independently. >>> >>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup). >>> >>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are: >>> >>> testRead() : -1, gnu.io.RXTXCommDriver >>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>> >>> This was all initiated by the following call in the programs init routine: >>> >>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>> >>> After looking at this, My guess is that Trent is correct in that the >>> delay is in scanning for ports. I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system. Is there any way to reduce the number of ports scanned by >>> this function in windows XP? >>> >>> Thanks again for your time, >>> >>> Doug >>> >> --------------070808020900080005070500 >> Content-Type: text/html; charset=ISO-8859-1 >> Content-Transfer-Encoding: 7bit >> >> >> >> >> >> >> >> >> Hello all,
>>
>> I also notice this pause (not as long however) when I call:
>>
>>         >  CommPortIdentifier.getPortIdentifier(PortName);
>>
>> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process.  If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it.
>>
>> Thanks,
>>
>> Doug
>>
>> Doug Thistlethwaite wrote: >>
>> >> Trent, YiQi, and Jim:
>>
>> Thanks to all for the replies and information!  I am just back from a >> long weekend and I am now trying to figure out what I was doing! :)
>>
>> As for more information.  First off, this example is being run under >> windows XP.  I am developing test equipment that communicates with a >> java application via a serial port.  I have been using the commapi for >> several years and have not had a problem.  Recently, I have started a >> design modification that will replace the RS232 connection with a USB >> port.  I am using the ftdi module for prototyping and I discovered that >> their virtual com port driver was not compatible with the commapi that >> Sun released.  It turns out that it has problems with hardware flow >> control ( it works on incoming but not outgoing communications).  The >> way I figured this out was by experimenting with the SerialDemo that >> was included with the Sum commapi.  One nice thing about this example >> is it has the ability to set incoming and outgoing flow control >> independently.
>>
>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >> all instances of javax.comm with gnu.io and it compiled and runs >> without a hitch (except for the slow startup).
>>
>> I Paused the JBuilder IDE during this long pause and the last few >> entries in the stack trace are:
>>
>> testRead() : -1, gnu.io.RXTXCommDriver
>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>
>> This was all initiated by the following call in the programs init >> routine:
>>
>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>
>> After looking at this,  My guess is that Trent is correct in that the >> delay is in scanning for ports.  I guess one solution would be to not >> scan for ports, though it would be nice to detect what is available on >> the system.  Is there any way to reduce the number of ports scanned by >> this function in windows XP? 
>>
>> Thanks again for your time,
>>
>> Doug
>>
>>
>> >> >> >> --------------070808020900080005070500-- >> > > > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From yhua537 at cse.unsw.edu.au Tue May 30 18:10:23 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 31 May 2006 10:10:23 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CBC4B.2080206@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: Doug, In the SerialDemo, it allow us to save the parameters into a file, and use it when your program start up. Would this help? YiQi On Tue, 30 May 2006, Jim Redman wrote: > Lynn, > > If I understand your idea correctly, I don't think that this would work > well for, say, USB ports since these can be easily added/removed by the > end user. > > Jim > > lynn at swcp.com wrote: >> *IF* the name of the port is supplied, we might want to use the preferences >> mechanism (java.util.prefs) where we could have previously saved the info for >> the port. We could do a quick check to see that things have not changed >> before using it. If things have changed (or never been defined) we would do a >> full port scan and save detected ports in the preferences. >> >> This way if the hardware is not changed, you only pay the time penalty one time. >> >> just an idea... >> Lynn >> >> >> Doug Thistlethwaite said: >> >>> This is a multi-part message in MIME format. >>> --------------070808020900080005070500 >>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>> Content-Transfer-Encoding: 7bit >>> >>> Hello all, >>> >>> I also notice this pause (not as long however) when I call: >>> >>> CommPortIdentifier.getPortIdentifier(PortName); >>> >>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process. If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it. >>> >>> Thanks, >>> >>> Doug >>> >>> Doug Thistlethwaite wrote: >>> >>>> Trent, YiQi, and Jim: >>>> >>>> Thanks to all for the replies and information! I am just back from a >>>> long weekend and I am now trying to figure out what I was doing! :) >>>> >>>> As for more information. First off, this example is being run under >>>> windows XP. I am developing test equipment that communicates with a >>>> java application via a serial port. I have been using the commapi for >>>> several years and have not had a problem. Recently, I have started a >>>> design modification that will replace the RS232 connection with a USB >>>> port. I am using the ftdi module for prototyping and I discovered >>>> that their virtual com port driver was not compatible with the commapi >>>> that Sun released. It turns out that it has problems with hardware >>>> flow control ( it works on incoming but not outgoing communications). >>>> The way I figured this out was by experimenting with the SerialDemo >>>> that was included with the Sum commapi. One nice thing about this >>>> example is it has the ability to set incoming and outgoing flow >>>> control independently. >>>> >>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>> all instances of javax.comm with gnu.io and it compiled and runs >>>> without a hitch (except for the slow startup). >>>> >>>> I Paused the JBuilder IDE during this long pause and the last few >>>> entries in the stack trace are: >>>> >>>> testRead() : -1, gnu.io.RXTXCommDriver >>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>> >>>> This was all initiated by the following call in the programs init routine: >>>> >>>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>> >>>> After looking at this, My guess is that Trent is correct in that the >>>> delay is in scanning for ports. I guess one solution would be to not >>>> scan for ports, though it would be nice to detect what is available on >>>> the system. Is there any way to reduce the number of ports scanned by >>>> this function in windows XP? >>>> >>>> Thanks again for your time, >>>> >>>> Doug >>>> >>> --------------070808020900080005070500 >>> Content-Type: text/html; charset=ISO-8859-1 >>> Content-Transfer-Encoding: 7bit >>> >>> >>> >>> >>> >>> >>> >>> >>> Hello all,
>>>
>>> I also notice this pause (not as long however) when I call:
>>>
>>>         >>  CommPortIdentifier.getPortIdentifier(PortName);
>>>
>>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process.  If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it.
>>>
>>> Thanks,
>>>
>>> Doug
>>>
>>> Doug Thistlethwaite wrote: >>>
>>> >>> Trent, YiQi, and Jim:
>>>
>>> Thanks to all for the replies and information!  I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :)
>>>
>>> As for more information.  First off, this example is being run under >>> windows XP.  I am developing test equipment that communicates with a >>> java application via a serial port.  I have been using the commapi for >>> several years and have not had a problem.  Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port.  I am using the ftdi module for prototyping and I discovered that >>> their virtual com port driver was not compatible with the commapi that >>> Sun released.  It turns out that it has problems with hardware flow >>> control ( it works on incoming but not outgoing communications).  The >>> way I figured this out was by experimenting with the SerialDemo that >>> was included with the Sum commapi.  One nice thing about this example >>> is it has the ability to set incoming and outgoing flow control >>> independently.
>>>
>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup).
>>>
>>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are:
>>>
>>> testRead() : -1, gnu.io.RXTXCommDriver
>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>
>>> This was all initiated by the following call in the programs init >>> routine:
>>>
>>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>
>>> After looking at this,  My guess is that Trent is correct in that the >>> delay is in scanning for ports.  I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system.  Is there any way to reduce the number of ports scanned by >>> this function in windows XP? 
>>>
>>> Thanks again for your time,
>>>
>>> Doug
>>>
>>>
>>> >>> >>> >>> --------------070808020900080005070500-- >>> >> >> >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From halbleib at rechnerbetriebsgruppe.de Wed May 31 02:06:16 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 10:06:16 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp Message-ID: <447D4E78.30302@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, I getting an error while reloading my app in tomcat. At the first start everything runs well, but if i reload mit webapp by tomcat manager i get the following error. java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader Is there a possibility to unload the native library rxtxSerial.dll? thx for all help! regards tom -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 b8FT80HQ1xlbDLnRecDANCc= =heb1 -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 02:52:17 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 10:52:17 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D4E78.30302@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> Message-ID: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Hello Tom, To the best of my knowledge it is impossible to unload native libraries once loaded into the JVM. The exception you see stems from the fact, that Tomcat creates a new classloader when you "reload" the weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar is loaded from the session class loader. Try to add RXTXComm.jar to your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. Regards, Joachim On 31.05.2006, at 10:06, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 > b8FT80HQ1xlbDLnRecDANCc= > =heb1 > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From halbleib at rechnerbetriebsgruppe.de Wed May 31 03:28:35 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 11:28:35 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Message-ID: <447D61C3.1030807@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Joachim, I'm still not getting it. How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml-file? Perhaps web.xml? Regards, Tom Joachim Buechse schrieb: > Hello Tom, > > To the best of my knowledge it is impossible to unload native > libraries once loaded into the JVM. The exception you see stems from > the fact, that Tomcat creates a new classloader when you "reload" the > weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar > is loaded from the session class loader. Try to add RXTXComm.jar to > your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. > > Regards, > Joachim > > On 31.05.2006, at 10:06, Tom Halbleib wrote: > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL tzNy+/0iIUfkYYgt1+UT1ko= =pkpY -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 04:03:42 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 12:03:42 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D61C3.1030807@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> <447D61C3.1030807@rechnerbetriebsgruppe.de> Message-ID: -Xbootclasspath/a: is a start option to the java vm. Google is your friend in finding how to modfiy it and what it means: tomcat modifying bootclasspath Regards, Joachim On 31.05.2006, at 11:28, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Joachim, > > I'm still not getting it. > How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml- > file? > Perhaps web.xml? > > Regards, > Tom > > Joachim Buechse schrieb: >> Hello Tom, >> >> To the best of my knowledge it is impossible to unload native >> libraries once loaded into the JVM. The exception you see stems from >> the fact, that Tomcat creates a new classloader when you "reload" the >> weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar >> is loaded from the session class loader. Try to add RXTXComm.jar to >> your bootlclasspath (-Xbootclasspath/a:) and the problem should go >> away. >> >> Regards, >> Joachim >> >> On 31.05.2006, at 10:06, Tom Halbleib wrote: >> >> Hi all, >> >> I getting an error while reloading my app in tomcat. At the first >> start >> everything runs well, but if i reload mit webapp by tomcat manager >> i get >> the following error. >> >> java.lang.UnsatisfiedLinkError: Native Library >> C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in >> another classloader thrown while loading gnu.io.RXTXCommDriver >> Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: >> Native >> Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already >> loaded >> in another classloader >> >> >> Is there a possibility to unload the native library rxtxSerial.dll? >> >> thx for all help! >> >> regards >> >> tom > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL > tzNy+/0iIUfkYYgt1+UT1ko= > =pkpY > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From impakt01 at optusnet.com.au Wed May 31 06:55:42 2006 From: impakt01 at optusnet.com.au (Daren) Date: Wed, 31 May 2006 22:55:42 +1000 Subject: [Rxtx] (no subject) Message-ID: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/ade7ad37/attachment-0399.html From doug at dupreeinc.com Wed May 31 10:19:19 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 31 May 2006 09:19:19 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: <447DC207.3070702@dupreeinc.com> I am not sure what you are saying. The Save parameters menu option saves the current settings (baud, data bits, etc.). The long pause (~60 seconds) is when the application first starts (before loading the saved parameters). This does bring up a question, though I hate this type of kludge approach to getting this library to work... What exactly is a PortIdentifier? Is it always the same? If I stored the results from "CommPortIdentifier.getPortIdentifier(PortName);" in a file, could I use this the next time the program is executed? In this case I am using a virtual com port driver to connect to the device through a USB port. Doug YiQi Huang wrote: >Doug, > >In the SerialDemo, it allow us to save the parameters into a file, and use >it when your program start up. Would this help? > >YiQi > >On Tue, 30 May 2006, Jim Redman wrote: > > > >>Lynn, >> >>If I understand your idea correctly, I don't think that this would work >>well for, say, USB ports since these can be easily added/removed by the >>end user. >> >>Jim >> >>lynn at swcp.com wrote: >> >> >>>*IF* the name of the port is supplied, we might want to use the preferences >>>mechanism (java.util.prefs) where we could have previously saved the info for >>>the port. We could do a quick check to see that things have not changed >>>before using it. If things have changed (or never been defined) we would do a >>>full port scan and save detected ports in the preferences. >>> >>>This way if the hardware is not changed, you only pay the time penalty one time. >>> >>>just an idea... >>>Lynn >>> >>> >>>Doug Thistlethwaite said: >>> >>> >>> >>>>This is a multi-part message in MIME format. >>>>--------------070808020900080005070500 >>>>Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>>>Content-Transfer-Encoding: 7bit >>>> >>>>Hello all, >>>> >>>>I also notice this pause (not as long however) when I call: >>>> >>>> CommPortIdentifier.getPortIdentifier(PortName); >>>> >>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process. If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it. >>>> >>>>Thanks, >>>> >>>>Doug >>>> >>>>Doug Thistlethwaite wrote: >>>> >>>> >>>> >>>>>Trent, YiQi, and Jim: >>>>> >>>>>Thanks to all for the replies and information! I am just back from a >>>>>long weekend and I am now trying to figure out what I was doing! :) >>>>> >>>>>As for more information. First off, this example is being run under >>>>>windows XP. I am developing test equipment that communicates with a >>>>>java application via a serial port. I have been using the commapi for >>>>>several years and have not had a problem. Recently, I have started a >>>>>design modification that will replace the RS232 connection with a USB >>>>>port. I am using the ftdi module for prototyping and I discovered >>>>>that their virtual com port driver was not compatible with the commapi >>>>>that Sun released. It turns out that it has problems with hardware >>>>>flow control ( it works on incoming but not outgoing communications). >>>>>The way I figured this out was by experimenting with the SerialDemo >>>>>that was included with the Sum commapi. One nice thing about this >>>>>example is it has the ability to set incoming and outgoing flow >>>>>control independently. >>>>> >>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>>without a hitch (except for the slow startup). >>>>> >>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>>entries in the stack trace are: >>>>> >>>>>testRead() : -1, gnu.io.RXTXCommDriver >>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>>> >>>>>This was all initiated by the following call in the programs init routine: >>>>> >>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>>> >>>>>After looking at this, My guess is that Trent is correct in that the >>>>>delay is in scanning for ports. I guess one solution would be to not >>>>>scan for ports, though it would be nice to detect what is available on >>>>>the system. Is there any way to reduce the number of ports scanned by >>>>>this function in windows XP? >>>>> >>>>>Thanks again for your time, >>>>> >>>>>Doug >>>>> >>>>> >>>>> >>>>--------------070808020900080005070500 >>>>Content-Type: text/html; charset=ISO-8859-1 >>>>Content-Transfer-Encoding: 7bit >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>>Hello all,
>>>>
>>>>I also notice this pause (not as long however) when I call:
>>>>
>>>>        >>>> >>>> >>> CommPortIdentifier.getPortIdentifier(PortName);
>>> >>> >>>>
>>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process.  If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it.
>>>>
>>>>Thanks,
>>>>
>>>>Doug
>>>>
>>>>Doug Thistlethwaite wrote: >>>>
>>>> >>>>Trent, YiQi, and Jim:
>>>>
>>>>Thanks to all for the replies and information!  I am just back from a >>>>long weekend and I am now trying to figure out what I was doing! :)
>>>>
>>>>As for more information.  First off, this example is being run under >>>>windows XP.  I am developing test equipment that communicates with a >>>>java application via a serial port.  I have been using the commapi for >>>>several years and have not had a problem.  Recently, I have started a >>>>design modification that will replace the RS232 connection with a USB >>>>port.  I am using the ftdi module for prototyping and I discovered that >>>>their virtual com port driver was not compatible with the commapi that >>>>Sun released.  It turns out that it has problems with hardware flow >>>>control ( it works on incoming but not outgoing communications).  The >>>>way I figured this out was by experimenting with the SerialDemo that >>>>was included with the Sum commapi.  One nice thing about this example >>>>is it has the ability to set incoming and outgoing flow control >>>>independently.
>>>>
>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>without a hitch (except for the slow startup).
>>>>
>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>entries in the stack trace are:
>>>>
>>>>testRead() : -1, gnu.io.RXTXCommDriver
>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>>
>>>>This was all initiated by the following call in the programs init >>>>routine:
>>>>
>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>>
>>>>After looking at this,  My guess is that Trent is correct in that the >>>>delay is in scanning for ports.  I guess one solution would be to not >>>>scan for ports, though it would be nice to detect what is available on >>>>the system.  Is there any way to reduce the number of ports scanned by >>>>this function in windows XP? 
>>>>
>>>>Thanks again for your time,
>>>>
>>>>Doug
>>>>
>>>>
>>>> >>>> >>>> >>>>--------------070808020900080005070500-- >>>> >>>> >>>> >>> >>> >>> >>-- >>Jim Redman >>(505) 662 5156 x85 >>http://www.ergotech.com >>_______________________________________________ >>Rxtx mailing list >>Rxtx at qbang.org >>http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > >cheers >YiQi Huang >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/61d4d4c9/attachment-0398.html From impakt01 at optusnet.com.au Wed May 31 17:02:54 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 09:02:54 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Message-ID: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Hi all, I downloaded 2.1.7-pre16 and managed to build it and get it going. I made the changes as suggested by Peter Smith in an old post, by adding his code to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. Still not working, it opens the port at 9600 according to portmon.exe . Has anyone managed to get this going at a custom rate? Here is the post I'm referring to: http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 Thanks, Daren ________________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Daren Sent: Wednesday, 31 May 2006 10:56 PM To: rxtx at qbang.org Subject: [Rxtx] (no subject) Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren From tjarvi at qbang.org Wed May 31 21:44:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 May 2006 21:44:01 -0600 (MDT) Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> References: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Message-ID: On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org From impakt01 at optusnet.com.au Wed May 31 22:06:04 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 14:06:04 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: Message-ID: <200606010406.k51464X2010447@mail03.syd.optusnet.com.au> Trent, I have managed to successfully open the port at this speed using Realterm (available on sourceforge). From memory this uses DLPortIO. Using portmon.exe with realterm, even there it says that the port has opened at 1953. I changed termios.c:560 to dcb->BaudRate = 1953 ; and it still opens the port at 9600. Daren -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Thursday, 1 June 2006 1:44 PM To: RXTX Developers and Users Subject: Re: [Rxtx] custom baud rate win32 On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From smontgomery at mediaspansoftware.com Mon May 1 09:52:28 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 11:52:28 -0400 Subject: [Rxtx] RXTX, Java COMM and Windows Server 2003 on x64 experiences? Message-ID: Just wondering if anybody here has had to deploy RXTX or the javax.comm on Windows Server 2003 machines running on x64 (i.e. Xeon EM64T) and would like to relate how things went. From Sun's site, the Supported System Configurations pages give the options for that system: Java 5.0: - 32-bit Java 5.0 running on the OS in the 32-bit mode - 64-bit Java 5.0 running on the OS in the 64-bit native mode Java 1.4.2: - no options listed for EM64T processors, but potentially the standard 32-bit Java 1.4.2 could run on the OS in 32-bit mode? I guess the two main points of failure would be 1) the JVM itself and 2) the jni components. Make that three: there's gotta be hardware vendor driver support for the OS in the various modes, too. Guess I better go look at Keyspan's website... Thanks in advance for any info anyone might be able to provide. From smontgomery at mediaspansoftware.com Mon May 1 10:18:33 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 12:18:33 -0400 Subject: [Rxtx] Mailing list archive out of date? Message-ID: The mailing list archive at: http://mailman.qbang.org/pipermail/rxtx/ only shows emails through the end of March. Is there a new archive somewhere else? Didn't see anything mentioned on the wiki. From p.cain at phasefale.com.au Mon May 1 22:33:09 2006 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 02 May 2006 14:33:09 +1000 Subject: [Rxtx] RXTX and the Linux kernel. Message-ID: <4456E105.5080106@phasefale.com.au> Hi, First off the problem I am having isn't caused by RXTX itself but I'm hoping someone out there may have some knowledge that may help me. Background: I have an application monitoring a control system through a standard PC serial port which I talk to with rxtx-2.0.5. The application runs on RedHat7.3 kernel version 2.4.18 using Java 1.4. This configuration has been in use for several years and has proved to be stable. But it has become necessary for me to upgrade the OS but I'm running into problems with the serial communications. Its not that the comms don't work on the new OS (its never that simple) the comms work for a variable period of time (sometimes several hours) and then just stop, nothing on the data lines and control lines all indicate that data could flow. The new OS is Ubuntu 5.10 running kernel version 2.6.12. I have installed the OS and software on a PC and had it perform ok, then install the new OS and same software on the very same hardware and experienced the problems of them comms stopping. In the new OS I'm using Java5 to run the app but since I have experience the problem I reverted back to Java1.4 which didn't fix the problem. I've moved the app to a different system RedHat FC3 running 2.6.14 had experienced the problem. Not wanting to go through all the thing I have tried but I have established that it seems to be the 2.6 versions of the kernel that seem to be the problem and not an individual distribution of Linux. I should point out that I am using the same jar and library files for each java and OS combination. So I'm just wondering if anyone has had or heard of problems similar to these ? Or perhaps might know of what changed in the Linux serial driver (something I'm having a hard time establishing). I'm starting to run low on ideas of what to try so any help would be much appreciated. -- Peter Cain Senior Programmer Phasefale Pty Ltd From tjarvi at qbang.org Wed May 3 07:31:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 May 2006 07:31:00 -0600 (MDT) Subject: [Rxtx] Re: Concering ircomm and RXTX In-Reply-To: References: Message-ID: On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From legolas.w at gmail.com Wed May 3 08:46:23 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 19:16:23 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <4458C23F.2000003@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From legolas.w at gmail.com Wed May 3 13:10:57 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 23:40:57 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <44590041.80706@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From Lars.Hennig at wow-portal.com Thu May 4 00:39:15 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Thu, 4 May 2006 08:39:15 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: Message-ID: Hi, I could not find any solution. I therefore decided to to my own native implementation. Allthough it only supports the functions I need, it works pretty well now for me. I think the main problem there is the use of a wrong Windows API function and not setting an timeout. Regards, Lars Hennig W?rth Online World GmbH Tel. (0049)7181-258183 Mob. (0049)160-3522889 Fax. (0049)7940-153299 Lars.Hennig at wow-portal.com Gesendet von: rxtx-bounces at qbang.org 09.04.2006 10:42 Bitte antworten zu RXTX Developers and Users An d.herwald at dsh-elektronik.de, RXTX Developers and Users Kopie Thema Re: [Rxtx] USB Serialport - disconnection problems WV Proj./Teilpr.: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/7b39f374/attachment-0403.html From Pawan.Kharbanda at dot.state.co.us Thu May 4 11:00:58 2006 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Thu, 4 May 2006 11:00:58 -0600 Subject: [Rxtx] Dangling Lock Files Message-ID: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Hi, I have been using RXTX API's for the Serial Communication for quite some time now and for some of the devices we are opening and closing the connection every 2 minutes. This works great for few days and then suddenly I start seeing some "Port in Use Exception" and I see that the Lock files are still in the /var/lock folder after manually removing the lock files it works good for few hours and I see the same problem again. Can somebody explain me the scenarios why I am seeing the dangling Lock files? I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise Servers. Thanks Pawan Kharbanda -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/ba0e9261/attachment-0403.html From tjarvi at qbang.org Thu May 4 14:10:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:10:30 -0600 (MDT) Subject: [Rxtx] Dangling Lock Files In-Reply-To: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> References: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Message-ID: On Thu, 4 May 2006, Kharbanda, Pawan wrote: > Hi, > I have been using RXTX API's for the Serial Communication for quite > some time now and for some of the devices we are opening and closing the > connection every 2 minutes. This works great for few days and then > suddenly I start seeing some "Port in Use Exception" and I see that the > Lock files are still in the /var/lock folder after manually removing the > lock files it works good for few hours and I see the same problem again. > Can somebody explain me the scenarios why I am seeing the dangling Lock > files? > > I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise > Servers. Hi Pawan The next time it happens, look in the lockfile. There will be a pid. ps aux |grep 'pid' I think you will see that the application is still running for some reason. RXTX does a kill -0 on the pid to see if its alive. If not, it will remove the lockfile. So I suspect the previous program did not exit as you expected. -- Trent Jarvi tjarvi at qbang.org From Scott.Hughes at dalsemi.com Thu May 4 14:23:11 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 4 May 2006 15:23:11 -0500 Subject: [Rxtx] Wiki instructions... Message-ID: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire demo apps, when I stumbled across this tip on the wiki to add yourself to the uucp group: It may be simpler to just run usermod -G uucp jarvi Taken from: http://rxtx.qbang.org/wiki/index.php/Installation This does not work as advertised. I should have read the man page for usermod before I tried that out. If there are any groups which are not listed after the -G switch, the user is removed from those groups. On Ubuntu, this is bad... I removed myself from the Admin group, which removed my sudo priviledges. Ubuntu has no root account, so I've disabled the only account which could fix it. Anyone know of a good workaround? Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor From tjarvi at qbang.org Thu May 4 14:32:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:32:09 -0600 (MDT) Subject: [Rxtx] Wiki instructions... In-Reply-To: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> Message-ID: On Thu, 4 May 2006, Scott Hughes wrote: > I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire > demo apps, when I stumbled across this tip on the wiki to add yourself to > the uucp group: > > It may be simpler to just run > > usermod -G uucp jarvi > > Taken from: > http://rxtx.qbang.org/wiki/index.php/Installation > > This does not work as advertised. I should have read the man page for > usermod before I tried that out. If there are any groups which are not > listed after the -G switch, the user is removed from those groups. On > Ubuntu, this is bad... I removed myself from the Admin group, which removed > my sudo priviledges. Ubuntu has no root account, so I've disabled the only > account which could fix it. > > Anyone know of a good workaround? > Yikes This will get your permissions back: in grub/lilo/.. pass the following option to the kernel init=/bin/sh You are now root. when it boots, mount -o remount,rw / add yourself to the groups, reboot to get normal init going. Thats about all I can think of without sudo/root. -- Trent Jarvi tjarvi at qbang.org From Gettings at earth.utah.edu Thu May 4 14:41:22 2006 From: Gettings at earth.utah.edu (Paul Gettings) Date: Thu, 4 May 2006 14:41:22 -0600 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <20060504204122.GA6534@earth.utah.edu> When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get messages on stdout from the JVM: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 As the only change was the version of RXTX (from 2.1.6), I am unsure why the messages suddenly appeared. Anyone know how to get rid of them? Thanks. -- 101 USES FOR A DEAD MICROPROCESSOR (23) Dead cat brush From mmester at sps.edu Mon May 1 21:22:28 2006 From: mmester at sps.edu (Michael Mester) Date: Mon, 1 May 2006 23:22:28 -0400 Subject: [Rxtx] Windows PortInUseException Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> I'm trying to get simple serial communication going with RxTx under Windows XP. I can enumerate the ports fine, but I always run into problems when I try to open one. I get a PortInUseException, but the owner application is "Unknown" and the port is never open. I've tried this on several different systems and all of them give the same behavior. The only thing I can thiunk of that might be causing the problem is that fact that I had to put the serial .dll file in system32 instead of the reccommended folder, because it didn't work in the folder the documentation gives. The library loads fine, though, so I'm not sure whether that makes sense, and I don't know how to fix it anyway. Any help is greatly appreciated. Below is the output of the program, right up to the PortInUseException and the NullPointerException it causes (because the serial port object is not instantiated). C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI Starting GPSTalkerGUI... Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 gnu.io.PortInUseException: Unknown Application Exception in thread "main" java.lang.NullPointerException at GPSTalkerGUI.(GPSTalkerGUI.java:102) at GPSTalkerGUI.main(GPSTalkerGUI.java:161) Again, thank you very much for any help you can give. From lshellman at qwest.net Wed May 3 01:38:34 2006 From: lshellman at qwest.net (Lucious Shellman) Date: Wed, 03 May 2006 01:38:34 -0600 Subject: [Rxtx] Help needed: Project using parallel port Message-ID: <1146641914.8337.14.camel@localhost.localdomain> I was looking for a way to access the parallel port on a PC using Java. Searching the Internet, I came across this site (rxtx.org). What I am trying to do is detect logic levels from a TTL logic IC on the parallel port. I am not trying to do classic parallel port communication. I just want to detect whether a line(s) is (are) high or low. I am using Windows 98. Can rxtx be used to do this? If yes, is there a tutorial for using rxtx posted on the Internet that someone can direct me to. If you need more information, feel free to e-mail me. Unfortunately for me, I need the information ASAP. Thanks. lshellman at qwest.net From webmaster at egyhelp.com Wed May 3 18:43:39 2006 From: webmaster at egyhelp.com (Mohamed Samy) Date: Thu, 4 May 2006 02:43:39 +0200 Subject: [Rxtx] RE: Concering ircomm and RXTX In-Reply-To: Message-ID: <20060503184362.SM01044@Geek> Hey, I issue the command "modprobe ircomm-tty" yet no ttyircomm appears, while the ircomm appear by "modprobe ircomm" so forgive me but I am bit lost. Even searching google for the keyword "ttyircomm" only returns 3 matches. So any way I can start the ttyircomm???? Thanks a lot. -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Wednesday, May 03, 2006 3:31 PM To: Mohamed Samy; rxtx at qbang.org Cc: taj at www.linux.org.uk Subject: Re: Concering ircomm and RXTX On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 4 15:49:49 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 15:49:49 -0600 (MDT) Subject: [Rxtx] Windows PortInUseException In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> Message-ID: On Mon, 1 May 2006, Michael Mester wrote: > > I'm trying to get simple serial communication going with RxTx under > Windows XP. I can enumerate the ports fine, but I always run into > problems when I try to open one. I get a PortInUseException, but the > owner application is "Unknown" and the port is never open. I've tried > this on several different systems and all of them give the same > behavior. The only thing I can thiunk of that might be causing the > problem is that fact that I had to put the serial .dll file in system32 > instead of the reccommended folder, because it didn't work in the folder > the documentation gives. The library loads fine, though, so I'm not sure > whether that makes sense, and I don't know how to fix it anyway. Any > help is greatly appreciated. Below is the output of the program, right > up to the PortInUseException and the NullPointerException it causes > (because the serial port object is not instantiated). > > C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI > Starting GPSTalkerGUI... > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > gnu.io.PortInUseException: Unknown Application > Exception in thread "main" java.lang.NullPointerException > at GPSTalkerGUI.(GPSTalkerGUI.java:102) > at GPSTalkerGUI.main(GPSTalkerGUI.java:161) > Perhaps you are trying to open the port twice in your code? rxtx does open the ports, do a timed out read and then close the ports during enumeration. I think the port is being opened fine. The Unknown Application is always reported. On linux, there is some code that finds the actual application but on windows, its always unknown. If the port enumeration is returning the ports you expect, rxtx has opened the port and closed it with success. The port should open. There is also example code in the contrib directory that comes with rxtx source that has examples you can modify to work. -- Trent Jarvi tjarvi at qbang.org From Christian.Klemke at t-online.de Thu May 4 23:37:23 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Fri, 5 May 2006 07:37:23 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu> Message-ID: <004f01c67005$fc72fee0$016a10ac@NB600> Hi Paul, I was wondering about the same question some days ago and took a look at the source files. Unfortunately, I found that you can only get rid of that messages by altering and recompiling the Java code. There is a final static boolean variable called "devel" in the file "RXTXCommDriver.java" which is set to "true". This constellation causes the output after the native libraries have been loaded. No mechanism exists to suppress them otherwise :-(. Trent, does that mean that 2.1.7 is still officially a "development" version ? When will this value be changed to "false" by default ? With 2.1.8 ? It would be nice to provide a means to suppress such messages besides that static flag (maybe by setting a property called "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The output can indeed by annoying, especially when used with console applications, where the message potentially appears "in the middle" of your own output. Another possibility would be not to use System.out directly, but instead some PrintStream field which is initially set to System.out but can programatically be changed. That would allow for any kind of redirection or suppression by implementing appropriate user-defined PrintStream subclasses and making RXTX use that stream. What do you think ? Best regards, Christian ----- Original Message ----- From: "Paul Gettings" To: Sent: Thursday, May 04, 2006 10:41 PM Subject: [Rxtx] RXTX causing stdout messages > When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get > messages on stdout from the JVM: > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > As the only change was the version of RXTX (from 2.1.6), I am unsure > why the messages suddenly appeared. Anyone know how to get rid of > them? > > Thanks. > > -- > 101 USES FOR A DEAD MICROPROCESSOR > (23) Dead cat brush > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri May 5 06:09:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 06:09:46 -0600 (MDT) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <004f01c67005$fc72fee0$016a10ac@NB600> References: <20060504204122.GA6534@earth.utah.edu> <004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: On Fri, 5 May 2006, Christian Klemke wrote: > Hi Paul, > > I was wondering about the same question some days ago and took a look at the > source files. Unfortunately, I found that you can only get rid of that > messages by altering and recompiling the Java code. There is a final static > boolean variable called "devel" in the file "RXTXCommDriver.java" which is > set to "true". This constellation causes the output after the native > libraries have been loaded. No mechanism exists to suppress them otherwise > :-(. > > Trent, does that mean that 2.1.7 is still officially a "development" version > ? When will this value be changed to "false" by default ? With 2.1.8 ? It > would be nice to provide a means to suppress such messages besides that > static flag (maybe by setting a property called > "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The > output can indeed by annoying, especially when used with console > applications, where the message potentially appears "in the middle" of your > own output. Another possibility would be not to use System.out directly, but > instead some PrintStream field which is initially set to System.out but can > programatically be changed. That would allow for any kind of redirection or > suppression by implementing appropriate user-defined PrintStream subclasses > and making RXTX use that stream. What do you think ? > A patch for using properties would be accepted I'm sure. The reason the default is to display the message is not related to the development state of rxtx anymore. The problem is that people first using rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. The message prevents a great deal of email thats easily explained by the message. I question if we should support rxtx 2.0 at all anymore. If you post a patch in bugzilla, we'll put it into CVS this weekend. we'll be going through and doing such things anyhow. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri May 5 13:23:56 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 13:23:56 -0600 (MDT) Subject: [Rxtx] How to read from RxTx parallel port in Win XP In-Reply-To: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> References: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> Message-ID: On Thu, 27 Apr 2006, Worsley, Bob (Development Engineer) wrote: > I'm sorry if this is a dumb question, but I didn't find the answer in > the archives. > > I'm using the RxTx binaries for Windows on a reasonably current notebook > PC running Windows XP. I can send stuff to a printer on the parallel > port (LPT1), but I can't get anything back. > > I wrote a class that has the methods listed below. I write some data to > the printer with the "write" method and then try to read a response > using the "read" method, but I never get any data. I'd greatly > appreciate any help you can give! > > Bob Worsley > bobwoyid2 at yahoo.com > > > > > private ParallelPort parallelPort = null; > private RXTXCommDriver parallelPortDriver = null; > > > public boolean initialize() throws IOException { > if (parallelPort != null) { > return false; // Already initialized > } > > // Create the parallel port; > parallelPortDriver = new RXTXCommDriver(); > parallelPort = > (ParallelPort)parallelPortDriver.getCommPort(address, > CommPortIdentifier.PORT_PARALLEL); > > // Set the parallel port parameters. > try { > parallelPort.enableReceiveTimeout(READ_TIMEOUT); > parallelPort.disableReceiveFraming(); > parallelPort.disableReceiveThreshold(); > //parallelPort.setMode(mode); !!!!errors > } catch (UnsupportedCommOperationException e) { > throw (new IOException("Parallel port with address '" + > address > + "' cannot be configured as specified")); > } > > return true; > } > > > > public void write(final byte[] bytes) throws IOException { > initialize(); > while (busyReading) { > Thread.yield(); > } > busyWriting = true; > if (bytes.length < 1) { > return; > } > OutputStream outputStream = parallelPort.getOutputStream(); > outputStream.write(bytes); > outputStream.flush(); > outputStream.close(); > Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); > busyWriting = false; > } > > > public byte[] read() throws IOException { > > // Read up to MAX_BYTES bytes. > initialize(); > while (busyWriting) { > Thread.yield(); > } > busyReading = true; > byte[] buff = new byte[MAX_BYTES_READ]; > InputStream inputStream = parallelPort.getInputStream(); > // This read blocks until input data is available > int bytesRead = inputStream.read(buff); > inputStream.close(); > // If no data read, create empty array > if (bytesRead == -1) { > bytesRead = 0; > } > byte[] deviceBytes = new byte[bytesRead]; > System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); > if (bytesRead > 0) { > Debug.p("PPIOP.read - got data: '" + new > String(deviceBytes) + "'"); > } > busyReading = false; > return deviceBytes; > } > Hi Bob I've only used rxtx to test a hello world page printing but there are others that have used it. PPIOP? hmm what is this? :) The rxtx parallel support is behind the serial support but should be OK. As you note, the setting of modes is not supported. rxtx uses what is provided when the port is open. Are your asserting the pin for the printer being online? I suspect what often happens is people try to just use the data pins but the C API rxtx uses wants the printer to be online. There should be some posts relating to this in the rxtx mail-list archive. Some APIs are probably reading and writing from the port address (also suggested in your code as something you are looking at). RXTX currently uses a higher level C/C++ API for port access. This can still work if the API thinks the 'printer' is there. -- Trent Jarvi tjarvi at qbang.org From agrodellic at gmail.com Sat May 6 08:39:40 2006 From: agrodellic at gmail.com (Leigh Stewart) Date: Sat, 6 May 2006 10:39:40 -0400 Subject: [Rxtx] sun commapi 3 Message-ID: I think I read here: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html that rxtx-2.0 is basically fracked for now? Does anyone know of a workaround? ie can i somehow get an older version of sun's comm api and use that (not easy to find)? i mean 2.0 must be working for someone...how is it being tested. 2.1 isnt working for me....im getting nasty native exceptions etc, which is why im so set on 2.0... any ideas? From tjarvi at qbang.org Sun May 7 15:40:27 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 7 May 2006 15:40:27 -0600 (MDT) Subject: [Rxtx] sun commapi 3 In-Reply-To: References: Message-ID: On Sat, 6 May 2006, Leigh Stewart wrote: > > 2.1 isnt working for me....im getting nasty native exceptions etc, > which is why im so set on 2.0... any ideas? > Hi Leigh What native exceptions are you seeing? Which OS? The native code is almost identical between rxtx 2.0 and 2.1. Only the names have been changed to protect the inocent. :) ie: javax_comm_... vs gnu_io_... So the odds are very likely that even if you do find commapi 2.0 and get it installed, you will run into the same error. It would be better to just find and fix the problem. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Mon May 8 10:47:20 2006 From: mail at willicon.de (WILLICon) Date: Mon, 08 May 2006 18:47:20 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 Message-ID: <445F7618.3070303@willicon.de> Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/ef37e8ec/attachment-0403.html From tjarvi at qbang.org Mon May 8 16:14:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 May 2006 16:14:51 -0600 (MDT) Subject: [Rxtx] Screenshot of Application using RXTX (fwd) Message-ID: Just though someone may end up searching for 0x0D and 0x0A. Here are the details from his system. SuSE Linux 10.0 (x86_64) Kernel 2.6.13-15.8 j2se 1.4.2_11 (i586) Sun: comm3.0_u1 rxtx: rxtx-2.1-7 ---------- Forwarded message ---------- Date: Sat, 6 May 2006 20:01:46 +0200 From: Michael Poppitz To: taj at www.linux.org.uk Subject: Screenshot of Application using RXTX Hi Trent, the rxtx package works like a charm. Sun's package seemed to replace all 0x0D with 0x0A in received data on my Linux box, which is really annoying when transfering binary data. But rxtx came and saved the day - and turned out to be a lot more convenient as it does not require a configuration file. I use it for connecting to a home made logic analyzer. (http://www.sump.org/projects/analyzer/) Thanks for your great job, Michael -------------- next part -------------- A non-text attachment was scrubbed... Name: la_client.png Type: image/png Size: 16592 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/45494fbb/la_client-0403.png From tjarvi at qbang.org Tue May 9 14:56:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 May 2006 14:56:05 -0600 (MDT) Subject: [Rxtx] RXTX javax.comm: which one to install? In-Reply-To: <20060509161742.43547.qmail@web53814.mail.yahoo.com> References: <20060509161742.43547.qmail@web53814.mail.yahoo.com> Message-ID: On Tue, 9 May 2006, Adenilson Cavalcanti wrote: > Dear Trent Jarvi > > I'm trying to write a small Java app running in linux that interfaces with a device connected to serial port. > > I do have some questions about RXTX and javax.comm state of affairs, since I'm new to Java programming (used to program in plain old C writting to devices using termios and open/write/read syscalls, but this is another story). > > I ask you the favor to clarify this issues (if possible...): > > a) Sun offers to download a file (comm3.0_u1_PUTAUNIXVERSION.zip) which does contain .so files. Does it work out of box? > > b) Case negative, its there that we should use 'librxtx*.so' provided by your site? > > c) Sun's comm3 API version does work with which version of rxtx? > > I already searched google and read documentation available in rxtx site ("Java Comm Serial API How-to") but still have this issues unsolved. Any help will be appreciated. > > Best regards > > Adenilson Hi Adenilson, RXTX does not currently support javax.comm in Sun's CommAPI 3.0. I would recommend using package gnu.io provided by rxtx 2.1. -- Trent Jarvi tjarvi at qbang.org From chris.develder at intec.ugent.be Wed May 10 08:45:40 2006 From: chris.develder at intec.ugent.be (Chris Develder) Date: Wed, 10 May 2006 16:45:40 +0200 Subject: [Rxtx] rxtx troubles on ARM Message-ID: <4461FC94.6040909@intec.ugent.be> Hi all, Sorry to bother you, but I don't seem to get RXTX working on an ARM processor (xscale ixp 425, big endian). I managed to crosscompile the rxtx libs and moved it over to the ARM. Using jamvm (which is the only open source java VM we got working on the ARM), I get the following error result when running SimpleRead from Sun's javax.comm examples (commapi\examples\Simple\SimpleRead) -- see bottom of mail for complete output: "java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver" However, output shows that the RXTXCommDriver code is accessible (cf. debug and devel output of lib versions). So it doesn't seem to be a missing lib/jar issue. The error happens before RXTXCommDriver.initialize() is called, since the first line there is System.out.println("RXTXCommDriver:initialize()"); Any ideas? Cheers, Chris ---------------------------- [root at xxx(ttyp1) /work/cdvelder/xscale/test]# jamvm -Djava.library.path=/work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/jre/lib/arm -classpath /work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/lib/ext/RXTXcomm.jar:./comm.jar:. SimpleRead RXTXCommDriver {} Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTXCommDriver: Jar version = RXTX-2.1-7 native lib Version = RXTX-2.1-7 java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver gnu/io/RXTXCommDriver at javax.comm.CommPortIdentifier.loadDriver (CommPortIdentifier.java:239) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:109) at SimpleRead.main (Unknown Source) java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive (Native Method) at com.sun.comm.Portmapping.registerCommPorts (Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase (Portmapping.java:100) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:138) at SimpleRead.main (Unknown Source) From joachim at buechse.de Fri May 12 00:44:48 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 08:44:48 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) Message-ID: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Good day, I guess that only a selected few (hi Trent) will be able to answer this question, but the answer might be interesting for anyone trying to debug or understand the code. Apparently the MonitorThread is started and stopped in RXTXPort.addEventListener and RXTXPort.removeEventListener. This would indicate that (originally?) the MonitorThread is only required when there is an EventListener. However the MonitorThread is also started in the RXTXPort constructor, which could mean that RXTX won't work at all if it isn't there. It seems to me, that if anyone would add an event listener and later on remove it, he could potentially wreak the port. Because the second action would kill the MonitorThread. For the moment I am only trying to understand the role of and idea behind the MonitorThread. But of course there is a deeper reason thor my question: If the MonitorThread needs to exist anyway, it could be the thread that cleans up the port (ie calls nativeClose) - this would eliminate (a further) problem I am seeing with some USB drivers on Mac OSX. (Close blocks (after releasing the tty, but still) in the USB driver if the device is "not responding"). Greetings, Joachim From tjarvi at qbang.org Fri May 12 07:10:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 12 May 2006 07:10:59 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Fri, 12 May 2006, Joachim Buechse wrote: > Good day, > > I guess that only a selected few (hi Trent) will be able to answer > this question, but the answer might be interesting for anyone trying > to debug or understand the code. > > Apparently the MonitorThread is started and stopped in > RXTXPort.addEventListener and RXTXPort.removeEventListener. This > would indicate that (originally?) the MonitorThread is only required > when there is an EventListener. However the MonitorThread is also > started in the RXTXPort constructor, which could mean that RXTX won't > work at all if it isn't there. > > It seems to me, that if anyone would add an event listener and later > on remove it, he could potentially wreak the port. Because the second > action would kill the MonitorThread. > > > For the moment I am only trying to understand the role of and idea > behind the MonitorThread. But of course there is a deeper reason thor > my question: > > If the MonitorThread needs to exist anyway, it could be the thread > that cleans up the port (ie calls nativeClose) - this would eliminate > (a further) problem I am seeing with some USB drivers on Mac OSX. > (Close blocks (after releasing the tty, but still) in the USB driver > if the device is "not responding"). > Hi Jaochim Before commapi, rxtx did not support events. You could read, write and change port settings. The MonitorThread was added as an afterthought to support commapi events. So the way things are now his historical spaghetti not a well devised plan. It is my opinion that the MonitorThread should exist as long as the port is open. The odd starting of the thread in the constructor and addEventListener was just to get past the obvious problem of people using the port without adding listeners. -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Fri May 12 07:59:50 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 15:59:50 +0200 Subject: [Rxtx] MonitorThread -> ChangeRequest In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: <2B1E508C-8CEE-4AB7-914D-E7BA25C871A2@buechse.de> In this case I suggest removing the starting/stopping of MonitorThread in addEventListener / removeEventListener. This should not affect existing projects. On 12.05.2006, at 15:10, Trent Jarvi wrote: > It is my opinion that the MonitorThread should exist as long as the > port > is open. The odd starting of the thread in the constructor and > addEventListener was just to get past the obvious problem of people > using > the port without adding listeners. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Fri May 12 11:43:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 19:43:21 +0200 Subject: [Rxtx] Spring Cleaning - some suggestions Message-ID: The current implementation of RXTX contains quite a lot of code that will break if it is used from several threads (especially on a multi processor machine). I think it would be nice to clean this up. I suggest the following changes (which keep the current semantics and should not influence existing projects in a negative way): - InterruptedException will never be ignored or reset - read methods will be protected with a Monitor - write methods will be protected with a (separate) Monitor - close() sets the read and write monitors into a "closed" state which will lead to IOExceptions for any following call to RXTXPort.read/write. - close() will wait a finite amount of time (maybe 500ms) for the release of the read and write monitors after that, it will trigger the closing of the file descriptor to abort any pending read or write. - close() will not call close(file_desc). Instead it will "interrupt" (ie set a flag and then, pthread_kill(ABRT)) the MonitorThread, the MonitorThread will call close(file_desc). - the monitors are properly released in a finally block the try of which starts directly after obtaining the monitor. - finally will not call close(file_desc) it will only "interrupt" the MonitorThread (see above) - the native-code (esp read) does not use SA_RESTART but checks Thread.interrupted() when it receives a SIGNAL (ie system call returns with EINTR or other signalling method). The read/write monitors will be allocated from a factory whose mode can be set to fast/normal/advanced. In fast-mode it will create "non thread safe, non synchronized" pseudo-monitors. In default mode, the monitors will store the owning thread. In "advanced" mode setting the monitors into closed state will "interrupt()" threads which are blocked in a native read/write. {Reasoning close behaviour: Calling close on a file descriptor in Windows unblocks any read() or write() on the same file descriptor with an error. On Solaris < 2.7 and MacOS X however the close() will/ can block - until the read or write have finished:-(( Even the JDK people have trouble with this. I dont know how Linux reacts in this case. The best practice for BSD/Solaris is to send a signal to the thread which will usually unblock the read/write with an EINTR - this however is not guarenteed as it also depends on the device driver. So the only resolution that will certainly not block the thread calling RXTXPort.close() (which will often enough be the AWT event dispatcher or the VM finalizer thread) is to call close(fd) from another thread.} {Reasoning read behaviour: It is rather uncommon to receive a signal while reading or writing - it will happen, but checking Thread.interrupted() when it happens will not degrade performance. The checking of Thread.interrupted() can be handled by returning to Java and potententially reentering into the native code if the thread was not interrupted or by calling back into the VM from the native code. On top of this, many functions like read(byte[]) or read(byte [], int, int) are allowed to return less than the requested amount of data. Only int read() is a bit more tricky. } [Trent: From the code I can tell, that you experimented quite a bit with signals. Do you know if the Java Thread.interrupt() triggers a unix signal on Linux/Solaris? If so, which one?? References: - http://java.sun.com/docs/hotspot/VMOptions.html - http://www.hp.com/products1/unix/java/infolibrary/prog_guide/ signals.html ] On OS X (hotspot client jdk-1.4.2) I did not see any signal propagated to the SELECT of the event_loop/MonitorThread (ie no EINTR) when I call monThread.interrupt(). This is a pitty, but thats the way it is. I simply assume this is true for most system calls. How to handle this? Of course it would be possible to install/ deinstall a specific signal handler before/after every native read and to natively send an ABRT signal if RXTXPort.close is called. A more elegant solution might be to have an additional "signaling" socket which is always included in the SELECT. Or the simplest solution: cap the timeout of the select to 500 ms (the loop around it exists already) after every timeout check the Thread.interrupted() flag. From a performance perspective this should be completely invisible... On the other hand, all write() calls need to be preceeded by a SELECT as well, to avoid running into a blocking write. Best regards, Joachim From lyon at docjava.com Sat May 13 05:54:52 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 13 May 2006 07:54:52 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Dmitry suggests that we acquire an implementation of a serial port reference, use it, then release it (i.e., check it back in). Joachim says that making serial ports thread friendly might be a good idea. This is a good idea. The design pattern that is close to this idea is the "Object Pool Design Pattern". # Object Pool Manage the reuse of objects for a type of object that is expensive to create or only a limited number of a kind of object can be created. It has been described at: http://www.developer.com/java/ent/article.php/626171 and in Marks' book, Patterns in Java, Volume 1. However, the Object Pool is intended to pool objects so that each object is just like every other object. The intent of the Parametric Singleton is to enable others to access the same resource at the same time (as long as the same parameters were used in construction). It sounds like we need a NEW Design Pattern (Oh no, Doug is doing it again!). Yes friends, you got me on a role (roll) :) If you like design patterns, you can thank me later. If you don't like design patterns, blame Dmitry, it was his idea ;) And Dave, thanks for the feedback on Singleton abuse. It has led me to change the way I think about application contexts, which we will see, below. We need (drum roll please): The Parametric Object Pool Design Pattern (POP) By Douglas A. Lyon ABSTRACT The goal of the Parametric Singleton design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values, in a given context. In comparison, the goal of the POP design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values and that only one reference to the class is checked out at a time, in a given context. A context is a namespace for holding identifiers during execution. In Java, A context can be changed in any of several ways. For example, creation of a new class loader, the deserialization of an old POP or the creation of a new process all create a new namespace. The POP Design Pattern combines the Parametric Singleton Design Pattern with the check out mechanism of the Object Pool Design Pattern. This enables unique creation of instances of a class. These instances are cached in a table. When a clients asks for an instance with these parameters, the cache is checked. If the instance is not in the cache it is created. If the instance is available, the clients checks out the instance. A reference is left to the clients that checked out the instance. The POP has the role of creating objects uniquely, from parameters. It also has the role of keeping track of which clients has checked out a given object. This is just like a library keeping track of who borrowed a book. If a resource is left unavailable in a system, a deadlock can occur. Deadlock debugging is facilitated by mapping a resource to the clients that have checked it out. We apply our POP Design Pattern to the retrieval of serial ports. The goal of our system is to make sure that serial ports are checked out to only one client at a time, and that they be checked back in when the client is done. The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. Users are discouraged from calling this the Parametric Object Oriented Pool (POOP). Introduction The intent of the POP Design Pattern is to ensure that a class has only one instance for a given set of parameter values. It also provides a point of access that is global to a given context. The POP uses the Singleton Design Pattern to ensure that there is only one POP, in the given context. The POP DP is responsible for checking out a reference to a given instance, and keeping track of that instance. The instance is responsible for sharing that instance. POP requires that users of the DP implement an interface that enables a recall facility. Thus, if there is a contention for a consumed resource, the deadlock can be resolved in an orderly fashion. Motivation A system cannot tolerate multiple instances of some classes with identical parameters used by different instances at the same time. For example, you cannot have two instances use the same serial port, at the same time. You cannot have two instances that are trying to listen to the same socket connection. You cannot have two instances writing to the same file structure at the same time. Further, once a serial port is checked out by a client, it is assigned to the client. This is like the spin-lock service provided by the operating system, only in the application layer. Naturally, deadlock will occur if a resource is not released, therefore the client of the resource is tracked. Recalling a resource is required for the POP DP by virtue of the implementation of an interface. The policy on how to break a deadlock (by honoring the recall) is application specific. As the operating system is often thought of as the arbiter of consumed resources (i.e., tape drives, serial ports, etc.) we frequently leave it to an operating system implementation to resolve these contention issues. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on naming conventions (which are not well standardized). The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. The POP Design Pattern can take on the role of the peer method mapper that homogenizes the API for different operating environments. That is, it can wrapper the different locking mechanisms used in different operating systems. POP that is responsible for keeping track of the instances created and the client that has checked them out. The POP Design Pattern is implemented using the Singleton Design Pattern. In Java, the POP implementation is declared final, so that it cannot be subclassed. The class also has a private constructor, so that other classes cannot instance it. The new design pattern is called the POP design pattern and it provides a way to check out and create instances with given parameters. Applicability Use the POP Design Pattern when: 1. There must be exactly one instance of a class with the given parameters in a given context. 2. The instances must be accessible to clients from a well-known access point. 3. The instances are reusable. 4. Only one client can check out an instance at a time. Structure Insert UML diagram here. Participants The POP Clients that need instances 1. The POP defines an instance upon request from a client, if, and only if, the instance does not already exist. 2. The POP returns the instance to the client. 3. The POP is responsible for creating unique instances from given parameters. 4. The POP is responsible to recalling instances from clients. Collaborations Clients obtain a reference to a POP instance only through the singleton design pattern. If the POP instance is left in an improper state (e.g., the serial port was left open) it is NOT the role of the POP to close the IO port. However, the POP can be requested to get the instance released. Nor is it the role of the POP Design Pattern to open the port. That role is delegate to some other part of the system. Further, it is the role of the POP Design Pattern to check out resources. However, it is still possible to have, multiple threads that have multiple references to the same resource at the same time. Checkout and resource requests are MUTEX locked (i.e., synchronized). Consequences The POP Design Pattern has several benefits: 1. Controlled access to parametrically defined instances. Since the POP encapsulates its instances, there is some limited control over how and when clients access it. 2. Reduced name space. The POP pattern avoids global variables that store instances created from the same parameter. Implementation Here are implementation issues to consider when using the POP pattern: 1. Unique mapping of parameters. The POP pattern requires that there be a mean to isomorphically map the parameter space into the instance space and back again. 2. Ensure unique instances. The POP pattern makes unique instances from parameters, and it does so only once. 3. Cache instances for fast retrieval. The POP must be able to look up instances, given some set of parameters, and do so from some data structure. That is, there must be enough space to hold references to all the instances the program will need. Also, a mechanism is needed to look up and retrieve the instances quickly enough to satisfy the clients. Sample Code To be written....any volunteers? Thanks! - Doug >I don't think I get it > >On Mar 22, 2006, at 9:36 AM, David Garnier wrote: >>Using the singleton pattern in this case is >>just convenient for the programmer. Problems >>arises >>pretty quickly, especially if you attempt to unit-test your classes. > > >so you're saying that something isn't so good >because you can not test it in the convenient >way? >if that's true, I'm totally disagree >change your test, debug whatever, but if >software is efficient at runtime, works fine and >only problem is some unit test >(which is some kind of framework for testing) >then dump that unit test , dump that unit >framework and make something appropriate to the >software >you're testing > >so if Douglas want to use singletons, what's the problem? >and what do you mean by abusing of singleton usage? > >of course singleton doesn't prevent concurrent >access to the resource across the processes >unless >you're using some OS facility to prevent it, besides >singleton as it was introduced is relevant only >and only inside of the same process >otherwise it's not singleton it's something else >(let's say network singleton: so you have remote >invocation facility >and some factory method that return object created by that facility) > >I don't have any problem with using any kind of singletons. > Parametric Singleton idea (if I understand it >right) could be easily implemented in the >following way: >use a map >populate map with instances of some class and key is your parameter >(you can use lazy population too) > >if somebody ask the key check the value if it's null so resource is taken >if somebody returns the resource put it back to the map > >public synchronized static Object getSomeResource(Object parameter); >public synchronized static void returnResource(Object parameter); > >getSomeResource (inside of the same process) could return null in 2 cases >1. if somebody (from other thread for example) already took that resource >2. if OS API said that resource corresponded to >that parameter (serial port with parameter = 1 >(port #)) >is locked and unavailable; >I'm not sure that in case of serial ports we >even need those Parametric Singletons >(unless lock checking is a very expensive operation) >just ask the OS about availability of that >resource and if it's available give it away >and then OS will lock it and therefore in next >time somebody ask it just answer that resource >is locked >and return null > >for example system has 2 serial ports available >so I ask getResource("tty"); >or I ask getResource("Bluetooth-Modem"); > >and if OS is ok you can give tty or Bluetooth-Modem or both > >no need for any additional pattern I think > >back to the problem >mac os x doesn't recognize locking via files, so >it handles locking via some API >an instance of the singleton in each process >should recognize that resource is locked >(by using that API) that's all >we don't have to make things more complicate >then they are just because there is some nice >design pattern or nice unit test framework or whatever >keep things simple, make them work fast, don't introduce middle layers >unless you have really good reason to do so > >of course I could be entirely wrong, so sorry about that in advance > >thanks > > >Dmitry Markman > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx >Good day, > >I guess that only a selected few (hi Trent) will be able to answer? >this question, but the answer might be interesting for anyone trying? >to debug or understand the code. > >Apparently the MonitorThread is started and stopped in? >RXTXPort.addEventListener and RXTXPort.removeEventListener. This? >would indicate that (originally?) the MonitorThread is only required? >when there is an EventListener. However the MonitorThread is also? >started in the RXTXPort constructor, which could mean that RXTX won't? >work at all if it isn't there. > >It seems to me, that if anyone would add an event listener and later? >on remove it, he could potentially wreak the port. Because the second? >action would kill the MonitorThread. > > >For the moment I am only trying to understand the role of and idea? >behind the MonitorThread. But of course there is a deeper reason thor? >my question: > >If the MonitorThread needs to exist anyway, it could be the thread? >that cleans up the port (ie calls nativeClose) - this would eliminate? >(a further) problem I am seeing with some USB drivers on Mac OSX.? >(Close blocks (after releasing the tty, but still) in the USB driver? >if the device is "not responding"). > >Greetings, >Joachim > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Sat May 13 10:07:37 2006 From: joachim at buechse.de (Joachim Buechse) Date: Sat, 13 May 2006 18:07:37 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Douglas, Looking at the current code, leaves me with the feeling, that there is a lot to do. Defining an API that wraps javax.comm to provide what you describe is certainly possible, but I wonder how much benefit it will actually provide. Personally I think the API defined by javax.comm "request/lock" a port with: cp= new CommunicationPort(identifier) "release" a port with: cp.close(); works quite nice for 99% of the applications. In my experience, the most efficient and elegant implementation is to wrap a port/socket/.. into a business object which declares the remote operations that are possible. Ie "uploadFile", "waitForPrompt", "getSerialNumber", "sendContact", "executeCommand", etc Those methods are then either synchronized or guarded by a monitor. I do not see how your design pattern applied to the port resource would help implementing this. [details start, skip if you agree to the above] When I talked about "thread-safe" I didn't mean several independent "sessions" accessing the port concurrently. I think this is a very rare usage. I believe the most common use case for serial ports today is the control of an external device from a PC running a GUI based application. To implement a clean Swing/AWT-GUI one needs to pass any action that can block to a "worker" thread (else the GUI blocks, the application appears dead). While it is possible to use own prespawned thread that will accept Runnables which operate on the port, this is not very elegant. It is more common to spawn a new thread for every action triggered by the user. Additionally the ABORT of a running operation is often implemented via a port.close() delegated to a different thread. - During the lifetime of a port, it will usually be accessed from several different threads. Instance variables need to be set/read in synchronized regions to guarantee a correct operation based on the Java memory model. - Synchronizing the access is usually handled on the application level (synchronizing the reads/writes is usually useless from the applications view because it is not a transaction mechanism). [details end] I am very open to learn about other scenarios where your proposed design pattern applied to the port resource is beneficial to the application implementor. Best regards, Joachim On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > Dmitry suggests that we acquire an implementation of > a serial port reference, use it, then release it (i.e., check it > back in). > > Joachim says that making serial ports thread friendly might be a > good idea. > > This is a good idea. The design pattern that is close to this idea > is the "Object Pool Design Pattern". > # Object Pool From jredman at ergotech.com Sun May 14 14:28:24 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 14:28:24 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers Message-ID: <446792E8.4000506@ergotech.com> Does anyone know of any work to make RXTX work with Ethernet (telent) Terminal Servers? If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? We've used RXTX with upwards of 100 virtual COM ports on Windows and it works well. Linux is more problematic. It would be good to have an OS independent solution to accesses remote Ethernet serial ports. Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From legolas.w at gmail.com Sun May 14 14:26:34 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:56:34 +0430 Subject: [Rxtx] does any one have a working sample of RXTX and LPT port Message-ID: <4467927A.4000008@gmail.com> Hi Thank you for reading my post does any one has a working sample for RXTX and LPT port ? Thanks From legolas.w at gmail.com Sun May 14 14:27:29 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:57:29 +0430 Subject: [Rxtx] does RXTX support Trigerr on parallel port? Message-ID: <446792B1.4040905@gmail.com> Hi does RXTX support trigger on LPT port ? if so , how i can use it ? Thanks From tjarvi at qbang.org Sun May 14 17:40:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 17:40:59 -0600 (MDT) Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: <446792E8.4000506@ergotech.com> References: <446792E8.4000506@ergotech.com> Message-ID: On Sun, 14 May 2006, Jim Redman wrote: > Does anyone know of any work to make RXTX work with Ethernet (telent) > Terminal Servers? > > If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 > Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? > Hi Jim It appears the author of NVTCom has decided to release the library into the public domain. Integration with rxtx is possible but it would be best to contact the author and find out what his intent is. I would suggest contacting the author with a proposal of what you would like to do and take it from there. We could 'take' public domain software but its better to show respect to the authors and respect their wishes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:10:23 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:10:23 -0600 (MDT) Subject: [Rxtx] does any one have a working sample of RXTX and LPT port In-Reply-To: <4467927A.4000008@gmail.com> References: <4467927A.4000008@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > Thank you for reading my post > does any one has a working sample for RXTX and LPT port ? > Thanks Hi Legolas LPT port support in rxtx is spotty. That means some people have sent in patches for what they do and it works well for them. The original code was not very good. It may have been 3 hours work :/ To get started, Sun has some demo programs with their commapi. With rxtx 2.1 you can change their code from using javax.com to gnu.io and it -should- work. But if it does not you can post here and on bugzilla. There has been more interest lately off the list and maybe there will be enough community resources to get what you need going. If you do get a sample program together, we would gladly put it in the contrib directory so the next person can get things going faster. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:12:12 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:12:12 -0600 (MDT) Subject: [Rxtx] does RXTX support Trigerr on parallel port? In-Reply-To: <446792B1.4040905@gmail.com> References: <446792B1.4040905@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > does RXTX support trigger on LPT port ? > if so , how i can use it ? > Hi Legolas As mentioned in the previous post, rxtx parallel support is not very mature. But if you can point to something that describes the trigger feature, we can probably make sure its there and give a quick code example. -- Trent Jarvi tjarvi at qbang.org From jredman at ergotech.com Sun May 14 22:22:48 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 22:22:48 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: References: <446792E8.4000506@ergotech.com> Message-ID: <44680218.4080008@ergotech.com> Trent, Trent Jarvi wrote: > On Sun, 14 May 2006, Jim Redman wrote: > >> Does anyone know of any work to make RXTX work with Ethernet (telent) >> Terminal Servers? >> >> If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 >> Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? >> > > Hi Jim > > It appears the author of NVTCom has decided to release the library into > the public domain. Integration with rxtx is possible but it would be best > to contact the author and find out what his intent is. > > I would suggest contacting the author with a proposal of what you would > like to do and take it from there. We could 'take' public domain software > but its better to show respect to the authors and respect their wishes. > I sent Marco(?), the author of the library, a note before asking the list - I'll let you know the response. If anyone is already working on it, or has an interest and more time and energy than me, I'd hate to duplicate the efforts. If no one is, and no one objects, maybe I'll see what I can do. Jim > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From Christian.Klemke at t-online.de Mon May 15 02:23:06 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Mon, 15 May 2006 10:23:06 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu><004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: <008a01c677f8$cae18590$02fea8c0@NB600> Hi Trent, Hi Paul, I finally found some time to create a simple patch to enable the optional suppression of version output to the console. It is based on a new system property called "gnu.io.rxtx.NoVersionOutput" which can by set to "true" if necessary. I had some problems accessing CVS, therefore I downloaded the rxtx-2.1-7r2 source archive from ftp.qbang.org (which is linked on the rxtx.org download page) and worked with that release. Please find my proposed patch in the attachment ! Regards, Christian ----- Original Message ----- From: "Trent Jarvi" To: "RXTX Developers and Users" Cc: ""Paul Gettings"" Sent: Friday, May 05, 2006 2:09 PM Subject: Re: [Rxtx] RXTX causing stdout messages > On Fri, 5 May 2006, Christian Klemke wrote: > >> Hi Paul, >> >> I was wondering about the same question some days ago and took a look at >> the >> source files. Unfortunately, I found that you can only get rid of that >> messages by altering and recompiling the Java code. There is a final >> static >> boolean variable called "devel" in the file "RXTXCommDriver.java" which >> is >> set to "true". This constellation causes the output after the native >> libraries have been loaded. No mechanism exists to suppress them >> otherwise >> :-(. >> >> Trent, does that mean that 2.1.7 is still officially a "development" >> version >> ? When will this value be changed to "false" by default ? With 2.1.8 ? It >> would be nice to provide a means to suppress such messages besides that >> static flag (maybe by setting a property called >> "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The >> output can indeed by annoying, especially when used with console >> applications, where the message potentially appears "in the middle" of >> your >> own output. Another possibility would be not to use System.out directly, >> but >> instead some PrintStream field which is initially set to System.out but >> can >> programatically be changed. That would allow for any kind of redirection >> or >> suppression by implementing appropriate user-defined PrintStream >> subclasses >> and making RXTX use that stream. What do you think ? >> > > A patch for using properties would be accepted I'm sure. > > The reason the default is to display the message is not related to the > development state of rxtx anymore. The problem is that people first using > rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. > The message prevents a great deal of email thats easily explained by the > message. > > I question if we should support rxtx 2.0 at all anymore. > > If you post a patch in bugzilla, we'll put it into CVS this weekend. > we'll be going through and doing such things anyhow. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_version_output_patch.diff Type: application/octet-stream Size: 991 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060515/3173c2b6/rxtx_version_output_patch-0403.obj From lyon at docjava.com Mon May 15 06:06:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 May 2006 08:06:21 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Joachim makes several good points. Let me see if I can address some of them below: >Hello Douglas, > >Looking at the current code, leaves me with the feeling, that there? >is a lot to do. Yes! >Defining an API that wraps javax.comm to provide what? >you describe is certainly possible, but I wonder how much benefit it? >will actually provide. > >Personally I think the API defined by javax.comm > >"request/lock" a port with: > cp= new CommunicationPort(identifier) >"release" a port with: > cp.close(); > >works quite nice for 99% of the applications. I don't know what percentage of applications turn off locking, the way that I do in my version of the RXTX lib. I do know that this is not safe practice. I also know that it was motivated by the multi-platform nature of my code and that this was the only way I could make things work, at the time. Java does not appear to have a cross-platform standard for locking resources on various platforms. Each OS appears to have its own standard. The question of who breaks deadlocks and how this is done remains open, as this is not an easy question to resolve. Let me continue, below: > >In my experience, the most efficient and elegant implementation is to? >wrap a port/socket/.. into a business object which declares the? >remote operations that are possible. Ie "uploadFile",? >"waitForPrompt", "getSerialNumber", "sendContact", "executeCommand",? >etc Those methods are then either synchronized or guarded by a? >monitor. I do not see how your design pattern applied to the port? >resource would help implementing this. I have no problem with high-level wrappers that are application specific. That is a very good idea, but orthogonal with respect to the issue of deadlocks. More below: > >[details start, skip if you agree to the above] >When I talked about "thread-safe" I didn't mean several independent? >"sessions" accessing the port concurrently. I think this is a very? >rare usage. That is probably why turning locking off works so well! On the other hand, it is not safe and I shouldn't do it. >I believe the most common use case for serial ports today? >is the control of an external device from a PC running a GUI based? >application. To implement a clean Swing/AWT-GUI one needs to pass any? >action that can block to a "worker" thread (else the GUI blocks, the? >application appears dead). While it is possible to use own prespawned? >thread that will accept Runnables which operate on the port, this is? >not very elegant. It is more common to spawn a new thread for every? >action triggered by the user. Additionally the ABORT of a running? >operation is often implemented via a port.close() delegated to a? >different thread. Here lies the heart of serial port concern. An application opens a serial port and then dies. The application is restarted and finds the port locked. How do we clear the lock? Must the application's user reside in the UUCP group? Must installers of the serial port add users to the UUCP group? Should locking be handled at a high-level of abstraction in an operating system independent way? Should the implementation of the locking mechanism be translated into an API that is dependent on the OS convention? Suppose that we restrict the discussion to serial ports. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on inconsistent naming conventions. Hence my feeling that we need to mirror what is done in other API's; we need a locking toolkit that references peer methods, IMHO. >From the Java programming point of view, the locking API is portable across different platforms, but has, as its implementation, a native peer method that uses the conventions of the underlying OS. This enables portable resource locking (in theory!). Consider, for example: org.apache.commons.transaction.locking with: Interface LockManager at: http://jakarta.apache.org/commons/transaction/apidocs/org/apache/commons/transaction/locking/LockManager.html Or, more recently: java.util.concurrent.locks Interface Lock based on Doug Lea's code: http://kickjava.com/src/EDU/oswego/cs/dl/util/concurrent/ReadWriteLock.java.htm Should we incorporate a clean, portable design into serial port use, one that is consistent with current locking APIs? Basically, a comm port is a resource and resources are typically controlled by managers. Thus, I suggest that we make use of a CommPortManager to help control and centralize serial port usage. The question of how this is done remains open, IMHO, but using core API's like: java.util.concurrent.locks might not be amiss. High-level methods (getAllPorts, getAllSerialPorts, getAllParallelPorts, etc...) might be welcome additions. Basic questions like, "what if a port is in use?" remain open, hence my proposal for the new design pattern. Isn't it the CommPortManager's role to break the deadlock? Cheers! - Doug > >- During the lifetime of a port, it will usually be accessed from? >several different threads. Instance variables need to be set/read in? >synchronized regions to guarantee a correct operation based on the? >Java memory model. >- Synchronizing the access is usually handled on the application? >level (synchronizing the reads/writes is usually useless from the? >applications view because it is not a transaction mechanism). >[details end] > >I am very open to learn about other scenarios where your proposed? >design pattern applied to the port resource is beneficial to the? >application implementor. > >Best regards, >Joachim > >On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > >> Dmitry suggests that we acquire an implementation of >> a serial port reference, use it, then release it (i.e., check it? >> back in). >> > > Joachim says that making serial ports thread friendly might be a? >> good idea. >> >> This is a good idea. The design pattern that is close to this idea >> is the "Object Pool Design Pattern". >> # Object Pool > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Mon May 15 06:58:19 2006 From: joachim at buechse.de (Joachim Buechse) Date: Mon, 15 May 2006 14:58:19 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Doug, I agree fully, that locking of the system resource should be abstracted from the user (programmer). Currently this is already the case, but I agree it might be nice to extract the code into a separate class, which uses platform dependent providers to do its job. What I described in my email was not targeted at allocating the system resource, but at handling an already allocated system resource inside the framework. I agree that it may be possible to combine the two - however, I would suggest to do this in phase2. I can contribute a work over of RXTXPort.java which implements clean internal locking and proper close behavior (which I would call phase 1). I could do this this week. However I strongly believe that there is little sense in trying to do this as a series of patches. It will be closer to a rewrite than to a patch. I have already provided a number of suggested patches via Bugzilla, but this is quite inconvenient (for me). My working copy diverges more and more from the master and hence it gets more and more annoying to provide self contained patches. Best regards, Joachim From tjarvi at qbang.org Mon May 15 08:27:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 May 2006 08:27:51 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Mon, 15 May 2006, Joachim Buechse wrote: > Hello Doug, > > I agree fully, that locking of the system resource should be > abstracted from the user (programmer). Currently this is already the > case, but I agree it might be nice to extract the code into a > separate class, which uses platform dependent providers to do its job. > > What I described in my email was not targeted at allocating the > system resource, but at handling an already allocated system resource > inside the framework. I agree that it may be possible to combine the > two - however, I would suggest to do this in phase2. > > I can contribute a work over of RXTXPort.java which implements clean > internal locking and proper close behavior (which I would call phase > 1). I could do this this week. > > However I strongly believe that there is little sense in trying to do > this as a series of patches. It will be closer to a rewrite than to a > patch. I have already provided a number of suggested patches via > Bugzilla, but this is quite inconvenient (for me). My working copy > diverges more and more from the master and hence it gets more and > more annoying to provide self contained patches. > For methodical testing purposes (which does go on) the incremental patches are better. I'm lagging behind in bugzilla but thats soon to change (this week). It has just been rather chaotic up until now. I moved, purchased a house, and jumped into the fire of a feature freeze timeframe at a new job. btw, we see the Solaris close issues on 2.8 also. 9 and 10 are fine. I'll work towards making those test results public and allow others to run new rxtx code through them. We had the OK at one point but setting up the environment is involved. It isn't just a collection of java classes. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Tue May 16 02:01:47 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:01:47 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] Message-ID: <446986EB.209@willicon.de> Hi, any ideas for my problem? Hans -------- Original-Nachricht -------- Betreff: [Rxtx] Problem under Mac OSX 10.3.9 Datum: Mon, 08 May 2006 18:47:20 +0200 Von: WILLICon Antwort an: RXTX Developers and Users An: RXTX Developers and Users Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/b0741c2b/attachment-0403.html From joachim at buechse.de Tue May 16 02:15:08 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 10:15:08 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: Hello Hans, I am using RXTX on OS X for my own project. I do not see the problem you describe. I had some troubles installing it because the current version uses lock files which is non-standard on OS X. I have created a patched version which I currently use. This version does not need to modify user groups and hence does not need an installer. I just pop it in the application directory. If you send me a link where I can download your OSX installer, I will have a quick look. Regards, Joachim On 16.05.2006, at 10:01, WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we > have some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + > spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + > spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always > the value "false". > I can only get the status, while I open the port and catch the > exception. > > Any ideas? > > Hans > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail at willicon.de Tue May 16 02:26:53 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:26:53 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: References: <446986EB.209@willicon.de> Message-ID: <44698CCD.7050709@willicon.de> Joachim, tanks for the answer. I'll send You a mail. Hans Joachim Buechse schrieb: > Hello Hans, > > I am using RXTX on OS X for my own project. I do not see the problem > you describe. > > I had some troubles installing it because the current version uses > lock files which is non-standard on OS X. I have created a patched > version which I currently use. This version does not need to modify > user groups and hence does not need an installer. I just pop it in > the application directory. If you send me a link where I can download > your OSX installer, I will have a quick look. > > Regards, > Joachim > > On 16.05.2006, at 10:01, WILLICon wrote: > > >> Hi, >> >> any ideas for my problem? >> >> Hans >> >> -------- Original-Nachricht -------- >> Betreff: [Rxtx] Problem under Mac OSX 10.3.9 >> Datum: Mon, 08 May 2006 18:47:20 +0200 >> Von: WILLICon >> Antwort an: RXTX Developers and Users >> An: RXTX Developers and Users >> >> >> Hi, >> >> I use for RXTX for communicate with CyclingComputers. >> >> It works good under Win32, Sloaris and Linux but with Mac OSX we >> have some problems. >> >> My users install the Mac OSX serial lib from the actual binary. >> >> After starting the program, they get this error message: >> >> java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while >> loading gnu.io.RXTXCommDriver >> >> Remember, this error comes only under Mac OSX. >> >> That is the code for the error: >> >> Enumeration portList = CommPortIdentifier.getPortIdentifiers(); >> spInUse = getBundleStr("serialPortInUse"); >> spFree = getBundleStr("serialPortFree"); >> while (portList.hasMoreElements()) { >> CommPortIdentifier portId = (CommPortIdentifier) >> portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (osName != null && osName.startsWith("mac")) { >> if (!portId.getName().startsWith("dev/cu.")) { >> continue; >> } >> } >> if (portId.isCurrentlyOwned()) { >> serialPortNames.add(portId.getName() + " - " + >> spInUse); >> } >> else { >> serialPortNames.add(portId.getName() + " - " + >> spFree); >> } >> } >> } >> if (serialPortNames.size() == 0) { >> serialPortNames.add(getBundleStr("serialPortNotFound")); >> } >> >> BTW: The methode isCurrentlyOwned() is not working. I get always >> the value "false". >> I can only get the status, while I open the port and catch the >> exception. >> >> Any ideas? >> >> Hans >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/948333be/attachment-0403.html From jredman at ergotech.com Tue May 16 07:35:52 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 16 May 2006 07:35:52 -0600 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: <4469D538.6070408@ergotech.com> Hans, I have no direct insight, but would note that what you have is a "NoClassDefFoundError" not a "ClassNotFoundException". So the class javax/comm/CommDriver is found, but one of its dependencies is missing. NoClassDefFoundError are a bigger problem to resolve because you get no indication of the real problem. Jim WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we have > some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > * spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always the > value "false". > I can only get the status, while I open the port and catch the exception. > > Any ideas? > > Hans > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.de Tue May 16 08:01:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 16:01:21 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 In-Reply-To: <4469AFC3.6000002@willicon.de> References: <44698EBC.8000008@willicon.de> <8C5680C4-E2BA-42FF-B221-36E1124FA6A4@buechse.de> <4469AFC3.6000002@willicon.de> Message-ID: <9825A602-D6ED-4C28-BF33-9A7C984FACD5@buechse.de> Hallo Hans, you include RXTX 2.17 in your "bikeXexperience.jar" (2.17 uses Interfaces from gnu.io.* not javax.comm.*). Now inspect your error log closely: The class gnu.io.RXTXCommDriver tries to load javax.comm.CommDriver: this is only the case for RXTX 2.07. I assume, that the user has installed Version 2.07 into one of the java.ext.dirs . The VM always tries to load classes from the "system" path first. The current Mac installer distributed with RXTX in fact installs RXTXcomm.jar and librxtxSerial.jnilib into /Library/Java/Extensions. (I wrote some time ago that I consider this as a bad idea because of potential version conflicts-> thanks for delivering the example). For 2.07 it does so without installing the javax.comm classes it seems. I would recommend that you instruct your users to install version 2.17 only. Until RXTX is changed to use TIOCEXCL instead of lock files, you can hardly avoid the installer, as the user needs to be added to a special group and a lockfile directory needs be created. More precisely you are waiting for: http://bugzilla.qbang.org/show_bug.cgi?id=50 [RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL)] Regards, Joachim -------------- next part -------------- A non-text attachment was scrubbed... Name: log.tiff Type: image/tiff Size: 38394 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/e3e52128/log-0403.tiff -------------- next part -------------- > > Ich verwende RXTX 2.17. Das orginal RXTXcomm.jar ist in > CyclingDataManager.jar enthalten. > From tjarvi at qbang.org Wed May 17 23:18:15 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 May 2006 23:18:15 -0600 (MDT) Subject: [Rxtx] update Message-ID: So we have several patches and these have stacked up. I'd like to thank everyone for being patient. Tests for the most intrusive patches look good so far. I still have to get some bits together on my end but it looks like we can catch everything up in CVS this week. I'll try to post a normal list of what went in by whom with links Saturday. But I'm not seeing anything that raises flags yet. I also think I'll be able to submit a patch for nonstandard baud rates. I have to confirm w32 but I think its going to be a one line fix. I don't know if its bugzilla or people tinkering with patch files before submitting but patches are not applying cleanly. So the patches have to be done by hand. This may make things difficult for people hoping to add other patches on top. I'm trying to make that go well but ... -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Thu May 18 02:23:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 May 2006 10:23:47 +0200 Subject: [Rxtx] update In-Reply-To: References: Message-ID: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Hello Trent, in fact I tinkered with the patches (never used this mechanism before, usually I "communicate" via cvs) ... so sorry for any trouble you had applying them. Basicly I edited the patches to make them self contained. Having the tests run with different speeds on different platforms, may well be an effect of caching. I have seen quite interesting propagation delays for the closing flag on my PowerPC system, which makes me doubt, that the propagation of output_buffer_empty_flag works as it should. Maybe the communication mechanism between the two threads should be replaced by something like pthread_cond_*. Could you describe which problems you see on Solaris/SPARC? I'd be interested to see if they exist on OS X (PowerPC) as well... As you seem to work on the stuff at the moment I would like to suggest the following additions (it looks more than it is, I posted some context to make clear where to apply the change). See the comments in braces for what was changed Greetings, Joachim (1) The end of the drain loop could be: --- report("drain_loop: received EINTR in tcdrain\n"); --- (added "in tcdrain" to make debug output clearer) (2) The start of the drain loop should be: --- for(i=0;;i++) { report_verbose("drain_loop: looping\n"); #if defined(__sun__) /* FIXME: No time to test on all OS's for production */ if( eis->eventloop_interrupted ) { goto end; } if (usleep(5000)) { report("drain_loop: received EINTR"); } #else if (usleep(1000000)) { report("drain_loop: received EINTR"); } #endif /* __sun__ */ --- (added a check for "eis->eventloop_interrupted" before the sleep) (3) The end of interrupt_event_loop could (and maybe should) be: --- #if !defined(TIOCSERGETLSR) && !defined(WIN32) /* make sure that the drainloop unblocks from tcdrain */ pthread_kill(index->drain_tid, SIGABRT); /* TODO use wait/join/SIGCHLD/?? instead of sleep? */ usleep(50 * 1000); /* Under normal conditions, SIGABRT will unblock tcdrain. However a non-responding USB device combined with an unclean driver may still block. This is very ugly because it may block the call to close indefinetly. */ if (index->closing != 1) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); index->closing = 1; } #endif report("interruptEventLoop: interrupted\n"); --- (added some comments and pthread_cancel for resisting drain thread) On 18.05.2006, at 07:18, Trent Jarvi wrote: > > So we have several patches and these have stacked up. I'd like to > thank > everyone for being patient. > > Tests for the most intrusive patches look good so far. I still > have to > get some bits together on my end but it looks like we can catch > everything > up in CVS this week. > > I'll try to post a normal list of what went in by whom with links > Saturday. But I'm not seeing anything that raises flags yet. I also > think I'll be able to submit a patch for nonstandard baud rates. > I have > to confirm w32 but I think its going to be a one line fix. > > I don't know if its bugzilla or people tinkering with patch files > before > submitting but patches are not applying cleanly. So the patches > have to > be done by hand. This may make things difficult for people hoping > to add > other patches on top. I'm trying to make that go well but ... > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu May 18 22:28:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 18 May 2006 22:28:00 -0600 (MDT) Subject: [Rxtx] update In-Reply-To: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> References: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Message-ID: On Thu, 18 May 2006, Joachim Buechse wrote: > Hello Trent, > > in fact I tinkered with the patches (never used this mechanism > before, usually I "communicate" via cvs) ... so sorry for any trouble > you had applying them. Basicly I edited the patches to make them self > contained. I think we are close to moving towards that. > > Having the tests run with different speeds on different platforms, > may well be an effect of caching. I have seen quite interesting > propagation delays for the closing flag on my PowerPC system, which > makes me doubt, that the propagation of output_buffer_empty_flag > works as it should. Maybe the communication mechanism between the two > threads should be replaced by something like pthread_cond_*. Could > you describe which problems you see on Solaris/SPARC? I'd be > interested to see if they exist on OS X (PowerPC) as well... This is interesting. I have seen problems with output buffer empty in applications that require it. I'm trying to get a bug list and or test results open for everyone to see but that may take time. But missed output buffer events ... yep. With Sparc, we have seen a few things. One was a kernel race condition that went away when we reimaged and updated 2.8. RXTX was hanging on close, top showed no cpu use but there was 2 second delays just typing on console. The other is our tests now take ~4 times longer on Solaris. Someone is looking at timing just open, close, read, write, ... to see if they can find where the slowdown is. This happened after solaris 2.8. I'll try to share more when/if there is something interesting. This may well not be solvable in userland. > > As you seem to work on the stuff at the moment I would like to > suggest the following additions (it looks more than it is, I posted > some context to make clear where to apply the change). See the > comments in braces for what was changed I'll take a look. This could all come together Saturday but I also have an event to attend that day. I may not wrap this up until Sunday. -- Trent Jarvi tjarvi at qbang.org From andrewlord at internode.on.net Sun May 21 20:10:02 2006 From: andrewlord at internode.on.net (Andrew Lord) Date: Mon, 22 May 2006 11:40:02 +0930 Subject: [Rxtx] Kernel include files do not match kernel Message-ID: <200605221140.03271.andrewlord@internode.on.net> Hi, I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel 2.6.12-18 with the command: ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include However I get the message: ## checking java.version 1.5.0_06 ## checking os.version 2.6.12-18mdk ## ## WARNING: Kernel include files do not match the current kernel ## ## configure: creating ./config.status etc. Is there a problem with the way I'm specifying the 'include' directory ? If not, how else can I specify the correct directory for the include files please ? Cheers, Andrew From tjarvi at qbang.org Sun May 21 20:31:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 May 2006 20:31:31 -0600 (MDT) Subject: [Rxtx] Kernel include files do not match kernel In-Reply-To: <200605221140.03271.andrewlord@internode.on.net> References: <200605221140.03271.andrewlord@internode.on.net> Message-ID: On Mon, 22 May 2006, Andrew Lord wrote: > Hi, > > I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel > 2.6.12-18 with the command: > > ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk > CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include > > However I get the message: > > ## checking java.version 1.5.0_06 > ## checking os.version 2.6.12-18mdk > ## > ## WARNING: Kernel include files do not match the current kernel > ## > ## configure: creating ./config.status > etc. > > Is there a problem with the way I'm specifying the 'include' directory ? If > not, how else can I specify the correct directory for the include files > please ? > Hi Andrew I'm fairly sure your --with-kernel option does nothing. The CPPFLAGS should do what you want. Maybe put an #error message in /usr/src/linux.../incude/linux/version.h But I don't recall a recent problem with version missmatches. It should work. Distros will even ship include files that don't match versions exactly. In theory it should never matter for users. I used to compile new kernels by hand and really didnt have a distro. I didnt have a seperate package of kernel headers for users (myself). When changing a gateway from linux 1.2.12 to 2.1.77, I would worry about such messages. So if you are doing something that weird, the message may be of use to you. If you just see the message on a distro you installed, it is more than likely harmless. -- Trent Jarvi tjarvi at qbang.org From mrogers at spro.net Mon May 22 14:45:39 2006 From: mrogers at spro.net (Mike Rogers) Date: Mon, 22 May 2006 14:45:39 -0600 Subject: [Rxtx] Sun's CommAPI -- think May? Message-ID: <447222F3.9040302@spro.net> Hi, Any word from Sun about progress towards fixing the Java CommAPI v3 "incompatibilities" so RXTX 2.0 can operate within the framework's namespace (javax.comm)? I recall mention of a May time frame. Thanks, Mike From paul.klissner at sun.com Mon May 22 15:09:27 2006 From: paul.klissner at sun.com (Paul Klissner) Date: Mon, 22 May 2006 14:09:27 -0700 Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <447222F3.9040302@spro.net> References: <447222F3.9040302@spro.net> Message-ID: <44722887.8080308@sun.com> Mike Rogers wrote: > Hi, > > Any word from Sun about progress towards fixing the Java CommAPI v3 > "incompatibilities" so RXTX 2.0 can operate within the framework's > namespace (javax.comm)? I recall mention of a May time frame. > > Thanks, > > Mike > We've had a lot of work come in. This hasn't been the only priority. I'm running behind the plan in addressing this, but will be looking at it again soon. Rather than state a new, I'll just say it is in progress, and not off the table. I'll get this fixed as soon as I can. Good timing for asking as we just started discussing javax.comm plans today, and I'll have some cycles to work on it soon. Paul From yhua537 at cse.unsw.edu.au Mon May 22 16:03:05 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Tue, 23 May 2006 08:03:05 +1000 (EST) Subject: [Rxtx] install rxtx in XP Message-ID: Hi Guys, I am new to serial port programming, and have no experience on programming java in xp, but my project require me to builld a communication link between xp and a UART device. Most of the information in the web site seems for linux only. including the commands such as export and chmod. How do I install rxtx in xp? cheers YiQi Huang From mark at mdsh.com Tue May 23 01:24:20 2006 From: mark at mdsh.com (Mark Himsley) Date: Tue, 23 May 2006 08:24:20 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off , it includes DLLs for Windows and the JAR for Java. Follow the Windows instructions in the INSTALL. ie RXTXcomm.jar goes in \jre\lib\ext (under java) rxtxSerial.dll goes in \jre\bin So, assuming a fairly standard Java install, copy RXTXcomm.jar into C:\Program Files\Java\jre1.5.0_06\lib\ext and copy rxtxSerial.dll into C:\Program Files\Java\jre1.5.0_06\bin Yes, it really is that simple. On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > I am new to serial port programming, and have no experience on > programming java in xp, but my project require me to builld a > communication link between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang -- Mark Himsley From joachim at buechse.de Tue May 23 02:51:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 23 May 2006 10:51:47 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) Unless it is absolutely required you should NOT install RXTX in your global Java Runtime Environment. This will for sure create versioning conflicts - if not now, than in the future, if not on your system than at your clients. Instead put the dll in your application directory and include the RXTXcomm.jar in your classpath. This is much safer and not a bit more complicated. Regards, Joachim On 23.05.2006, at 09:24, Mark Himsley wrote: > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR > for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > >> I am new to serial port programming, and have no experience on >> programming java in xp, but my project require me to builld a >> communication link between xp and a UART device. >> >> Most of the information in the web site seems for linux only. >> including >> the commands such as export and chmod. How do I install rxtx in xp? >> >> cheers >> YiQi Huang > > > > -- > Mark Himsley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tod at todbot.com Tue May 23 03:12:22 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 02:12:22 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I totally agree: do not contaminate the Java installation. I put all the RXTX files in a directory and then change my java invocation to be: % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* Alternatively, use Launch4J to create a double-clickable application and keep the RXTX libraries in the directory of the application. -=tod On May 23, 2006, at 1:51 AM, Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > >> Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off >> , it includes DLLs for Windows and the JAR >> for Java. >> >> Follow the Windows instructions in the INSTALL. >> >> ie >> >> RXTXcomm.jar goes in \jre\lib\ext (under java) >> rxtxSerial.dll goes in \jre\bin >> >> So, assuming a fairly standard Java install, copy RXTXcomm.jar into >> C:\Program Files\Java\jre1.5.0_06\lib\ext >> and copy rxtxSerial.dll into >> C:\Program Files\Java\jre1.5.0_06\bin >> >> Yes, it really is that simple. >> >> >> >> On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: >> >>> I am new to serial port programming, and have no experience on >>> programming java in xp, but my project require me to builld a >>> communication link between xp and a UART device. >>> >>> Most of the information in the web site seems for linux only. >>> including >>> the commands such as export and chmod. How do I install rxtx in xp? >>> >>> cheers >>> YiQi Huang >> >> >> >> -- >> Mark Himsley >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From smontgomery at mediaspansoftware.com Tue May 23 08:46:53 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Tue, 23 May 2006 10:46:53 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: Message-ID: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Joachim and Tod mentioned how to keep the files RXTX requires on Windows XP out of the Java installations - thanks gentlemen! Are there similar suggestions for an RXTX install on OS X? The current "canonical" OS X installation instructions "contaminate the Java installation", to use Tod's words. Our app will run fine under 1.4.2 and 5.0 on OS X, and a lot of users will have both. We've already been burned by the recent switch from 1.4.2 to 5.0 as the platform default. Any suggestions welcomed. From tod at todbot.com Tue May 23 13:27:55 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 12:27:55 -0700 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <9BA0F670-A862-42E7-BB2C-130D775ABDF9@todbot.com> Hi Sean, It depends on how you build and deploy your code. If you're using shell scripts, you can do something like this: #!/bin/sh # pick one JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/ Commands/java #JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/ Commands/java $JAVA -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* That both picks which VM to use and uses the RXTX in the directory called 'rxtxlib'. If you want your shell script to be clever, you could test for the existence of the different 'java' executables and go from there (maybe even use different jar files). I am almost positive all OS X systems with Java 1.5 are guaranteed to also have Java 1.4.2. If you're using Jar Builder or XCode, you can specify which JVM to use and add the extra args in the Info.plist file. The paths specified in the 'java' invocation then are based off of the $JAVAROOT variable that the JavaApplicationStub sets for you. For my app, I've have been compiling two sets of jars, one compiled with 1.4.2 and one with 1.5, but they both run under 1.5. So I have a similar shell script that chooses a different 'javac' depending on the need. -=tod On May 23, 2006, at 7:46 AM, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From yhua537 at cse.unsw.edu.au Tue May 23 11:09:37 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 03:09:37 +1000 (EST) Subject: [Rxtx] install rxtx in XP (Mark Himsley, Joachim Buechse, Tod E. Kurt> In-Reply-To: References: Message-ID: > Message: 8 > Date: Tue, 23 May 2006 08:03:05 +1000 (EST) > From: YiQi Huang > Subject: [Rxtx] install rxtx in XP > To: rxtx at qbang.org > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > Hi Guys, > > I am new to serial port programming, and have no experience on programming > java in xp, but my project require me to builld a communication link > between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang > > > ------------------------------ > > Message: 9 > Date: Tue, 23 May 2006 08:24:20 +0100 > From: Mark Himsley > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=us-ascii; format=flowed > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > ------------------------------ > > Message: 10 > Date: Tue, 23 May 2006 10:51:47 +0200 > From: Joachim Buechse > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > > ------------------------------ > > Message: 11 > Date: Tue, 23 May 2006 02:12:22 -0700 > From: "Tod E. Kurt" > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I totally agree: do not contaminate the Java installation. > > I put all the RXTX files in a directory and then change my java > invocation to be: > > % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* > > Alternatively, use Launch4J to create a double-clickable application > and keep the RXTX libraries in the directory of the application. > > -=tod > > Hi, Thanks guys, I don't know if this is the correct way to reply your mecessage, if wrong, please point out. Thank you for Mark to give the detail instructions and Joachim to point out the cons ot installing in the java directory, and specially thanks for Tod to give the instrection in detail. Sorry to ask another stupid question: I have followed Tod's instruction. Now I think i am ready to start hacking. But where is the RXTX API documentation? Is it the same as using normal java comm API? btw, where could i find some examples to start with? Thanks very much cheers YiQi Huang From tjarvi at qbang.org Tue May 23 16:09:32 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 May 2006 16:09:32 -0600 (MDT) Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <44722887.8080308@sun.com> References: <447222F3.9040302@spro.net> <44722887.8080308@sun.com> Message-ID: > Good timing for asking as we just started discussing javax.comm plans > today, and I'll have some cycles to work on it soon. Hi Paul I assume you mean Sun is discussing plans concerning its own internal actions and there is no community involvment at this point. -- Trent Jarvi tjarvi at qbang.org From yhua537 at cse.unsw.edu.au Tue May 23 22:50:01 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 14:50:01 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } From mmester at sps.edu Tue May 23 22:58:21 2006 From: mmester at sps.edu (Michael Mester) Date: Wed, 24 May 2006 00:58:21 -0400 Subject: [Rxtx] install rxtx in XP References: Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below -----Original Message----- From: rxtx-bounces at qbang.org on behalf of YiQi Huang Sent: Wed 5/24/2006 12:50 AM To: RXTX Developers and Users Subject: Re: [Rxtx] install rxtx in XP Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3950 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060523/b36d0c63/attachment-0403.bin From yhua537 at cse.unsw.edu.au Tue May 23 23:05:50 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 15:05:50 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: Yes, Michael you are right, it should be semicolons, But it still can't find the correct library. On Wed, 24 May 2006, Michael Mester wrote: > I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below > > > -----Original Message----- > From: rxtx-bounces at qbang.org on behalf of YiQi Huang > Sent: Wed 5/24/2006 12:50 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] install rxtx in XP > > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > cheers YiQi Huang From tod at todbot.com Wed May 24 00:01:57 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 23:01:57 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Yes, sorry, classpath entries are semicolon-separated on Windows and colon-separated on everything else. Your example code below is importing the wrong set of classes. It should not "import javax.comm.*", instead it should "import gnu.io.*". When I make that change, your example program compiles. The "javax.comm" package is the one released by Sun, the "gnu.io" package is the RXTX one. You might've seen some discussion that the two will be merged or become compatible, but that hasn't happened yet. -=tod On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > > Yes, Michael you are right, it should be semicolons, But it still > can't > find the correct library. > > On Wed, 24 May 2006, Michael Mester wrote: > >> I believe the entries in the classpath need to be seperated with >> semicolons, not a colon as you have in your command below >> >> >> -----Original Message----- >> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >> Sent: Wed 5/24/2006 12:50 AM >> To: RXTX Developers and Users >> Subject: Re: [Rxtx] install rxtx in XP >> >> Hi, >> >> Sorry guys.I follow Tod's instruction, and here is what i did: >> >> put >> RXTXcomm.jar, >> rxtxParallel.dll, >> rxtxSerial.dll >> in >> C:\RXTX_files >> >> and I got a SimpleRead class attached below, compile it with : >> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >> it still saying "cannot find symbol". >> >> Is there anything I did wrong? Do I need the comm.jar from Sun? >> >> Thanks & regards >> YiQi Huang >> >> >> //////////////////////////////////////////////////////// >> // SimpleRead.java >> //////////////////////////////////////////////////////// >> >> import java.io.*; >> import java.util.*; >> import javax.comm.*; >> >> public class SimpleRead >> implements Runnable, SerialPortEventListener { >> static CommPortIdentifier portId; >> static Enumeration portList; >> InputStream inputStream; >> SerialPort serialPort; >> Thread readThread; >> public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == >> CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals("COM1")) { >> //if (portId.getName().equals("/dev/term/a")) { >> SimpleRead reader = new SimpleRead(); >> } >> } >> } >> } >> public SimpleRead() { >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", >> 2000); >> } catch (PortInUseException e) {} >> try { >> inputStream = serialPort.getInputStream(); >> } catch (IOException e) {} >> try { >> serialPort.addEventListener(this); >> } catch (TooManyListenersException e) {} >> serialPort.notifyOnDataAvailable(true); >> try { >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } catch (UnsupportedCommOperationException e) {} >> readThread = new Thread(this); >> readThread.start(); >> } >> public void run() { >> try { >> Thread.sleep(20000); >> } catch (InterruptedException e) {} >> } >> public void serialEvent(SerialPortEvent event) { >> switch(event.getEventType()) { >> case SerialPortEvent.BI: >> case SerialPortEvent.OE: >> case SerialPortEvent.FE: >> case SerialPortEvent.PE: >> case SerialPortEvent.CD: >> case SerialPortEvent.CTS: >> case SerialPortEvent.DSR: >> case SerialPortEvent.RI: >> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >> break; >> case SerialPortEvent.DATA_AVAILABLE: >> byte[] readBuffer = new byte[20]; >> try { >> while (inputStream.available() > 0) { >> int numBytes = inputStream.read(readBuffer); >> } >> System.out.print(new String(readBuffer)); >> } catch (IOException e) {} >> break; >> } >> } >> } >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > cheers > YiQi Huang > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From joachim at buechse.de Wed May 24 00:10:06 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:10:06 +0200 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Hi Sean, my preferred way of dealing with RXTX on OS X is to include the RXTX classes into my application jar and to put the RXTX lib in the same directory as this jar. To make it even more comfortable, you can include the lib in the jar and have some startup code extract it and write it to a temporary file from which you load it with System.load(). Unfortunately the current version of RXTX for OS X requires tinkering with user groups as it is based on lockfiles - and hence it needs the RXTX OS X installer or you need to duplicated this functionality in your own installer. I have created my own native version which is not based on lockfiles but tty locking (the standard way to do it on OSX). I hope that these patches will be integrated soon into the distribution. Regards, Joachim On 23.05.2006, at 16:46, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Wed May 24 00:16:12 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:16:12 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <7017ECFC-B13E-4806-B321-9FFCAC5830F0@buechse.de> I assume you downloaded rxtx-217 (not 207). Instead of importing javax.comm.* you must import gnu.io.* The classes have the same name, but they are not in the same package. On 24.05.2006, at 06:50, YiQi Huang wrote: > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From yhua537 at cse.unsw.edu.au Wed May 24 00:17:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 16:17:45 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Message-ID: Thanks Tod again, i kept reading "gnu.io.*" as "gun.io.*" last few hours after i read some commons from web. Thanks very much Tod. thanks YiQi Huang On Tue, 23 May 2006, Tod E. Kurt wrote: > Yes, sorry, classpath entries are semicolon-separated on Windows and > colon-separated on everything else. > > Your example code below is importing the wrong set of classes. It > should not "import javax.comm.*", instead it should "import > gnu.io.*". When I make that change, your example program compiles. > The "javax.comm" package is the one released by Sun, the "gnu.io" > package is the RXTX one. You might've seen some discussion that the > two will be merged or become compatible, but that hasn't happened yet. > > -=tod > > > On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > >> >> Yes, Michael you are right, it should be semicolons, But it still >> can't >> find the correct library. >> >> On Wed, 24 May 2006, Michael Mester wrote: >> >>> I believe the entries in the classpath need to be seperated with >>> semicolons, not a colon as you have in your command below >>> >>> >>> -----Original Message----- >>> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >>> Sent: Wed 5/24/2006 12:50 AM >>> To: RXTX Developers and Users >>> Subject: Re: [Rxtx] install rxtx in XP >>> >>> Hi, >>> >>> Sorry guys.I follow Tod's instruction, and here is what i did: >>> >>> put >>> RXTXcomm.jar, >>> rxtxParallel.dll, >>> rxtxSerial.dll >>> in >>> C:\RXTX_files >>> >>> and I got a SimpleRead class attached below, compile it with : >>> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >>> it still saying "cannot find symbol". >>> >>> Is there anything I did wrong? Do I need the comm.jar from Sun? >>> >>> Thanks & regards >>> YiQi Huang >>> >>> >>> //////////////////////////////////////////////////////// >>> // SimpleRead.java >>> //////////////////////////////////////////////////////// >>> >>> import java.io.*; >>> import java.util.*; >>> import javax.comm.*; >>> >>> public class SimpleRead >>> implements Runnable, SerialPortEventListener { >>> static CommPortIdentifier portId; >>> static Enumeration portList; >>> InputStream inputStream; >>> SerialPort serialPort; >>> Thread readThread; >>> public static void main(String[] args) { >>> portList = CommPortIdentifier.getPortIdentifiers(); >>> while (portList.hasMoreElements()) { >>> portId = (CommPortIdentifier) portList.nextElement(); >>> if (portId.getPortType() == >>> CommPortIdentifier.PORT_SERIAL) { >>> if (portId.getName().equals("COM1")) { >>> //if (portId.getName().equals("/dev/term/a")) { >>> SimpleRead reader = new SimpleRead(); >>> } >>> } >>> } >>> } >>> public SimpleRead() { >>> try { >>> serialPort = (SerialPort) portId.open("SimpleReadApp", >>> 2000); >>> } catch (PortInUseException e) {} >>> try { >>> inputStream = serialPort.getInputStream(); >>> } catch (IOException e) {} >>> try { >>> serialPort.addEventListener(this); >>> } catch (TooManyListenersException e) {} >>> serialPort.notifyOnDataAvailable(true); >>> try { >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, >>> SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> } catch (UnsupportedCommOperationException e) {} >>> readThread = new Thread(this); >>> readThread.start(); >>> } >>> public void run() { >>> try { >>> Thread.sleep(20000); >>> } catch (InterruptedException e) {} >>> } >>> public void serialEvent(SerialPortEvent event) { >>> switch(event.getEventType()) { >>> case SerialPortEvent.BI: >>> case SerialPortEvent.OE: >>> case SerialPortEvent.FE: >>> case SerialPortEvent.PE: >>> case SerialPortEvent.CD: >>> case SerialPortEvent.CTS: >>> case SerialPortEvent.DSR: >>> case SerialPortEvent.RI: >>> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >>> break; >>> case SerialPortEvent.DATA_AVAILABLE: >>> byte[] readBuffer = new byte[20]; >>> try { >>> while (inputStream.available() > 0) { >>> int numBytes = inputStream.read(readBuffer); >>> } >>> System.out.print(new String(readBuffer)); >>> } catch (IOException e) {} >>> break; >>> } >>> } >>> } >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> >> cheers >> YiQi Huang >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From smontgomery at mediaspansoftware.com Wed May 24 10:24:13 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 12:24:13 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: Tod & Joachim, Thanks for the info, that's very helpful. I'll give that a whirl when I move to rxtx 2.1. I'm still using the older 2.0.7 version for now (don't ask), which probably requires the Sun comm.jar, javax.comm.properties and librxtxSerial.jnilib to be in very specific places in each jvm's file hierarchy. From tjarvi at qbang.org Wed May 24 11:59:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 11:59:16 -0600 (MDT) Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: On Wed, 24 May 2006, Sean Montgomery wrote: > Tod & Joachim, > > Thanks for the info, that's very helpful. I'll give that a whirl > when I move to rxtx 2.1. I'm still using the older 2.0.7 version for > now (don't ask), which probably requires the Sun comm.jar, > javax.comm.properties and librxtxSerial.jnilib to be in very specific > places in each jvm's file hierarchy. > You will need comm.jar from Sun then. It must be Sun's version 2.* or older for Linux or Solaris. I assume they have this in download archives. The default offering from Sun is version 3.0. This version currently does not support rxtx. The older version will probably be fine for your needs. -- Trent Jarvi tjarvi at qbang.org From smontgomery at mediaspansoftware.com Wed May 24 12:19:06 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 14:19:06 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: <3939EFB8-11E1-4E3E-A684-5B3C525577CD@mediaspansoftware.com> Yup, that's right, thanks Trent. I've been using these files for quite a while now. Thanks for bringing it up. I almost didn't mention using 2.0.7 because I didn't want to give any new members of the list the wrong idea! :-) On May 24, 2006, at 1:59 PM, Trent Jarvi wrote: > On Wed, 24 May 2006, Sean Montgomery wrote: > >> Tod & Joachim, >> >> Thanks for the info, that's very helpful. I'll give that a whirl >> when I move to rxtx 2.1. I'm still using the older 2.0.7 version for >> now (don't ask), which probably requires the Sun comm.jar, >> javax.comm.properties and librxtxSerial.jnilib to be in very specific >> places in each jvm's file hierarchy. >> > > You will need comm.jar from Sun then. It must be Sun's version 2.* or > older for Linux or Solaris. I assume they have this in download > archives. > > The default offering from Sun is version 3.0. This version > currently does > not support rxtx. > > The older version will probably be fine for your needs. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mark at mdsh.com Wed May 24 15:55:46 2006 From: mark at mdsh.com (Mark Himsley) Date: Wed, 24 May 2006 22:55:46 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <37B0FC4B1F3237321F093ABE@MacMini.local> On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) That's no problem. BUT, do note that the instructions I elaborated on are in the INSTALL file within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone please update the INSTALL file? > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > > , it includes DLLs for Windows and the JAR > > for Java. > > > > Follow the Windows instructions in the INSTALL. > > > > ie > > > > RXTXcomm.jar goes in \jre\lib\ext (under java) > > rxtxSerial.dll goes in \jre\bin > > > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > > C:\Program Files\Java\jre1.5.0_06\lib\ext > > and copy rxtxSerial.dll into > > C:\Program Files\Java\jre1.5.0_06\bin > > > > Yes, it really is that simple. > > > > > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > > > >> I am new to serial port programming, and have no experience on > >> programming java in xp, but my project require me to builld a > >> communication link between xp and a UART device. > >> > >> Most of the information in the web site seems for linux only. > >> including > >> the commands such as export and chmod. How do I install rxtx in xp? > >> > >> cheers > >> YiQi Huang > > > > > > > > -- > > Mark Himsley > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Mark Himsley From tjarvi at qbang.org Wed May 24 16:41:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 16:41:46 -0600 (MDT) Subject: [Rxtx] install rxtx in XP In-Reply-To: <37B0FC4B1F3237321F093ABE@MacMini.local> References: <37B0FC4B1F3237321F093ABE@MacMini.local> Message-ID: On Wed, 24 May 2006, Mark Himsley wrote: > > > On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > >> I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > That's no problem. > > BUT, do note that the instructions I elaborated on are in the INSTALL file > within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone > please update the INSTALL file? > > The INSTALL file may be updated by anyone at anytime. http://rxtx.qbang.org/wiki/index.php/Installation We are moving it to the wiki so end users may put the type of answers they would like to see in. Sometimes it's best if developers don't give what appears to be cryptic answers. You can even put in that jre/lib/ext is not the right place but you don't understand the classpath solution mentioned on the mail-list and then we know what to add. -- Trent Jarvi tjarvi at qbang.org From stramit at gmail.com Wed May 24 21:45:31 2006 From: stramit at gmail.com (Tim Cooper) Date: Thu, 25 May 2006 13:45:31 +1000 Subject: [Rxtx] Accessing Virtual Com Port Message-ID: Hi, I have to develop an application that talks to a virtual com port (in this case com3) which translates any messages sent across a USB cable to a micro. Using C++ I can talk to this com port and I know that it is configured, present, and working. For the application that I am trying to write I want to use RXTX for the communication. My problem is that the configured virtual port (in windows) is not showing up when I do an enumeration over the available ports. The output I get is (com 3 is not present) : Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 PORT FOUND: COM1 PORT FOUND: LPT1 Is there anything that I need to do to make com3 available to RXTX and my application? Timothy Cooper -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060524/c5591648/attachment-0403.html From antonio.luis at iscte.pt Thu May 25 01:39:13 2006 From: antonio.luis at iscte.pt (=?ISO-8859-1?Q?Ant=F3nio_Lopes?=) Date: Thu, 25 May 2006 08:39:13 +0100 Subject: [Rxtx] RXTX on Pocket PC Message-ID: <44755F21.8060103@iscte.pt> Hello everyone, I've been using RXTX to communicate with serial ports in Windows and it's been quite successful. However, I'm now considering porting my application from Windows to Pocket PC but I can't seem to find the RXTX binaries (*.jar and *.dll) to use in Pocket PC. I've been "digging" on the mailing list's archives and also on the web and I can't find these anywhere. Can anyone in this mailing list give me some pointers on this? Where can I find the necessary files and basic installation instructions? Thanks very much for your help. I very much appreciate any help that you can provide me. Regards, -- Ant?nio Lopes @contact: antonio.luis at iscte.pt @work: ADETTI - ISCTE @web: http://antonio.lopes.googlepages.com/home From doug at dupreeinc.com Fri May 26 15:45:50 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Fri, 26 May 2006 14:45:50 -0700 Subject: [Rxtx] rxtx slow startup Message-ID: <4477770E.9010400@dupreeinc.com> Hello, I hope there are people still reading this mailing list. The archive appeared to not have anything new after 4/2005. I was using the commapi from sun for a project where a java application reads data from test equipment connected to the serial port. I had to upgrade the ftdi vcp driver on my pc and the old sun commapi no longer works with hardware flow control. as an experiment I replaced the javax.com with gnu.io in the SerialDemo.java project that was included with the commapi. This compiled fine using JBuilder 2006 and JRE 1.5.0_05. RXTX also works with the latest ftdi drivers so life is wonderful again... almost... When using the commapi jar the SerialDemo program starts in about 1 second on my system. Using the RXTX jar it takes over 56 seconds to start. Has anyone else seen this problem? Is there a workaround to get the startup performance close to the old commapi? The last thing printed to the console before this delay is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks for your time! Doug From yhua537 at cse.unsw.edu.au Sat May 27 05:46:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 21:46:45 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <4477770E.9010400@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> Message-ID: hi Doug The archive hasn't been update for a long time, But people certainly still reading the list. I don't have enough experience to help on your problem, but without any detail about what your problem doing during that 56 seconds, it is hard to target the your question, I think. cheers YiQi On Fri, 26 May 2006, Doug Thistlethwaite wrote: > Hello, > > I hope there are people still reading this mailing list. The archive > appeared to not have anything new after 4/2005. > > I was using the commapi from sun for a project where a java application > reads data from test equipment connected to the serial port. I had to > upgrade the ftdi vcp driver on my pc and the old sun commapi no longer > works with hardware flow control. as an experiment I replaced the > javax.com with gnu.io in the SerialDemo.java project that was included > with the commapi. This compiled fine using JBuilder 2006 and JRE > 1.5.0_05. RXTX also works with the latest ftdi drivers so life is > wonderful again... almost... > > When using the commapi jar the SerialDemo program starts in about 1 > second on my system. Using the RXTX jar it takes over 56 seconds to > start. Has anyone else seen this problem? Is there a workaround to get > the startup performance close to the old commapi? > > The last thing printed to the console before this delay is: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Thanks for your time! > > Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------- Just a student, Still a student ------------------------------- From yhua537 at cse.unsw.edu.au Sat May 27 06:04:26 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 22:04:26 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: Sorry, I don't think you could understand what I mean .I mean this: Without any detail about what your program is doing during that 56 seconds, it is hard for anyone to target the problem. On Sat, 27 May 2006, YiQi Huang wrote: > hi Doug > > The archive hasn't been update for a long time, But people certainly still > reading the list. > > I don't have enough experience to help on your problem, but without any > detail about what your problem doing during that 56 seconds, it is hard to > target the your question, I think. > > cheers > YiQi > > On Fri, 26 May 2006, Doug Thistlethwaite wrote: > >> Hello, >> >> I hope there are people still reading this mailing list. The archive >> appeared to not have anything new after 4/2005. >> >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From jredman at ergotech.com Sat May 27 08:32:02 2006 From: jredman at ergotech.com (Jim Redman) Date: Sat, 27 May 2006 08:32:02 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: <447862E2.4080506@ergotech.com> Doug, Since you mentioned it, we have a system that is also seems slow. From memory (I don't have one of the slow systems around), I'm not sure that it's consistent, it seems that sometimes it may take longer than others. Since it's part of the bootup it hasn't raised a flag and I haven't researched it. The same code runs much faster on other systems, so now you've got me wondering what's different. The slow system boots DSL (http://www.damnsmalllinux.org/) from a compact flash. FC4 is on my desktop where I haven't noticed a slow down. I think that the rxtx code is the same in both cases with lock files disabled. The slow system has a bunch of serial ports defined, including 4 USB serial ports that do not exist - they are not plugged in. Any clues in there? Jim > On Fri, 26 May 2006, Doug Thistlethwaite wrote: >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Sat May 27 10:41:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 May 2006 10:41:54 -0600 (MDT) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447862E2.4080506@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: On Sat, 27 May 2006, Jim Redman wrote: > Doug, > > Since you mentioned it, we have a system that is also seems slow. From > memory (I don't have one of the slow systems around), I'm not sure that > it's consistent, it seems that sometimes it may take longer than others. > Since it's part of the bootup it hasn't raised a flag and I haven't > researched it. > > The same code runs much faster on other systems, so now you've got me > wondering what's different. > > The slow system boots DSL (http://www.damnsmalllinux.org/) from a > compact flash. FC4 is on my desktop where I haven't noticed a slow > down. I think that the rxtx code is the same in both cases with lock > files disabled. > > The slow system has a bunch of serial ports defined, including 4 USB > serial ports that do not exist - they are not plugged in. > > Any clues in there? > rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. When it does this, it will try to open each port and do a timed out read. most systems will not have entries in device if the port is not there. But some minimal systems will just put all the device files there in case hardware is added. The list of devices scanned used to be ~10-20 times longer than it is today. That was getting very slow. I suspect moving the device files not used to a backup directory would increase the enumeration. I'll look into why the mail-list archive is not updating. The last update was about when I thought I 'fixed' the cron jobs. I probably didn't actually fix it but rather moved the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon May 29 19:46:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 May 2006 19:46:47 -0600 (MDT) Subject: [Rxtx] Mail-List Archives are updating. Message-ID: It was pointed out earlier that the archive is dated. This was a missing crontab entry. The list is currently archived by the week on the web page. It is updated once a day. So every 7 days it starts a new link and updates it daily. I've been limited in what I could do while my cable modem was disconnected this last week. rxtx.org is something I do on my own time. The patches and credits will be comming next. Many of these can be seen in bugzilla right now. -- Trent Jarvi tjarvi at qbang.org From doug at dupreeinc.com Tue May 30 11:18:41 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 10:18:41 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: <447C7E71.4080204@dupreeinc.com> Trent, YiQi, and Jim: Thanks to all for the replies and information! I am just back from a long weekend and I am now trying to figure out what I was doing! :) As for more information. First off, this example is being run under windows XP. I am developing test equipment that communicates with a java application via a serial port. I have been using the commapi for several years and have not had a problem. Recently, I have started a design modification that will replace the RS232 connection with a USB port. I am using the ftdi module for prototyping and I discovered that their virtual com port driver was not compatible with the commapi that Sun released. It turns out that it has problems with hardware flow control ( it works on incoming but not outgoing communications). The way I figured this out was by experimenting with the SerialDemo that was included with the Sum commapi. One nice thing about this example is it has the ability to set incoming and outgoing flow control independently. After I installed RXTX into my JBuilder 2006 IDE, I just replaced all all instances of javax.comm with gnu.io and it compiled and runs without a hitch (except for the slow startup). I Paused the JBuilder IDE during this long pause and the last few entries in the stack trace are: testRead() : -1, gnu.io.RXTXCommDriver registerValidPorts() : 255, gnu.io.RXTXCommDriver registerScannedPorts() : 777, gnu.io.RXTXCommDriver This was all initiated by the following call in the programs init routine: Enumeration en = CommPortIdentifier.getPortIdentifiers(); After looking at this, My guess is that Trent is correct in that the delay is in scanning for ports. I guess one solution would be to not scan for ports, though it would be nice to detect what is available on the system. Is there any way to reduce the number of ports scanned by this function in windows XP? Thanks again for your time, Doug Trent Jarvi wrote: >On Sat, 27 May 2006, Jim Redman wrote: > > > >>Doug, >> >>Since you mentioned it, we have a system that is also seems slow. From >>memory (I don't have one of the slow systems around), I'm not sure that >>it's consistent, it seems that sometimes it may take longer than others. >>Since it's part of the bootup it hasn't raised a flag and I haven't >>researched it. >> >>The same code runs much faster on other systems, so now you've got me >>wondering what's different. >> >>The slow system boots DSL (http://www.damnsmalllinux.org/) from a >>compact flash. FC4 is on my desktop where I haven't noticed a slow >>down. I think that the rxtx code is the same in both cases with lock >>files disabled. >> >>The slow system has a bunch of serial ports defined, including 4 USB >>serial ports that do not exist - they are not plugged in. >> >>Any clues in there? >> >> >> > >rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. > >When it does this, it will try to open each port and do a timed out read. >most systems will not have entries in device if the port is not there. >But some minimal systems will just put all the device files there in case >hardware is added. > >The list of devices scanned used to be ~10-20 times longer than it is >today. That was getting very slow. > >I suspect moving the device files not used to a backup directory would >increase the enumeration. > >I'll look into why the mail-list archive is not updating. The last update >was about when I thought I 'fixed' the cron jobs. I probably didn't >actually fix it but rather moved the problem. > >-- >Trent Jarvi >tjarvi at qbang.org > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/86796453/attachment-0400.html From doug at dupreeinc.com Tue May 30 14:36:09 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 13:36:09 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447C7E71.4080204@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com> Message-ID: <447CACB9.1000801@dupreeinc.com> Hello all, I also notice this pause (not as long however) when I call: CommPortIdentifier.getPortIdentifier(PortName); I would think that if I supply the name of the port, it would not have to go through the same discovery process. If you have any ideas of how to get rid of this startup delay, I would really appreciate it. Thanks, Doug Doug Thistlethwaite wrote: > Trent, YiQi, and Jim: > > Thanks to all for the replies and information! I am just back from a > long weekend and I am now trying to figure out what I was doing! :) > > As for more information. First off, this example is being run under > windows XP. I am developing test equipment that communicates with a > java application via a serial port. I have been using the commapi for > several years and have not had a problem. Recently, I have started a > design modification that will replace the RS232 connection with a USB > port. I am using the ftdi module for prototyping and I discovered > that their virtual com port driver was not compatible with the commapi > that Sun released. It turns out that it has problems with hardware > flow control ( it works on incoming but not outgoing communications). > The way I figured this out was by experimenting with the SerialDemo > that was included with the Sum commapi. One nice thing about this > example is it has the ability to set incoming and outgoing flow > control independently. > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup). > > I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are: > > testRead() : -1, gnu.io.RXTXCommDriver > registerValidPorts() : 255, gnu.io.RXTXCommDriver > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > This was all initiated by the following call in the programs init routine: > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > After looking at this, My guess is that Trent is correct in that the > delay is in scanning for ports. I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system. Is there any way to reduce the number of ports scanned by > this function in windows XP? > > Thanks again for your time, > > Doug > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/edaa5c3c/attachment-0400.html From lynn at swcp.com Tue May 30 15:07:18 2006 From: lynn at swcp.com (lynn@swcp.com) Date: Tue, 30 May 2006 21:07:18 -0000 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CACB9.1000801@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: *IF* the name of the port is supplied, we might want to use the preferences mechanism (java.util.prefs) where we could have previously saved the info for the port. We could do a quick check to see that things have not changed before using it. If things have changed (or never been defined) we would do a full port scan and save detected ports in the preferences. This way if the hardware is not changed, you only pay the time penalty one time. just an idea... Lynn Doug Thistlethwaite said: > This is a multi-part message in MIME format. > --------------070808020900080005070500 > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > Content-Transfer-Encoding: 7bit > > Hello all, > > I also notice this pause (not as long however) when I call: > > CommPortIdentifier.getPortIdentifier(PortName); > > I would think that if I supply the name of the port, it would not have > to go through the same discovery process. If you have any ideas of how > to get rid of this startup delay, I would really appreciate it. > > Thanks, > > Doug > > Doug Thistlethwaite wrote: > > > Trent, YiQi, and Jim: > > > > Thanks to all for the replies and information! I am just back from a > > long weekend and I am now trying to figure out what I was doing! :) > > > > As for more information. First off, this example is being run under > > windows XP. I am developing test equipment that communicates with a > > java application via a serial port. I have been using the commapi for > > several years and have not had a problem. Recently, I have started a > > design modification that will replace the RS232 connection with a USB > > port. I am using the ftdi module for prototyping and I discovered > > that their virtual com port driver was not compatible with the commapi > > that Sun released. It turns out that it has problems with hardware > > flow control ( it works on incoming but not outgoing communications). > > The way I figured this out was by experimenting with the SerialDemo > > that was included with the Sum commapi. One nice thing about this > > example is it has the ability to set incoming and outgoing flow > > control independently. > > > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > > all instances of javax.comm with gnu.io and it compiled and runs > > without a hitch (except for the slow startup). > > > > I Paused the JBuilder IDE during this long pause and the last few > > entries in the stack trace are: > > > > testRead() : -1, gnu.io.RXTXCommDriver > > registerValidPorts() : 255, gnu.io.RXTXCommDriver > > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > > > This was all initiated by the following call in the programs init routine: > > > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > > > After looking at this, My guess is that Trent is correct in that the > > delay is in scanning for ports. I guess one solution would be to not > > scan for ports, though it would be nice to detect what is available on > > the system. Is there any way to reduce the number of ports scanned by > > this function in windows XP? > > > > Thanks again for your time, > > > > Doug > > > > --------------070808020900080005070500 > Content-Type: text/html; charset=ISO-8859-1 > Content-Transfer-Encoding: 7bit > > > > > > > > > Hello all,
>
> I also notice this pause (not as long however) when I call:
>
>          CommPortIdentifier.getPortIdentifier(PortName);
>
> I would think that if I supply the name of the port, it would not have > to go through the same discovery process.  If you have any ideas of how > to get rid of this startup delay, I would really appreciate it.
>
> Thanks,
>
> Doug
>
> Doug Thistlethwaite wrote: >
> > Trent, YiQi, and Jim:
>
> Thanks to all for the replies and information!  I am just back from a > long weekend and I am now trying to figure out what I was doing! :)
>
> As for more information.  First off, this example is being run under > windows XP.  I am developing test equipment that communicates with a > java application via a serial port.  I have been using the commapi for > several years and have not had a problem.  Recently, I have started a > design modification that will replace the RS232 connection with a USB > port.  I am using the ftdi module for prototyping and I discovered that > their virtual com port driver was not compatible with the commapi that > Sun released.  It turns out that it has problems with hardware flow > control ( it works on incoming but not outgoing communications).  The > way I figured this out was by experimenting with the SerialDemo that > was included with the Sum commapi.  One nice thing about this example > is it has the ability to set incoming and outgoing flow control > independently.
>
> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup).
>
> I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are:
>
> testRead() : -1, gnu.io.RXTXCommDriver
> registerValidPorts() : 255, gnu.io.RXTXCommDriver
> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>
> This was all initiated by the following call in the programs init > routine:
>
> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>
> After looking at this,  My guess is that Trent is correct in that the > delay is in scanning for ports.  I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system.  Is there any way to reduce the number of ports scanned by > this function in windows XP? 
>
> Thanks again for your time,
>
> Doug
>
>
> > > > --------------070808020900080005070500-- > -- From jredman at ergotech.com Tue May 30 15:42:35 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 30 May 2006 15:42:35 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: <447CBC4B.2080206@ergotech.com> Lynn, If I understand your idea correctly, I don't think that this would work well for, say, USB ports since these can be easily added/removed by the end user. Jim lynn at swcp.com wrote: > *IF* the name of the port is supplied, we might want to use the preferences > mechanism (java.util.prefs) where we could have previously saved the info for > the port. We could do a quick check to see that things have not changed > before using it. If things have changed (or never been defined) we would do a > full port scan and save detected ports in the preferences. > > This way if the hardware is not changed, you only pay the time penalty one time. > > just an idea... > Lynn > > > Doug Thistlethwaite said: > >> This is a multi-part message in MIME format. >> --------------070808020900080005070500 >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >> Content-Transfer-Encoding: 7bit >> >> Hello all, >> >> I also notice this pause (not as long however) when I call: >> >> CommPortIdentifier.getPortIdentifier(PortName); >> >> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process. If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it. >> >> Thanks, >> >> Doug >> >> Doug Thistlethwaite wrote: >> >>> Trent, YiQi, and Jim: >>> >>> Thanks to all for the replies and information! I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :) >>> >>> As for more information. First off, this example is being run under >>> windows XP. I am developing test equipment that communicates with a >>> java application via a serial port. I have been using the commapi for >>> several years and have not had a problem. Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port. I am using the ftdi module for prototyping and I discovered >>> that their virtual com port driver was not compatible with the commapi >>> that Sun released. It turns out that it has problems with hardware >>> flow control ( it works on incoming but not outgoing communications). >>> The way I figured this out was by experimenting with the SerialDemo >>> that was included with the Sum commapi. One nice thing about this >>> example is it has the ability to set incoming and outgoing flow >>> control independently. >>> >>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup). >>> >>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are: >>> >>> testRead() : -1, gnu.io.RXTXCommDriver >>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>> >>> This was all initiated by the following call in the programs init routine: >>> >>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>> >>> After looking at this, My guess is that Trent is correct in that the >>> delay is in scanning for ports. I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system. Is there any way to reduce the number of ports scanned by >>> this function in windows XP? >>> >>> Thanks again for your time, >>> >>> Doug >>> >> --------------070808020900080005070500 >> Content-Type: text/html; charset=ISO-8859-1 >> Content-Transfer-Encoding: 7bit >> >> >> >> >> >> >> >> >> Hello all,
>>
>> I also notice this pause (not as long however) when I call:
>>
>>         >  CommPortIdentifier.getPortIdentifier(PortName);
>>
>> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process.  If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it.
>>
>> Thanks,
>>
>> Doug
>>
>> Doug Thistlethwaite wrote: >>
>> >> Trent, YiQi, and Jim:
>>
>> Thanks to all for the replies and information!  I am just back from a >> long weekend and I am now trying to figure out what I was doing! :)
>>
>> As for more information.  First off, this example is being run under >> windows XP.  I am developing test equipment that communicates with a >> java application via a serial port.  I have been using the commapi for >> several years and have not had a problem.  Recently, I have started a >> design modification that will replace the RS232 connection with a USB >> port.  I am using the ftdi module for prototyping and I discovered that >> their virtual com port driver was not compatible with the commapi that >> Sun released.  It turns out that it has problems with hardware flow >> control ( it works on incoming but not outgoing communications).  The >> way I figured this out was by experimenting with the SerialDemo that >> was included with the Sum commapi.  One nice thing about this example >> is it has the ability to set incoming and outgoing flow control >> independently.
>>
>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >> all instances of javax.comm with gnu.io and it compiled and runs >> without a hitch (except for the slow startup).
>>
>> I Paused the JBuilder IDE during this long pause and the last few >> entries in the stack trace are:
>>
>> testRead() : -1, gnu.io.RXTXCommDriver
>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>
>> This was all initiated by the following call in the programs init >> routine:
>>
>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>
>> After looking at this,  My guess is that Trent is correct in that the >> delay is in scanning for ports.  I guess one solution would be to not >> scan for ports, though it would be nice to detect what is available on >> the system.  Is there any way to reduce the number of ports scanned by >> this function in windows XP? 
>>
>> Thanks again for your time,
>>
>> Doug
>>
>>
>> >> >> >> --------------070808020900080005070500-- >> > > > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From yhua537 at cse.unsw.edu.au Tue May 30 18:10:23 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 31 May 2006 10:10:23 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CBC4B.2080206@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: Doug, In the SerialDemo, it allow us to save the parameters into a file, and use it when your program start up. Would this help? YiQi On Tue, 30 May 2006, Jim Redman wrote: > Lynn, > > If I understand your idea correctly, I don't think that this would work > well for, say, USB ports since these can be easily added/removed by the > end user. > > Jim > > lynn at swcp.com wrote: >> *IF* the name of the port is supplied, we might want to use the preferences >> mechanism (java.util.prefs) where we could have previously saved the info for >> the port. We could do a quick check to see that things have not changed >> before using it. If things have changed (or never been defined) we would do a >> full port scan and save detected ports in the preferences. >> >> This way if the hardware is not changed, you only pay the time penalty one time. >> >> just an idea... >> Lynn >> >> >> Doug Thistlethwaite said: >> >>> This is a multi-part message in MIME format. >>> --------------070808020900080005070500 >>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>> Content-Transfer-Encoding: 7bit >>> >>> Hello all, >>> >>> I also notice this pause (not as long however) when I call: >>> >>> CommPortIdentifier.getPortIdentifier(PortName); >>> >>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process. If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it. >>> >>> Thanks, >>> >>> Doug >>> >>> Doug Thistlethwaite wrote: >>> >>>> Trent, YiQi, and Jim: >>>> >>>> Thanks to all for the replies and information! I am just back from a >>>> long weekend and I am now trying to figure out what I was doing! :) >>>> >>>> As for more information. First off, this example is being run under >>>> windows XP. I am developing test equipment that communicates with a >>>> java application via a serial port. I have been using the commapi for >>>> several years and have not had a problem. Recently, I have started a >>>> design modification that will replace the RS232 connection with a USB >>>> port. I am using the ftdi module for prototyping and I discovered >>>> that their virtual com port driver was not compatible with the commapi >>>> that Sun released. It turns out that it has problems with hardware >>>> flow control ( it works on incoming but not outgoing communications). >>>> The way I figured this out was by experimenting with the SerialDemo >>>> that was included with the Sum commapi. One nice thing about this >>>> example is it has the ability to set incoming and outgoing flow >>>> control independently. >>>> >>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>> all instances of javax.comm with gnu.io and it compiled and runs >>>> without a hitch (except for the slow startup). >>>> >>>> I Paused the JBuilder IDE during this long pause and the last few >>>> entries in the stack trace are: >>>> >>>> testRead() : -1, gnu.io.RXTXCommDriver >>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>> >>>> This was all initiated by the following call in the programs init routine: >>>> >>>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>> >>>> After looking at this, My guess is that Trent is correct in that the >>>> delay is in scanning for ports. I guess one solution would be to not >>>> scan for ports, though it would be nice to detect what is available on >>>> the system. Is there any way to reduce the number of ports scanned by >>>> this function in windows XP? >>>> >>>> Thanks again for your time, >>>> >>>> Doug >>>> >>> --------------070808020900080005070500 >>> Content-Type: text/html; charset=ISO-8859-1 >>> Content-Transfer-Encoding: 7bit >>> >>> >>> >>> >>> >>> >>> >>> >>> Hello all,
>>>
>>> I also notice this pause (not as long however) when I call:
>>>
>>>         >>  CommPortIdentifier.getPortIdentifier(PortName);
>>>
>>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process.  If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it.
>>>
>>> Thanks,
>>>
>>> Doug
>>>
>>> Doug Thistlethwaite wrote: >>>
>>> >>> Trent, YiQi, and Jim:
>>>
>>> Thanks to all for the replies and information!  I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :)
>>>
>>> As for more information.  First off, this example is being run under >>> windows XP.  I am developing test equipment that communicates with a >>> java application via a serial port.  I have been using the commapi for >>> several years and have not had a problem.  Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port.  I am using the ftdi module for prototyping and I discovered that >>> their virtual com port driver was not compatible with the commapi that >>> Sun released.  It turns out that it has problems with hardware flow >>> control ( it works on incoming but not outgoing communications).  The >>> way I figured this out was by experimenting with the SerialDemo that >>> was included with the Sum commapi.  One nice thing about this example >>> is it has the ability to set incoming and outgoing flow control >>> independently.
>>>
>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup).
>>>
>>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are:
>>>
>>> testRead() : -1, gnu.io.RXTXCommDriver
>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>
>>> This was all initiated by the following call in the programs init >>> routine:
>>>
>>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>
>>> After looking at this,  My guess is that Trent is correct in that the >>> delay is in scanning for ports.  I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system.  Is there any way to reduce the number of ports scanned by >>> this function in windows XP? 
>>>
>>> Thanks again for your time,
>>>
>>> Doug
>>>
>>>
>>> >>> >>> >>> --------------070808020900080005070500-- >>> >> >> >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From halbleib at rechnerbetriebsgruppe.de Wed May 31 02:06:16 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 10:06:16 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp Message-ID: <447D4E78.30302@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, I getting an error while reloading my app in tomcat. At the first start everything runs well, but if i reload mit webapp by tomcat manager i get the following error. java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader Is there a possibility to unload the native library rxtxSerial.dll? thx for all help! regards tom -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 b8FT80HQ1xlbDLnRecDANCc= =heb1 -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 02:52:17 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 10:52:17 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D4E78.30302@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> Message-ID: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Hello Tom, To the best of my knowledge it is impossible to unload native libraries once loaded into the JVM. The exception you see stems from the fact, that Tomcat creates a new classloader when you "reload" the weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar is loaded from the session class loader. Try to add RXTXComm.jar to your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. Regards, Joachim On 31.05.2006, at 10:06, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 > b8FT80HQ1xlbDLnRecDANCc= > =heb1 > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From halbleib at rechnerbetriebsgruppe.de Wed May 31 03:28:35 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 11:28:35 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Message-ID: <447D61C3.1030807@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Joachim, I'm still not getting it. How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml-file? Perhaps web.xml? Regards, Tom Joachim Buechse schrieb: > Hello Tom, > > To the best of my knowledge it is impossible to unload native > libraries once loaded into the JVM. The exception you see stems from > the fact, that Tomcat creates a new classloader when you "reload" the > weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar > is loaded from the session class loader. Try to add RXTXComm.jar to > your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. > > Regards, > Joachim > > On 31.05.2006, at 10:06, Tom Halbleib wrote: > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL tzNy+/0iIUfkYYgt1+UT1ko= =pkpY -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 04:03:42 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 12:03:42 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D61C3.1030807@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> <447D61C3.1030807@rechnerbetriebsgruppe.de> Message-ID: -Xbootclasspath/a: is a start option to the java vm. Google is your friend in finding how to modfiy it and what it means: tomcat modifying bootclasspath Regards, Joachim On 31.05.2006, at 11:28, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Joachim, > > I'm still not getting it. > How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml- > file? > Perhaps web.xml? > > Regards, > Tom > > Joachim Buechse schrieb: >> Hello Tom, >> >> To the best of my knowledge it is impossible to unload native >> libraries once loaded into the JVM. The exception you see stems from >> the fact, that Tomcat creates a new classloader when you "reload" the >> weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar >> is loaded from the session class loader. Try to add RXTXComm.jar to >> your bootlclasspath (-Xbootclasspath/a:) and the problem should go >> away. >> >> Regards, >> Joachim >> >> On 31.05.2006, at 10:06, Tom Halbleib wrote: >> >> Hi all, >> >> I getting an error while reloading my app in tomcat. At the first >> start >> everything runs well, but if i reload mit webapp by tomcat manager >> i get >> the following error. >> >> java.lang.UnsatisfiedLinkError: Native Library >> C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in >> another classloader thrown while loading gnu.io.RXTXCommDriver >> Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: >> Native >> Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already >> loaded >> in another classloader >> >> >> Is there a possibility to unload the native library rxtxSerial.dll? >> >> thx for all help! >> >> regards >> >> tom > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL > tzNy+/0iIUfkYYgt1+UT1ko= > =pkpY > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From impakt01 at optusnet.com.au Wed May 31 06:55:42 2006 From: impakt01 at optusnet.com.au (Daren) Date: Wed, 31 May 2006 22:55:42 +1000 Subject: [Rxtx] (no subject) Message-ID: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/ade7ad37/attachment-0400.html From doug at dupreeinc.com Wed May 31 10:19:19 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 31 May 2006 09:19:19 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: <447DC207.3070702@dupreeinc.com> I am not sure what you are saying. The Save parameters menu option saves the current settings (baud, data bits, etc.). The long pause (~60 seconds) is when the application first starts (before loading the saved parameters). This does bring up a question, though I hate this type of kludge approach to getting this library to work... What exactly is a PortIdentifier? Is it always the same? If I stored the results from "CommPortIdentifier.getPortIdentifier(PortName);" in a file, could I use this the next time the program is executed? In this case I am using a virtual com port driver to connect to the device through a USB port. Doug YiQi Huang wrote: >Doug, > >In the SerialDemo, it allow us to save the parameters into a file, and use >it when your program start up. Would this help? > >YiQi > >On Tue, 30 May 2006, Jim Redman wrote: > > > >>Lynn, >> >>If I understand your idea correctly, I don't think that this would work >>well for, say, USB ports since these can be easily added/removed by the >>end user. >> >>Jim >> >>lynn at swcp.com wrote: >> >> >>>*IF* the name of the port is supplied, we might want to use the preferences >>>mechanism (java.util.prefs) where we could have previously saved the info for >>>the port. We could do a quick check to see that things have not changed >>>before using it. If things have changed (or never been defined) we would do a >>>full port scan and save detected ports in the preferences. >>> >>>This way if the hardware is not changed, you only pay the time penalty one time. >>> >>>just an idea... >>>Lynn >>> >>> >>>Doug Thistlethwaite said: >>> >>> >>> >>>>This is a multi-part message in MIME format. >>>>--------------070808020900080005070500 >>>>Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>>>Content-Transfer-Encoding: 7bit >>>> >>>>Hello all, >>>> >>>>I also notice this pause (not as long however) when I call: >>>> >>>> CommPortIdentifier.getPortIdentifier(PortName); >>>> >>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process. If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it. >>>> >>>>Thanks, >>>> >>>>Doug >>>> >>>>Doug Thistlethwaite wrote: >>>> >>>> >>>> >>>>>Trent, YiQi, and Jim: >>>>> >>>>>Thanks to all for the replies and information! I am just back from a >>>>>long weekend and I am now trying to figure out what I was doing! :) >>>>> >>>>>As for more information. First off, this example is being run under >>>>>windows XP. I am developing test equipment that communicates with a >>>>>java application via a serial port. I have been using the commapi for >>>>>several years and have not had a problem. Recently, I have started a >>>>>design modification that will replace the RS232 connection with a USB >>>>>port. I am using the ftdi module for prototyping and I discovered >>>>>that their virtual com port driver was not compatible with the commapi >>>>>that Sun released. It turns out that it has problems with hardware >>>>>flow control ( it works on incoming but not outgoing communications). >>>>>The way I figured this out was by experimenting with the SerialDemo >>>>>that was included with the Sum commapi. One nice thing about this >>>>>example is it has the ability to set incoming and outgoing flow >>>>>control independently. >>>>> >>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>>without a hitch (except for the slow startup). >>>>> >>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>>entries in the stack trace are: >>>>> >>>>>testRead() : -1, gnu.io.RXTXCommDriver >>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>>> >>>>>This was all initiated by the following call in the programs init routine: >>>>> >>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>>> >>>>>After looking at this, My guess is that Trent is correct in that the >>>>>delay is in scanning for ports. I guess one solution would be to not >>>>>scan for ports, though it would be nice to detect what is available on >>>>>the system. Is there any way to reduce the number of ports scanned by >>>>>this function in windows XP? >>>>> >>>>>Thanks again for your time, >>>>> >>>>>Doug >>>>> >>>>> >>>>> >>>>--------------070808020900080005070500 >>>>Content-Type: text/html; charset=ISO-8859-1 >>>>Content-Transfer-Encoding: 7bit >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>>Hello all,
>>>>
>>>>I also notice this pause (not as long however) when I call:
>>>>
>>>>        >>>> >>>> >>> CommPortIdentifier.getPortIdentifier(PortName);
>>> >>> >>>>
>>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process.  If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it.
>>>>
>>>>Thanks,
>>>>
>>>>Doug
>>>>
>>>>Doug Thistlethwaite wrote: >>>>
>>>> >>>>Trent, YiQi, and Jim:
>>>>
>>>>Thanks to all for the replies and information!  I am just back from a >>>>long weekend and I am now trying to figure out what I was doing! :)
>>>>
>>>>As for more information.  First off, this example is being run under >>>>windows XP.  I am developing test equipment that communicates with a >>>>java application via a serial port.  I have been using the commapi for >>>>several years and have not had a problem.  Recently, I have started a >>>>design modification that will replace the RS232 connection with a USB >>>>port.  I am using the ftdi module for prototyping and I discovered that >>>>their virtual com port driver was not compatible with the commapi that >>>>Sun released.  It turns out that it has problems with hardware flow >>>>control ( it works on incoming but not outgoing communications).  The >>>>way I figured this out was by experimenting with the SerialDemo that >>>>was included with the Sum commapi.  One nice thing about this example >>>>is it has the ability to set incoming and outgoing flow control >>>>independently.
>>>>
>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>without a hitch (except for the slow startup).
>>>>
>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>entries in the stack trace are:
>>>>
>>>>testRead() : -1, gnu.io.RXTXCommDriver
>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>>
>>>>This was all initiated by the following call in the programs init >>>>routine:
>>>>
>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>>
>>>>After looking at this,  My guess is that Trent is correct in that the >>>>delay is in scanning for ports.  I guess one solution would be to not >>>>scan for ports, though it would be nice to detect what is available on >>>>the system.  Is there any way to reduce the number of ports scanned by >>>>this function in windows XP? 
>>>>
>>>>Thanks again for your time,
>>>>
>>>>Doug
>>>>
>>>>
>>>> >>>> >>>> >>>>--------------070808020900080005070500-- >>>> >>>> >>>> >>> >>> >>> >>-- >>Jim Redman >>(505) 662 5156 x85 >>http://www.ergotech.com >>_______________________________________________ >>Rxtx mailing list >>Rxtx at qbang.org >>http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > >cheers >YiQi Huang >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/61d4d4c9/attachment-0399.html From impakt01 at optusnet.com.au Wed May 31 17:02:54 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 09:02:54 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Message-ID: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Hi all, I downloaded 2.1.7-pre16 and managed to build it and get it going. I made the changes as suggested by Peter Smith in an old post, by adding his code to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. Still not working, it opens the port at 9600 according to portmon.exe . Has anyone managed to get this going at a custom rate? Here is the post I'm referring to: http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 Thanks, Daren ________________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Daren Sent: Wednesday, 31 May 2006 10:56 PM To: rxtx at qbang.org Subject: [Rxtx] (no subject) Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren From tjarvi at qbang.org Wed May 31 21:44:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 May 2006 21:44:01 -0600 (MDT) Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> References: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Message-ID: On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org From impakt01 at optusnet.com.au Wed May 31 22:06:04 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 14:06:04 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: Message-ID: <200606010406.k51464X2010447@mail03.syd.optusnet.com.au> Trent, I have managed to successfully open the port at this speed using Realterm (available on sourceforge). From memory this uses DLPortIO. Using portmon.exe with realterm, even there it says that the port has opened at 1953. I changed termios.c:560 to dcb->BaudRate = 1953 ; and it still opens the port at 9600. Daren -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Thursday, 1 June 2006 1:44 PM To: RXTX Developers and Users Subject: Re: [Rxtx] custom baud rate win32 On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From smontgomery at mediaspansoftware.com Mon May 1 09:52:28 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 11:52:28 -0400 Subject: [Rxtx] RXTX, Java COMM and Windows Server 2003 on x64 experiences? Message-ID: Just wondering if anybody here has had to deploy RXTX or the javax.comm on Windows Server 2003 machines running on x64 (i.e. Xeon EM64T) and would like to relate how things went. From Sun's site, the Supported System Configurations pages give the options for that system: Java 5.0: - 32-bit Java 5.0 running on the OS in the 32-bit mode - 64-bit Java 5.0 running on the OS in the 64-bit native mode Java 1.4.2: - no options listed for EM64T processors, but potentially the standard 32-bit Java 1.4.2 could run on the OS in 32-bit mode? I guess the two main points of failure would be 1) the JVM itself and 2) the jni components. Make that three: there's gotta be hardware vendor driver support for the OS in the various modes, too. Guess I better go look at Keyspan's website... Thanks in advance for any info anyone might be able to provide. From smontgomery at mediaspansoftware.com Mon May 1 10:18:33 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 12:18:33 -0400 Subject: [Rxtx] Mailing list archive out of date? Message-ID: The mailing list archive at: http://mailman.qbang.org/pipermail/rxtx/ only shows emails through the end of March. Is there a new archive somewhere else? Didn't see anything mentioned on the wiki. From p.cain at phasefale.com.au Mon May 1 22:33:09 2006 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 02 May 2006 14:33:09 +1000 Subject: [Rxtx] RXTX and the Linux kernel. Message-ID: <4456E105.5080106@phasefale.com.au> Hi, First off the problem I am having isn't caused by RXTX itself but I'm hoping someone out there may have some knowledge that may help me. Background: I have an application monitoring a control system through a standard PC serial port which I talk to with rxtx-2.0.5. The application runs on RedHat7.3 kernel version 2.4.18 using Java 1.4. This configuration has been in use for several years and has proved to be stable. But it has become necessary for me to upgrade the OS but I'm running into problems with the serial communications. Its not that the comms don't work on the new OS (its never that simple) the comms work for a variable period of time (sometimes several hours) and then just stop, nothing on the data lines and control lines all indicate that data could flow. The new OS is Ubuntu 5.10 running kernel version 2.6.12. I have installed the OS and software on a PC and had it perform ok, then install the new OS and same software on the very same hardware and experienced the problems of them comms stopping. In the new OS I'm using Java5 to run the app but since I have experience the problem I reverted back to Java1.4 which didn't fix the problem. I've moved the app to a different system RedHat FC3 running 2.6.14 had experienced the problem. Not wanting to go through all the thing I have tried but I have established that it seems to be the 2.6 versions of the kernel that seem to be the problem and not an individual distribution of Linux. I should point out that I am using the same jar and library files for each java and OS combination. So I'm just wondering if anyone has had or heard of problems similar to these ? Or perhaps might know of what changed in the Linux serial driver (something I'm having a hard time establishing). I'm starting to run low on ideas of what to try so any help would be much appreciated. -- Peter Cain Senior Programmer Phasefale Pty Ltd From tjarvi at qbang.org Wed May 3 07:31:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 May 2006 07:31:00 -0600 (MDT) Subject: [Rxtx] Re: Concering ircomm and RXTX In-Reply-To: References: Message-ID: On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From legolas.w at gmail.com Wed May 3 08:46:23 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 19:16:23 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <4458C23F.2000003@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From legolas.w at gmail.com Wed May 3 13:10:57 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 23:40:57 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <44590041.80706@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From Lars.Hennig at wow-portal.com Thu May 4 00:39:15 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Thu, 4 May 2006 08:39:15 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: Message-ID: Hi, I could not find any solution. I therefore decided to to my own native implementation. Allthough it only supports the functions I need, it works pretty well now for me. I think the main problem there is the use of a wrong Windows API function and not setting an timeout. Regards, Lars Hennig W?rth Online World GmbH Tel. (0049)7181-258183 Mob. (0049)160-3522889 Fax. (0049)7940-153299 Lars.Hennig at wow-portal.com Gesendet von: rxtx-bounces at qbang.org 09.04.2006 10:42 Bitte antworten zu RXTX Developers and Users An d.herwald at dsh-elektronik.de, RXTX Developers and Users Kopie Thema Re: [Rxtx] USB Serialport - disconnection problems WV Proj./Teilpr.: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/7b39f374/attachment.html From Pawan.Kharbanda at dot.state.co.us Thu May 4 11:00:58 2006 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Thu, 4 May 2006 11:00:58 -0600 Subject: [Rxtx] Dangling Lock Files Message-ID: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Hi, I have been using RXTX API's for the Serial Communication for quite some time now and for some of the devices we are opening and closing the connection every 2 minutes. This works great for few days and then suddenly I start seeing some "Port in Use Exception" and I see that the Lock files are still in the /var/lock folder after manually removing the lock files it works good for few hours and I see the same problem again. Can somebody explain me the scenarios why I am seeing the dangling Lock files? I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise Servers. Thanks Pawan Kharbanda -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/ba0e9261/attachment.html From tjarvi at qbang.org Thu May 4 14:10:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:10:30 -0600 (MDT) Subject: [Rxtx] Dangling Lock Files In-Reply-To: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> References: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Message-ID: On Thu, 4 May 2006, Kharbanda, Pawan wrote: > Hi, > I have been using RXTX API's for the Serial Communication for quite > some time now and for some of the devices we are opening and closing the > connection every 2 minutes. This works great for few days and then > suddenly I start seeing some "Port in Use Exception" and I see that the > Lock files are still in the /var/lock folder after manually removing the > lock files it works good for few hours and I see the same problem again. > Can somebody explain me the scenarios why I am seeing the dangling Lock > files? > > I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise > Servers. Hi Pawan The next time it happens, look in the lockfile. There will be a pid. ps aux |grep 'pid' I think you will see that the application is still running for some reason. RXTX does a kill -0 on the pid to see if its alive. If not, it will remove the lockfile. So I suspect the previous program did not exit as you expected. -- Trent Jarvi tjarvi at qbang.org From Scott.Hughes at dalsemi.com Thu May 4 14:23:11 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 4 May 2006 15:23:11 -0500 Subject: [Rxtx] Wiki instructions... Message-ID: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire demo apps, when I stumbled across this tip on the wiki to add yourself to the uucp group: It may be simpler to just run usermod -G uucp jarvi Taken from: http://rxtx.qbang.org/wiki/index.php/Installation This does not work as advertised. I should have read the man page for usermod before I tried that out. If there are any groups which are not listed after the -G switch, the user is removed from those groups. On Ubuntu, this is bad... I removed myself from the Admin group, which removed my sudo priviledges. Ubuntu has no root account, so I've disabled the only account which could fix it. Anyone know of a good workaround? Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor From tjarvi at qbang.org Thu May 4 14:32:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:32:09 -0600 (MDT) Subject: [Rxtx] Wiki instructions... In-Reply-To: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> Message-ID: On Thu, 4 May 2006, Scott Hughes wrote: > I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire > demo apps, when I stumbled across this tip on the wiki to add yourself to > the uucp group: > > It may be simpler to just run > > usermod -G uucp jarvi > > Taken from: > http://rxtx.qbang.org/wiki/index.php/Installation > > This does not work as advertised. I should have read the man page for > usermod before I tried that out. If there are any groups which are not > listed after the -G switch, the user is removed from those groups. On > Ubuntu, this is bad... I removed myself from the Admin group, which removed > my sudo priviledges. Ubuntu has no root account, so I've disabled the only > account which could fix it. > > Anyone know of a good workaround? > Yikes This will get your permissions back: in grub/lilo/.. pass the following option to the kernel init=/bin/sh You are now root. when it boots, mount -o remount,rw / add yourself to the groups, reboot to get normal init going. Thats about all I can think of without sudo/root. -- Trent Jarvi tjarvi at qbang.org From Gettings at earth.utah.edu Thu May 4 14:41:22 2006 From: Gettings at earth.utah.edu (Paul Gettings) Date: Thu, 4 May 2006 14:41:22 -0600 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <20060504204122.GA6534@earth.utah.edu> When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get messages on stdout from the JVM: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 As the only change was the version of RXTX (from 2.1.6), I am unsure why the messages suddenly appeared. Anyone know how to get rid of them? Thanks. -- 101 USES FOR A DEAD MICROPROCESSOR (23) Dead cat brush From mmester at sps.edu Mon May 1 21:22:28 2006 From: mmester at sps.edu (Michael Mester) Date: Mon, 1 May 2006 23:22:28 -0400 Subject: [Rxtx] Windows PortInUseException Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> I'm trying to get simple serial communication going with RxTx under Windows XP. I can enumerate the ports fine, but I always run into problems when I try to open one. I get a PortInUseException, but the owner application is "Unknown" and the port is never open. I've tried this on several different systems and all of them give the same behavior. The only thing I can thiunk of that might be causing the problem is that fact that I had to put the serial .dll file in system32 instead of the reccommended folder, because it didn't work in the folder the documentation gives. The library loads fine, though, so I'm not sure whether that makes sense, and I don't know how to fix it anyway. Any help is greatly appreciated. Below is the output of the program, right up to the PortInUseException and the NullPointerException it causes (because the serial port object is not instantiated). C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI Starting GPSTalkerGUI... Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 gnu.io.PortInUseException: Unknown Application Exception in thread "main" java.lang.NullPointerException at GPSTalkerGUI.(GPSTalkerGUI.java:102) at GPSTalkerGUI.main(GPSTalkerGUI.java:161) Again, thank you very much for any help you can give. From lshellman at qwest.net Wed May 3 01:38:34 2006 From: lshellman at qwest.net (Lucious Shellman) Date: Wed, 03 May 2006 01:38:34 -0600 Subject: [Rxtx] Help needed: Project using parallel port Message-ID: <1146641914.8337.14.camel@localhost.localdomain> I was looking for a way to access the parallel port on a PC using Java. Searching the Internet, I came across this site (rxtx.org). What I am trying to do is detect logic levels from a TTL logic IC on the parallel port. I am not trying to do classic parallel port communication. I just want to detect whether a line(s) is (are) high or low. I am using Windows 98. Can rxtx be used to do this? If yes, is there a tutorial for using rxtx posted on the Internet that someone can direct me to. If you need more information, feel free to e-mail me. Unfortunately for me, I need the information ASAP. Thanks. lshellman at qwest.net From webmaster at egyhelp.com Wed May 3 18:43:39 2006 From: webmaster at egyhelp.com (Mohamed Samy) Date: Thu, 4 May 2006 02:43:39 +0200 Subject: [Rxtx] RE: Concering ircomm and RXTX In-Reply-To: Message-ID: <20060503184362.SM01044@Geek> Hey, I issue the command "modprobe ircomm-tty" yet no ttyircomm appears, while the ircomm appear by "modprobe ircomm" so forgive me but I am bit lost. Even searching google for the keyword "ttyircomm" only returns 3 matches. So any way I can start the ttyircomm???? Thanks a lot. -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Wednesday, May 03, 2006 3:31 PM To: Mohamed Samy; rxtx at qbang.org Cc: taj at www.linux.org.uk Subject: Re: Concering ircomm and RXTX On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 4 15:49:49 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 15:49:49 -0600 (MDT) Subject: [Rxtx] Windows PortInUseException In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> Message-ID: On Mon, 1 May 2006, Michael Mester wrote: > > I'm trying to get simple serial communication going with RxTx under > Windows XP. I can enumerate the ports fine, but I always run into > problems when I try to open one. I get a PortInUseException, but the > owner application is "Unknown" and the port is never open. I've tried > this on several different systems and all of them give the same > behavior. The only thing I can thiunk of that might be causing the > problem is that fact that I had to put the serial .dll file in system32 > instead of the reccommended folder, because it didn't work in the folder > the documentation gives. The library loads fine, though, so I'm not sure > whether that makes sense, and I don't know how to fix it anyway. Any > help is greatly appreciated. Below is the output of the program, right > up to the PortInUseException and the NullPointerException it causes > (because the serial port object is not instantiated). > > C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI > Starting GPSTalkerGUI... > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > gnu.io.PortInUseException: Unknown Application > Exception in thread "main" java.lang.NullPointerException > at GPSTalkerGUI.(GPSTalkerGUI.java:102) > at GPSTalkerGUI.main(GPSTalkerGUI.java:161) > Perhaps you are trying to open the port twice in your code? rxtx does open the ports, do a timed out read and then close the ports during enumeration. I think the port is being opened fine. The Unknown Application is always reported. On linux, there is some code that finds the actual application but on windows, its always unknown. If the port enumeration is returning the ports you expect, rxtx has opened the port and closed it with success. The port should open. There is also example code in the contrib directory that comes with rxtx source that has examples you can modify to work. -- Trent Jarvi tjarvi at qbang.org From Christian.Klemke at t-online.de Thu May 4 23:37:23 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Fri, 5 May 2006 07:37:23 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu> Message-ID: <004f01c67005$fc72fee0$016a10ac@NB600> Hi Paul, I was wondering about the same question some days ago and took a look at the source files. Unfortunately, I found that you can only get rid of that messages by altering and recompiling the Java code. There is a final static boolean variable called "devel" in the file "RXTXCommDriver.java" which is set to "true". This constellation causes the output after the native libraries have been loaded. No mechanism exists to suppress them otherwise :-(. Trent, does that mean that 2.1.7 is still officially a "development" version ? When will this value be changed to "false" by default ? With 2.1.8 ? It would be nice to provide a means to suppress such messages besides that static flag (maybe by setting a property called "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The output can indeed by annoying, especially when used with console applications, where the message potentially appears "in the middle" of your own output. Another possibility would be not to use System.out directly, but instead some PrintStream field which is initially set to System.out but can programatically be changed. That would allow for any kind of redirection or suppression by implementing appropriate user-defined PrintStream subclasses and making RXTX use that stream. What do you think ? Best regards, Christian ----- Original Message ----- From: "Paul Gettings" To: Sent: Thursday, May 04, 2006 10:41 PM Subject: [Rxtx] RXTX causing stdout messages > When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get > messages on stdout from the JVM: > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > As the only change was the version of RXTX (from 2.1.6), I am unsure > why the messages suddenly appeared. Anyone know how to get rid of > them? > > Thanks. > > -- > 101 USES FOR A DEAD MICROPROCESSOR > (23) Dead cat brush > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri May 5 06:09:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 06:09:46 -0600 (MDT) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <004f01c67005$fc72fee0$016a10ac@NB600> References: <20060504204122.GA6534@earth.utah.edu> <004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: On Fri, 5 May 2006, Christian Klemke wrote: > Hi Paul, > > I was wondering about the same question some days ago and took a look at the > source files. Unfortunately, I found that you can only get rid of that > messages by altering and recompiling the Java code. There is a final static > boolean variable called "devel" in the file "RXTXCommDriver.java" which is > set to "true". This constellation causes the output after the native > libraries have been loaded. No mechanism exists to suppress them otherwise > :-(. > > Trent, does that mean that 2.1.7 is still officially a "development" version > ? When will this value be changed to "false" by default ? With 2.1.8 ? It > would be nice to provide a means to suppress such messages besides that > static flag (maybe by setting a property called > "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The > output can indeed by annoying, especially when used with console > applications, where the message potentially appears "in the middle" of your > own output. Another possibility would be not to use System.out directly, but > instead some PrintStream field which is initially set to System.out but can > programatically be changed. That would allow for any kind of redirection or > suppression by implementing appropriate user-defined PrintStream subclasses > and making RXTX use that stream. What do you think ? > A patch for using properties would be accepted I'm sure. The reason the default is to display the message is not related to the development state of rxtx anymore. The problem is that people first using rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. The message prevents a great deal of email thats easily explained by the message. I question if we should support rxtx 2.0 at all anymore. If you post a patch in bugzilla, we'll put it into CVS this weekend. we'll be going through and doing such things anyhow. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri May 5 13:23:56 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 13:23:56 -0600 (MDT) Subject: [Rxtx] How to read from RxTx parallel port in Win XP In-Reply-To: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> References: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> Message-ID: On Thu, 27 Apr 2006, Worsley, Bob (Development Engineer) wrote: > I'm sorry if this is a dumb question, but I didn't find the answer in > the archives. > > I'm using the RxTx binaries for Windows on a reasonably current notebook > PC running Windows XP. I can send stuff to a printer on the parallel > port (LPT1), but I can't get anything back. > > I wrote a class that has the methods listed below. I write some data to > the printer with the "write" method and then try to read a response > using the "read" method, but I never get any data. I'd greatly > appreciate any help you can give! > > Bob Worsley > bobwoyid2 at yahoo.com > > > > > private ParallelPort parallelPort = null; > private RXTXCommDriver parallelPortDriver = null; > > > public boolean initialize() throws IOException { > if (parallelPort != null) { > return false; // Already initialized > } > > // Create the parallel port; > parallelPortDriver = new RXTXCommDriver(); > parallelPort = > (ParallelPort)parallelPortDriver.getCommPort(address, > CommPortIdentifier.PORT_PARALLEL); > > // Set the parallel port parameters. > try { > parallelPort.enableReceiveTimeout(READ_TIMEOUT); > parallelPort.disableReceiveFraming(); > parallelPort.disableReceiveThreshold(); > //parallelPort.setMode(mode); !!!!errors > } catch (UnsupportedCommOperationException e) { > throw (new IOException("Parallel port with address '" + > address > + "' cannot be configured as specified")); > } > > return true; > } > > > > public void write(final byte[] bytes) throws IOException { > initialize(); > while (busyReading) { > Thread.yield(); > } > busyWriting = true; > if (bytes.length < 1) { > return; > } > OutputStream outputStream = parallelPort.getOutputStream(); > outputStream.write(bytes); > outputStream.flush(); > outputStream.close(); > Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); > busyWriting = false; > } > > > public byte[] read() throws IOException { > > // Read up to MAX_BYTES bytes. > initialize(); > while (busyWriting) { > Thread.yield(); > } > busyReading = true; > byte[] buff = new byte[MAX_BYTES_READ]; > InputStream inputStream = parallelPort.getInputStream(); > // This read blocks until input data is available > int bytesRead = inputStream.read(buff); > inputStream.close(); > // If no data read, create empty array > if (bytesRead == -1) { > bytesRead = 0; > } > byte[] deviceBytes = new byte[bytesRead]; > System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); > if (bytesRead > 0) { > Debug.p("PPIOP.read - got data: '" + new > String(deviceBytes) + "'"); > } > busyReading = false; > return deviceBytes; > } > Hi Bob I've only used rxtx to test a hello world page printing but there are others that have used it. PPIOP? hmm what is this? :) The rxtx parallel support is behind the serial support but should be OK. As you note, the setting of modes is not supported. rxtx uses what is provided when the port is open. Are your asserting the pin for the printer being online? I suspect what often happens is people try to just use the data pins but the C API rxtx uses wants the printer to be online. There should be some posts relating to this in the rxtx mail-list archive. Some APIs are probably reading and writing from the port address (also suggested in your code as something you are looking at). RXTX currently uses a higher level C/C++ API for port access. This can still work if the API thinks the 'printer' is there. -- Trent Jarvi tjarvi at qbang.org From agrodellic at gmail.com Sat May 6 08:39:40 2006 From: agrodellic at gmail.com (Leigh Stewart) Date: Sat, 6 May 2006 10:39:40 -0400 Subject: [Rxtx] sun commapi 3 Message-ID: I think I read here: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html that rxtx-2.0 is basically fracked for now? Does anyone know of a workaround? ie can i somehow get an older version of sun's comm api and use that (not easy to find)? i mean 2.0 must be working for someone...how is it being tested. 2.1 isnt working for me....im getting nasty native exceptions etc, which is why im so set on 2.0... any ideas? From tjarvi at qbang.org Sun May 7 15:40:27 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 7 May 2006 15:40:27 -0600 (MDT) Subject: [Rxtx] sun commapi 3 In-Reply-To: References: Message-ID: On Sat, 6 May 2006, Leigh Stewart wrote: > > 2.1 isnt working for me....im getting nasty native exceptions etc, > which is why im so set on 2.0... any ideas? > Hi Leigh What native exceptions are you seeing? Which OS? The native code is almost identical between rxtx 2.0 and 2.1. Only the names have been changed to protect the inocent. :) ie: javax_comm_... vs gnu_io_... So the odds are very likely that even if you do find commapi 2.0 and get it installed, you will run into the same error. It would be better to just find and fix the problem. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Mon May 8 10:47:20 2006 From: mail at willicon.de (WILLICon) Date: Mon, 08 May 2006 18:47:20 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 Message-ID: <445F7618.3070303@willicon.de> Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/ef37e8ec/attachment.html From tjarvi at qbang.org Mon May 8 16:14:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 May 2006 16:14:51 -0600 (MDT) Subject: [Rxtx] Screenshot of Application using RXTX (fwd) Message-ID: Just though someone may end up searching for 0x0D and 0x0A. Here are the details from his system. SuSE Linux 10.0 (x86_64) Kernel 2.6.13-15.8 j2se 1.4.2_11 (i586) Sun: comm3.0_u1 rxtx: rxtx-2.1-7 ---------- Forwarded message ---------- Date: Sat, 6 May 2006 20:01:46 +0200 From: Michael Poppitz To: taj at www.linux.org.uk Subject: Screenshot of Application using RXTX Hi Trent, the rxtx package works like a charm. Sun's package seemed to replace all 0x0D with 0x0A in received data on my Linux box, which is really annoying when transfering binary data. But rxtx came and saved the day - and turned out to be a lot more convenient as it does not require a configuration file. I use it for connecting to a home made logic analyzer. (http://www.sump.org/projects/analyzer/) Thanks for your great job, Michael -------------- next part -------------- A non-text attachment was scrubbed... Name: la_client.png Type: image/png Size: 16592 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/45494fbb/la_client.png From tjarvi at qbang.org Tue May 9 14:56:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 May 2006 14:56:05 -0600 (MDT) Subject: [Rxtx] RXTX javax.comm: which one to install? In-Reply-To: <20060509161742.43547.qmail@web53814.mail.yahoo.com> References: <20060509161742.43547.qmail@web53814.mail.yahoo.com> Message-ID: On Tue, 9 May 2006, Adenilson Cavalcanti wrote: > Dear Trent Jarvi > > I'm trying to write a small Java app running in linux that interfaces with a device connected to serial port. > > I do have some questions about RXTX and javax.comm state of affairs, since I'm new to Java programming (used to program in plain old C writting to devices using termios and open/write/read syscalls, but this is another story). > > I ask you the favor to clarify this issues (if possible...): > > a) Sun offers to download a file (comm3.0_u1_PUTAUNIXVERSION.zip) which does contain .so files. Does it work out of box? > > b) Case negative, its there that we should use 'librxtx*.so' provided by your site? > > c) Sun's comm3 API version does work with which version of rxtx? > > I already searched google and read documentation available in rxtx site ("Java Comm Serial API How-to") but still have this issues unsolved. Any help will be appreciated. > > Best regards > > Adenilson Hi Adenilson, RXTX does not currently support javax.comm in Sun's CommAPI 3.0. I would recommend using package gnu.io provided by rxtx 2.1. -- Trent Jarvi tjarvi at qbang.org From chris.develder at intec.ugent.be Wed May 10 08:45:40 2006 From: chris.develder at intec.ugent.be (Chris Develder) Date: Wed, 10 May 2006 16:45:40 +0200 Subject: [Rxtx] rxtx troubles on ARM Message-ID: <4461FC94.6040909@intec.ugent.be> Hi all, Sorry to bother you, but I don't seem to get RXTX working on an ARM processor (xscale ixp 425, big endian). I managed to crosscompile the rxtx libs and moved it over to the ARM. Using jamvm (which is the only open source java VM we got working on the ARM), I get the following error result when running SimpleRead from Sun's javax.comm examples (commapi\examples\Simple\SimpleRead) -- see bottom of mail for complete output: "java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver" However, output shows that the RXTXCommDriver code is accessible (cf. debug and devel output of lib versions). So it doesn't seem to be a missing lib/jar issue. The error happens before RXTXCommDriver.initialize() is called, since the first line there is System.out.println("RXTXCommDriver:initialize()"); Any ideas? Cheers, Chris ---------------------------- [root at xxx(ttyp1) /work/cdvelder/xscale/test]# jamvm -Djava.library.path=/work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/jre/lib/arm -classpath /work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/lib/ext/RXTXcomm.jar:./comm.jar:. SimpleRead RXTXCommDriver {} Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTXCommDriver: Jar version = RXTX-2.1-7 native lib Version = RXTX-2.1-7 java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver gnu/io/RXTXCommDriver at javax.comm.CommPortIdentifier.loadDriver (CommPortIdentifier.java:239) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:109) at SimpleRead.main (Unknown Source) java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive (Native Method) at com.sun.comm.Portmapping.registerCommPorts (Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase (Portmapping.java:100) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:138) at SimpleRead.main (Unknown Source) From joachim at buechse.de Fri May 12 00:44:48 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 08:44:48 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) Message-ID: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Good day, I guess that only a selected few (hi Trent) will be able to answer this question, but the answer might be interesting for anyone trying to debug or understand the code. Apparently the MonitorThread is started and stopped in RXTXPort.addEventListener and RXTXPort.removeEventListener. This would indicate that (originally?) the MonitorThread is only required when there is an EventListener. However the MonitorThread is also started in the RXTXPort constructor, which could mean that RXTX won't work at all if it isn't there. It seems to me, that if anyone would add an event listener and later on remove it, he could potentially wreak the port. Because the second action would kill the MonitorThread. For the moment I am only trying to understand the role of and idea behind the MonitorThread. But of course there is a deeper reason thor my question: If the MonitorThread needs to exist anyway, it could be the thread that cleans up the port (ie calls nativeClose) - this would eliminate (a further) problem I am seeing with some USB drivers on Mac OSX. (Close blocks (after releasing the tty, but still) in the USB driver if the device is "not responding"). Greetings, Joachim From tjarvi at qbang.org Fri May 12 07:10:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 12 May 2006 07:10:59 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Fri, 12 May 2006, Joachim Buechse wrote: > Good day, > > I guess that only a selected few (hi Trent) will be able to answer > this question, but the answer might be interesting for anyone trying > to debug or understand the code. > > Apparently the MonitorThread is started and stopped in > RXTXPort.addEventListener and RXTXPort.removeEventListener. This > would indicate that (originally?) the MonitorThread is only required > when there is an EventListener. However the MonitorThread is also > started in the RXTXPort constructor, which could mean that RXTX won't > work at all if it isn't there. > > It seems to me, that if anyone would add an event listener and later > on remove it, he could potentially wreak the port. Because the second > action would kill the MonitorThread. > > > For the moment I am only trying to understand the role of and idea > behind the MonitorThread. But of course there is a deeper reason thor > my question: > > If the MonitorThread needs to exist anyway, it could be the thread > that cleans up the port (ie calls nativeClose) - this would eliminate > (a further) problem I am seeing with some USB drivers on Mac OSX. > (Close blocks (after releasing the tty, but still) in the USB driver > if the device is "not responding"). > Hi Jaochim Before commapi, rxtx did not support events. You could read, write and change port settings. The MonitorThread was added as an afterthought to support commapi events. So the way things are now his historical spaghetti not a well devised plan. It is my opinion that the MonitorThread should exist as long as the port is open. The odd starting of the thread in the constructor and addEventListener was just to get past the obvious problem of people using the port without adding listeners. -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Fri May 12 07:59:50 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 15:59:50 +0200 Subject: [Rxtx] MonitorThread -> ChangeRequest In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: <2B1E508C-8CEE-4AB7-914D-E7BA25C871A2@buechse.de> In this case I suggest removing the starting/stopping of MonitorThread in addEventListener / removeEventListener. This should not affect existing projects. On 12.05.2006, at 15:10, Trent Jarvi wrote: > It is my opinion that the MonitorThread should exist as long as the > port > is open. The odd starting of the thread in the constructor and > addEventListener was just to get past the obvious problem of people > using > the port without adding listeners. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Fri May 12 11:43:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 19:43:21 +0200 Subject: [Rxtx] Spring Cleaning - some suggestions Message-ID: The current implementation of RXTX contains quite a lot of code that will break if it is used from several threads (especially on a multi processor machine). I think it would be nice to clean this up. I suggest the following changes (which keep the current semantics and should not influence existing projects in a negative way): - InterruptedException will never be ignored or reset - read methods will be protected with a Monitor - write methods will be protected with a (separate) Monitor - close() sets the read and write monitors into a "closed" state which will lead to IOExceptions for any following call to RXTXPort.read/write. - close() will wait a finite amount of time (maybe 500ms) for the release of the read and write monitors after that, it will trigger the closing of the file descriptor to abort any pending read or write. - close() will not call close(file_desc). Instead it will "interrupt" (ie set a flag and then, pthread_kill(ABRT)) the MonitorThread, the MonitorThread will call close(file_desc). - the monitors are properly released in a finally block the try of which starts directly after obtaining the monitor. - finally will not call close(file_desc) it will only "interrupt" the MonitorThread (see above) - the native-code (esp read) does not use SA_RESTART but checks Thread.interrupted() when it receives a SIGNAL (ie system call returns with EINTR or other signalling method). The read/write monitors will be allocated from a factory whose mode can be set to fast/normal/advanced. In fast-mode it will create "non thread safe, non synchronized" pseudo-monitors. In default mode, the monitors will store the owning thread. In "advanced" mode setting the monitors into closed state will "interrupt()" threads which are blocked in a native read/write. {Reasoning close behaviour: Calling close on a file descriptor in Windows unblocks any read() or write() on the same file descriptor with an error. On Solaris < 2.7 and MacOS X however the close() will/ can block - until the read or write have finished:-(( Even the JDK people have trouble with this. I dont know how Linux reacts in this case. The best practice for BSD/Solaris is to send a signal to the thread which will usually unblock the read/write with an EINTR - this however is not guarenteed as it also depends on the device driver. So the only resolution that will certainly not block the thread calling RXTXPort.close() (which will often enough be the AWT event dispatcher or the VM finalizer thread) is to call close(fd) from another thread.} {Reasoning read behaviour: It is rather uncommon to receive a signal while reading or writing - it will happen, but checking Thread.interrupted() when it happens will not degrade performance. The checking of Thread.interrupted() can be handled by returning to Java and potententially reentering into the native code if the thread was not interrupted or by calling back into the VM from the native code. On top of this, many functions like read(byte[]) or read(byte [], int, int) are allowed to return less than the requested amount of data. Only int read() is a bit more tricky. } [Trent: From the code I can tell, that you experimented quite a bit with signals. Do you know if the Java Thread.interrupt() triggers a unix signal on Linux/Solaris? If so, which one?? References: - http://java.sun.com/docs/hotspot/VMOptions.html - http://www.hp.com/products1/unix/java/infolibrary/prog_guide/ signals.html ] On OS X (hotspot client jdk-1.4.2) I did not see any signal propagated to the SELECT of the event_loop/MonitorThread (ie no EINTR) when I call monThread.interrupt(). This is a pitty, but thats the way it is. I simply assume this is true for most system calls. How to handle this? Of course it would be possible to install/ deinstall a specific signal handler before/after every native read and to natively send an ABRT signal if RXTXPort.close is called. A more elegant solution might be to have an additional "signaling" socket which is always included in the SELECT. Or the simplest solution: cap the timeout of the select to 500 ms (the loop around it exists already) after every timeout check the Thread.interrupted() flag. From a performance perspective this should be completely invisible... On the other hand, all write() calls need to be preceeded by a SELECT as well, to avoid running into a blocking write. Best regards, Joachim From lyon at docjava.com Sat May 13 05:54:52 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 13 May 2006 07:54:52 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Dmitry suggests that we acquire an implementation of a serial port reference, use it, then release it (i.e., check it back in). Joachim says that making serial ports thread friendly might be a good idea. This is a good idea. The design pattern that is close to this idea is the "Object Pool Design Pattern". # Object Pool Manage the reuse of objects for a type of object that is expensive to create or only a limited number of a kind of object can be created. It has been described at: http://www.developer.com/java/ent/article.php/626171 and in Marks' book, Patterns in Java, Volume 1. However, the Object Pool is intended to pool objects so that each object is just like every other object. The intent of the Parametric Singleton is to enable others to access the same resource at the same time (as long as the same parameters were used in construction). It sounds like we need a NEW Design Pattern (Oh no, Doug is doing it again!). Yes friends, you got me on a role (roll) :) If you like design patterns, you can thank me later. If you don't like design patterns, blame Dmitry, it was his idea ;) And Dave, thanks for the feedback on Singleton abuse. It has led me to change the way I think about application contexts, which we will see, below. We need (drum roll please): The Parametric Object Pool Design Pattern (POP) By Douglas A. Lyon ABSTRACT The goal of the Parametric Singleton design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values, in a given context. In comparison, the goal of the POP design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values and that only one reference to the class is checked out at a time, in a given context. A context is a namespace for holding identifiers during execution. In Java, A context can be changed in any of several ways. For example, creation of a new class loader, the deserialization of an old POP or the creation of a new process all create a new namespace. The POP Design Pattern combines the Parametric Singleton Design Pattern with the check out mechanism of the Object Pool Design Pattern. This enables unique creation of instances of a class. These instances are cached in a table. When a clients asks for an instance with these parameters, the cache is checked. If the instance is not in the cache it is created. If the instance is available, the clients checks out the instance. A reference is left to the clients that checked out the instance. The POP has the role of creating objects uniquely, from parameters. It also has the role of keeping track of which clients has checked out a given object. This is just like a library keeping track of who borrowed a book. If a resource is left unavailable in a system, a deadlock can occur. Deadlock debugging is facilitated by mapping a resource to the clients that have checked it out. We apply our POP Design Pattern to the retrieval of serial ports. The goal of our system is to make sure that serial ports are checked out to only one client at a time, and that they be checked back in when the client is done. The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. Users are discouraged from calling this the Parametric Object Oriented Pool (POOP). Introduction The intent of the POP Design Pattern is to ensure that a class has only one instance for a given set of parameter values. It also provides a point of access that is global to a given context. The POP uses the Singleton Design Pattern to ensure that there is only one POP, in the given context. The POP DP is responsible for checking out a reference to a given instance, and keeping track of that instance. The instance is responsible for sharing that instance. POP requires that users of the DP implement an interface that enables a recall facility. Thus, if there is a contention for a consumed resource, the deadlock can be resolved in an orderly fashion. Motivation A system cannot tolerate multiple instances of some classes with identical parameters used by different instances at the same time. For example, you cannot have two instances use the same serial port, at the same time. You cannot have two instances that are trying to listen to the same socket connection. You cannot have two instances writing to the same file structure at the same time. Further, once a serial port is checked out by a client, it is assigned to the client. This is like the spin-lock service provided by the operating system, only in the application layer. Naturally, deadlock will occur if a resource is not released, therefore the client of the resource is tracked. Recalling a resource is required for the POP DP by virtue of the implementation of an interface. The policy on how to break a deadlock (by honoring the recall) is application specific. As the operating system is often thought of as the arbiter of consumed resources (i.e., tape drives, serial ports, etc.) we frequently leave it to an operating system implementation to resolve these contention issues. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on naming conventions (which are not well standardized). The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. The POP Design Pattern can take on the role of the peer method mapper that homogenizes the API for different operating environments. That is, it can wrapper the different locking mechanisms used in different operating systems. POP that is responsible for keeping track of the instances created and the client that has checked them out. The POP Design Pattern is implemented using the Singleton Design Pattern. In Java, the POP implementation is declared final, so that it cannot be subclassed. The class also has a private constructor, so that other classes cannot instance it. The new design pattern is called the POP design pattern and it provides a way to check out and create instances with given parameters. Applicability Use the POP Design Pattern when: 1. There must be exactly one instance of a class with the given parameters in a given context. 2. The instances must be accessible to clients from a well-known access point. 3. The instances are reusable. 4. Only one client can check out an instance at a time. Structure Insert UML diagram here. Participants The POP Clients that need instances 1. The POP defines an instance upon request from a client, if, and only if, the instance does not already exist. 2. The POP returns the instance to the client. 3. The POP is responsible for creating unique instances from given parameters. 4. The POP is responsible to recalling instances from clients. Collaborations Clients obtain a reference to a POP instance only through the singleton design pattern. If the POP instance is left in an improper state (e.g., the serial port was left open) it is NOT the role of the POP to close the IO port. However, the POP can be requested to get the instance released. Nor is it the role of the POP Design Pattern to open the port. That role is delegate to some other part of the system. Further, it is the role of the POP Design Pattern to check out resources. However, it is still possible to have, multiple threads that have multiple references to the same resource at the same time. Checkout and resource requests are MUTEX locked (i.e., synchronized). Consequences The POP Design Pattern has several benefits: 1. Controlled access to parametrically defined instances. Since the POP encapsulates its instances, there is some limited control over how and when clients access it. 2. Reduced name space. The POP pattern avoids global variables that store instances created from the same parameter. Implementation Here are implementation issues to consider when using the POP pattern: 1. Unique mapping of parameters. The POP pattern requires that there be a mean to isomorphically map the parameter space into the instance space and back again. 2. Ensure unique instances. The POP pattern makes unique instances from parameters, and it does so only once. 3. Cache instances for fast retrieval. The POP must be able to look up instances, given some set of parameters, and do so from some data structure. That is, there must be enough space to hold references to all the instances the program will need. Also, a mechanism is needed to look up and retrieve the instances quickly enough to satisfy the clients. Sample Code To be written....any volunteers? Thanks! - Doug >I don't think I get it > >On Mar 22, 2006, at 9:36 AM, David Garnier wrote: >>Using the singleton pattern in this case is >>just convenient for the programmer. Problems >>arises >>pretty quickly, especially if you attempt to unit-test your classes. > > >so you're saying that something isn't so good >because you can not test it in the convenient >way? >if that's true, I'm totally disagree >change your test, debug whatever, but if >software is efficient at runtime, works fine and >only problem is some unit test >(which is some kind of framework for testing) >then dump that unit test , dump that unit >framework and make something appropriate to the >software >you're testing > >so if Douglas want to use singletons, what's the problem? >and what do you mean by abusing of singleton usage? > >of course singleton doesn't prevent concurrent >access to the resource across the processes >unless >you're using some OS facility to prevent it, besides >singleton as it was introduced is relevant only >and only inside of the same process >otherwise it's not singleton it's something else >(let's say network singleton: so you have remote >invocation facility >and some factory method that return object created by that facility) > >I don't have any problem with using any kind of singletons. > Parametric Singleton idea (if I understand it >right) could be easily implemented in the >following way: >use a map >populate map with instances of some class and key is your parameter >(you can use lazy population too) > >if somebody ask the key check the value if it's null so resource is taken >if somebody returns the resource put it back to the map > >public synchronized static Object getSomeResource(Object parameter); >public synchronized static void returnResource(Object parameter); > >getSomeResource (inside of the same process) could return null in 2 cases >1. if somebody (from other thread for example) already took that resource >2. if OS API said that resource corresponded to >that parameter (serial port with parameter = 1 >(port #)) >is locked and unavailable; >I'm not sure that in case of serial ports we >even need those Parametric Singletons >(unless lock checking is a very expensive operation) >just ask the OS about availability of that >resource and if it's available give it away >and then OS will lock it and therefore in next >time somebody ask it just answer that resource >is locked >and return null > >for example system has 2 serial ports available >so I ask getResource("tty"); >or I ask getResource("Bluetooth-Modem"); > >and if OS is ok you can give tty or Bluetooth-Modem or both > >no need for any additional pattern I think > >back to the problem >mac os x doesn't recognize locking via files, so >it handles locking via some API >an instance of the singleton in each process >should recognize that resource is locked >(by using that API) that's all >we don't have to make things more complicate >then they are just because there is some nice >design pattern or nice unit test framework or whatever >keep things simple, make them work fast, don't introduce middle layers >unless you have really good reason to do so > >of course I could be entirely wrong, so sorry about that in advance > >thanks > > >Dmitry Markman > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx >Good day, > >I guess that only a selected few (hi Trent) will be able to answer? >this question, but the answer might be interesting for anyone trying? >to debug or understand the code. > >Apparently the MonitorThread is started and stopped in? >RXTXPort.addEventListener and RXTXPort.removeEventListener. This? >would indicate that (originally?) the MonitorThread is only required? >when there is an EventListener. However the MonitorThread is also? >started in the RXTXPort constructor, which could mean that RXTX won't? >work at all if it isn't there. > >It seems to me, that if anyone would add an event listener and later? >on remove it, he could potentially wreak the port. Because the second? >action would kill the MonitorThread. > > >For the moment I am only trying to understand the role of and idea? >behind the MonitorThread. But of course there is a deeper reason thor? >my question: > >If the MonitorThread needs to exist anyway, it could be the thread? >that cleans up the port (ie calls nativeClose) - this would eliminate? >(a further) problem I am seeing with some USB drivers on Mac OSX.? >(Close blocks (after releasing the tty, but still) in the USB driver? >if the device is "not responding"). > >Greetings, >Joachim > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Sat May 13 10:07:37 2006 From: joachim at buechse.de (Joachim Buechse) Date: Sat, 13 May 2006 18:07:37 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Douglas, Looking at the current code, leaves me with the feeling, that there is a lot to do. Defining an API that wraps javax.comm to provide what you describe is certainly possible, but I wonder how much benefit it will actually provide. Personally I think the API defined by javax.comm "request/lock" a port with: cp= new CommunicationPort(identifier) "release" a port with: cp.close(); works quite nice for 99% of the applications. In my experience, the most efficient and elegant implementation is to wrap a port/socket/.. into a business object which declares the remote operations that are possible. Ie "uploadFile", "waitForPrompt", "getSerialNumber", "sendContact", "executeCommand", etc Those methods are then either synchronized or guarded by a monitor. I do not see how your design pattern applied to the port resource would help implementing this. [details start, skip if you agree to the above] When I talked about "thread-safe" I didn't mean several independent "sessions" accessing the port concurrently. I think this is a very rare usage. I believe the most common use case for serial ports today is the control of an external device from a PC running a GUI based application. To implement a clean Swing/AWT-GUI one needs to pass any action that can block to a "worker" thread (else the GUI blocks, the application appears dead). While it is possible to use own prespawned thread that will accept Runnables which operate on the port, this is not very elegant. It is more common to spawn a new thread for every action triggered by the user. Additionally the ABORT of a running operation is often implemented via a port.close() delegated to a different thread. - During the lifetime of a port, it will usually be accessed from several different threads. Instance variables need to be set/read in synchronized regions to guarantee a correct operation based on the Java memory model. - Synchronizing the access is usually handled on the application level (synchronizing the reads/writes is usually useless from the applications view because it is not a transaction mechanism). [details end] I am very open to learn about other scenarios where your proposed design pattern applied to the port resource is beneficial to the application implementor. Best regards, Joachim On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > Dmitry suggests that we acquire an implementation of > a serial port reference, use it, then release it (i.e., check it > back in). > > Joachim says that making serial ports thread friendly might be a > good idea. > > This is a good idea. The design pattern that is close to this idea > is the "Object Pool Design Pattern". > # Object Pool From jredman at ergotech.com Sun May 14 14:28:24 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 14:28:24 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers Message-ID: <446792E8.4000506@ergotech.com> Does anyone know of any work to make RXTX work with Ethernet (telent) Terminal Servers? If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? We've used RXTX with upwards of 100 virtual COM ports on Windows and it works well. Linux is more problematic. It would be good to have an OS independent solution to accesses remote Ethernet serial ports. Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From legolas.w at gmail.com Sun May 14 14:26:34 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:56:34 +0430 Subject: [Rxtx] does any one have a working sample of RXTX and LPT port Message-ID: <4467927A.4000008@gmail.com> Hi Thank you for reading my post does any one has a working sample for RXTX and LPT port ? Thanks From legolas.w at gmail.com Sun May 14 14:27:29 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:57:29 +0430 Subject: [Rxtx] does RXTX support Trigerr on parallel port? Message-ID: <446792B1.4040905@gmail.com> Hi does RXTX support trigger on LPT port ? if so , how i can use it ? Thanks From tjarvi at qbang.org Sun May 14 17:40:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 17:40:59 -0600 (MDT) Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: <446792E8.4000506@ergotech.com> References: <446792E8.4000506@ergotech.com> Message-ID: On Sun, 14 May 2006, Jim Redman wrote: > Does anyone know of any work to make RXTX work with Ethernet (telent) > Terminal Servers? > > If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 > Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? > Hi Jim It appears the author of NVTCom has decided to release the library into the public domain. Integration with rxtx is possible but it would be best to contact the author and find out what his intent is. I would suggest contacting the author with a proposal of what you would like to do and take it from there. We could 'take' public domain software but its better to show respect to the authors and respect their wishes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:10:23 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:10:23 -0600 (MDT) Subject: [Rxtx] does any one have a working sample of RXTX and LPT port In-Reply-To: <4467927A.4000008@gmail.com> References: <4467927A.4000008@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > Thank you for reading my post > does any one has a working sample for RXTX and LPT port ? > Thanks Hi Legolas LPT port support in rxtx is spotty. That means some people have sent in patches for what they do and it works well for them. The original code was not very good. It may have been 3 hours work :/ To get started, Sun has some demo programs with their commapi. With rxtx 2.1 you can change their code from using javax.com to gnu.io and it -should- work. But if it does not you can post here and on bugzilla. There has been more interest lately off the list and maybe there will be enough community resources to get what you need going. If you do get a sample program together, we would gladly put it in the contrib directory so the next person can get things going faster. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:12:12 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:12:12 -0600 (MDT) Subject: [Rxtx] does RXTX support Trigerr on parallel port? In-Reply-To: <446792B1.4040905@gmail.com> References: <446792B1.4040905@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > does RXTX support trigger on LPT port ? > if so , how i can use it ? > Hi Legolas As mentioned in the previous post, rxtx parallel support is not very mature. But if you can point to something that describes the trigger feature, we can probably make sure its there and give a quick code example. -- Trent Jarvi tjarvi at qbang.org From jredman at ergotech.com Sun May 14 22:22:48 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 22:22:48 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: References: <446792E8.4000506@ergotech.com> Message-ID: <44680218.4080008@ergotech.com> Trent, Trent Jarvi wrote: > On Sun, 14 May 2006, Jim Redman wrote: > >> Does anyone know of any work to make RXTX work with Ethernet (telent) >> Terminal Servers? >> >> If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 >> Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? >> > > Hi Jim > > It appears the author of NVTCom has decided to release the library into > the public domain. Integration with rxtx is possible but it would be best > to contact the author and find out what his intent is. > > I would suggest contacting the author with a proposal of what you would > like to do and take it from there. We could 'take' public domain software > but its better to show respect to the authors and respect their wishes. > I sent Marco(?), the author of the library, a note before asking the list - I'll let you know the response. If anyone is already working on it, or has an interest and more time and energy than me, I'd hate to duplicate the efforts. If no one is, and no one objects, maybe I'll see what I can do. Jim > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From Christian.Klemke at t-online.de Mon May 15 02:23:06 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Mon, 15 May 2006 10:23:06 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu><004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: <008a01c677f8$cae18590$02fea8c0@NB600> Hi Trent, Hi Paul, I finally found some time to create a simple patch to enable the optional suppression of version output to the console. It is based on a new system property called "gnu.io.rxtx.NoVersionOutput" which can by set to "true" if necessary. I had some problems accessing CVS, therefore I downloaded the rxtx-2.1-7r2 source archive from ftp.qbang.org (which is linked on the rxtx.org download page) and worked with that release. Please find my proposed patch in the attachment ! Regards, Christian ----- Original Message ----- From: "Trent Jarvi" To: "RXTX Developers and Users" Cc: ""Paul Gettings"" Sent: Friday, May 05, 2006 2:09 PM Subject: Re: [Rxtx] RXTX causing stdout messages > On Fri, 5 May 2006, Christian Klemke wrote: > >> Hi Paul, >> >> I was wondering about the same question some days ago and took a look at >> the >> source files. Unfortunately, I found that you can only get rid of that >> messages by altering and recompiling the Java code. There is a final >> static >> boolean variable called "devel" in the file "RXTXCommDriver.java" which >> is >> set to "true". This constellation causes the output after the native >> libraries have been loaded. No mechanism exists to suppress them >> otherwise >> :-(. >> >> Trent, does that mean that 2.1.7 is still officially a "development" >> version >> ? When will this value be changed to "false" by default ? With 2.1.8 ? It >> would be nice to provide a means to suppress such messages besides that >> static flag (maybe by setting a property called >> "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The >> output can indeed by annoying, especially when used with console >> applications, where the message potentially appears "in the middle" of >> your >> own output. Another possibility would be not to use System.out directly, >> but >> instead some PrintStream field which is initially set to System.out but >> can >> programatically be changed. That would allow for any kind of redirection >> or >> suppression by implementing appropriate user-defined PrintStream >> subclasses >> and making RXTX use that stream. What do you think ? >> > > A patch for using properties would be accepted I'm sure. > > The reason the default is to display the message is not related to the > development state of rxtx anymore. The problem is that people first using > rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. > The message prevents a great deal of email thats easily explained by the > message. > > I question if we should support rxtx 2.0 at all anymore. > > If you post a patch in bugzilla, we'll put it into CVS this weekend. > we'll be going through and doing such things anyhow. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_version_output_patch.diff Type: application/octet-stream Size: 991 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060515/3173c2b6/rxtx_version_output_patch.obj From lyon at docjava.com Mon May 15 06:06:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 May 2006 08:06:21 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Joachim makes several good points. Let me see if I can address some of them below: >Hello Douglas, > >Looking at the current code, leaves me with the feeling, that there? >is a lot to do. Yes! >Defining an API that wraps javax.comm to provide what? >you describe is certainly possible, but I wonder how much benefit it? >will actually provide. > >Personally I think the API defined by javax.comm > >"request/lock" a port with: > cp= new CommunicationPort(identifier) >"release" a port with: > cp.close(); > >works quite nice for 99% of the applications. I don't know what percentage of applications turn off locking, the way that I do in my version of the RXTX lib. I do know that this is not safe practice. I also know that it was motivated by the multi-platform nature of my code and that this was the only way I could make things work, at the time. Java does not appear to have a cross-platform standard for locking resources on various platforms. Each OS appears to have its own standard. The question of who breaks deadlocks and how this is done remains open, as this is not an easy question to resolve. Let me continue, below: > >In my experience, the most efficient and elegant implementation is to? >wrap a port/socket/.. into a business object which declares the? >remote operations that are possible. Ie "uploadFile",? >"waitForPrompt", "getSerialNumber", "sendContact", "executeCommand",? >etc Those methods are then either synchronized or guarded by a? >monitor. I do not see how your design pattern applied to the port? >resource would help implementing this. I have no problem with high-level wrappers that are application specific. That is a very good idea, but orthogonal with respect to the issue of deadlocks. More below: > >[details start, skip if you agree to the above] >When I talked about "thread-safe" I didn't mean several independent? >"sessions" accessing the port concurrently. I think this is a very? >rare usage. That is probably why turning locking off works so well! On the other hand, it is not safe and I shouldn't do it. >I believe the most common use case for serial ports today? >is the control of an external device from a PC running a GUI based? >application. To implement a clean Swing/AWT-GUI one needs to pass any? >action that can block to a "worker" thread (else the GUI blocks, the? >application appears dead). While it is possible to use own prespawned? >thread that will accept Runnables which operate on the port, this is? >not very elegant. It is more common to spawn a new thread for every? >action triggered by the user. Additionally the ABORT of a running? >operation is often implemented via a port.close() delegated to a? >different thread. Here lies the heart of serial port concern. An application opens a serial port and then dies. The application is restarted and finds the port locked. How do we clear the lock? Must the application's user reside in the UUCP group? Must installers of the serial port add users to the UUCP group? Should locking be handled at a high-level of abstraction in an operating system independent way? Should the implementation of the locking mechanism be translated into an API that is dependent on the OS convention? Suppose that we restrict the discussion to serial ports. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on inconsistent naming conventions. Hence my feeling that we need to mirror what is done in other API's; we need a locking toolkit that references peer methods, IMHO. >From the Java programming point of view, the locking API is portable across different platforms, but has, as its implementation, a native peer method that uses the conventions of the underlying OS. This enables portable resource locking (in theory!). Consider, for example: org.apache.commons.transaction.locking with: Interface LockManager at: http://jakarta.apache.org/commons/transaction/apidocs/org/apache/commons/transaction/locking/LockManager.html Or, more recently: java.util.concurrent.locks Interface Lock based on Doug Lea's code: http://kickjava.com/src/EDU/oswego/cs/dl/util/concurrent/ReadWriteLock.java.htm Should we incorporate a clean, portable design into serial port use, one that is consistent with current locking APIs? Basically, a comm port is a resource and resources are typically controlled by managers. Thus, I suggest that we make use of a CommPortManager to help control and centralize serial port usage. The question of how this is done remains open, IMHO, but using core API's like: java.util.concurrent.locks might not be amiss. High-level methods (getAllPorts, getAllSerialPorts, getAllParallelPorts, etc...) might be welcome additions. Basic questions like, "what if a port is in use?" remain open, hence my proposal for the new design pattern. Isn't it the CommPortManager's role to break the deadlock? Cheers! - Doug > >- During the lifetime of a port, it will usually be accessed from? >several different threads. Instance variables need to be set/read in? >synchronized regions to guarantee a correct operation based on the? >Java memory model. >- Synchronizing the access is usually handled on the application? >level (synchronizing the reads/writes is usually useless from the? >applications view because it is not a transaction mechanism). >[details end] > >I am very open to learn about other scenarios where your proposed? >design pattern applied to the port resource is beneficial to the? >application implementor. > >Best regards, >Joachim > >On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > >> Dmitry suggests that we acquire an implementation of >> a serial port reference, use it, then release it (i.e., check it? >> back in). >> > > Joachim says that making serial ports thread friendly might be a? >> good idea. >> >> This is a good idea. The design pattern that is close to this idea >> is the "Object Pool Design Pattern". >> # Object Pool > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Mon May 15 06:58:19 2006 From: joachim at buechse.de (Joachim Buechse) Date: Mon, 15 May 2006 14:58:19 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Doug, I agree fully, that locking of the system resource should be abstracted from the user (programmer). Currently this is already the case, but I agree it might be nice to extract the code into a separate class, which uses platform dependent providers to do its job. What I described in my email was not targeted at allocating the system resource, but at handling an already allocated system resource inside the framework. I agree that it may be possible to combine the two - however, I would suggest to do this in phase2. I can contribute a work over of RXTXPort.java which implements clean internal locking and proper close behavior (which I would call phase 1). I could do this this week. However I strongly believe that there is little sense in trying to do this as a series of patches. It will be closer to a rewrite than to a patch. I have already provided a number of suggested patches via Bugzilla, but this is quite inconvenient (for me). My working copy diverges more and more from the master and hence it gets more and more annoying to provide self contained patches. Best regards, Joachim From tjarvi at qbang.org Mon May 15 08:27:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 May 2006 08:27:51 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Mon, 15 May 2006, Joachim Buechse wrote: > Hello Doug, > > I agree fully, that locking of the system resource should be > abstracted from the user (programmer). Currently this is already the > case, but I agree it might be nice to extract the code into a > separate class, which uses platform dependent providers to do its job. > > What I described in my email was not targeted at allocating the > system resource, but at handling an already allocated system resource > inside the framework. I agree that it may be possible to combine the > two - however, I would suggest to do this in phase2. > > I can contribute a work over of RXTXPort.java which implements clean > internal locking and proper close behavior (which I would call phase > 1). I could do this this week. > > However I strongly believe that there is little sense in trying to do > this as a series of patches. It will be closer to a rewrite than to a > patch. I have already provided a number of suggested patches via > Bugzilla, but this is quite inconvenient (for me). My working copy > diverges more and more from the master and hence it gets more and > more annoying to provide self contained patches. > For methodical testing purposes (which does go on) the incremental patches are better. I'm lagging behind in bugzilla but thats soon to change (this week). It has just been rather chaotic up until now. I moved, purchased a house, and jumped into the fire of a feature freeze timeframe at a new job. btw, we see the Solaris close issues on 2.8 also. 9 and 10 are fine. I'll work towards making those test results public and allow others to run new rxtx code through them. We had the OK at one point but setting up the environment is involved. It isn't just a collection of java classes. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Tue May 16 02:01:47 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:01:47 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] Message-ID: <446986EB.209@willicon.de> Hi, any ideas for my problem? Hans -------- Original-Nachricht -------- Betreff: [Rxtx] Problem under Mac OSX 10.3.9 Datum: Mon, 08 May 2006 18:47:20 +0200 Von: WILLICon Antwort an: RXTX Developers and Users An: RXTX Developers and Users Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/b0741c2b/attachment.html From joachim at buechse.de Tue May 16 02:15:08 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 10:15:08 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: Hello Hans, I am using RXTX on OS X for my own project. I do not see the problem you describe. I had some troubles installing it because the current version uses lock files which is non-standard on OS X. I have created a patched version which I currently use. This version does not need to modify user groups and hence does not need an installer. I just pop it in the application directory. If you send me a link where I can download your OSX installer, I will have a quick look. Regards, Joachim On 16.05.2006, at 10:01, WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we > have some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + > spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + > spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always > the value "false". > I can only get the status, while I open the port and catch the > exception. > > Any ideas? > > Hans > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail at willicon.de Tue May 16 02:26:53 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:26:53 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: References: <446986EB.209@willicon.de> Message-ID: <44698CCD.7050709@willicon.de> Joachim, tanks for the answer. I'll send You a mail. Hans Joachim Buechse schrieb: > Hello Hans, > > I am using RXTX on OS X for my own project. I do not see the problem > you describe. > > I had some troubles installing it because the current version uses > lock files which is non-standard on OS X. I have created a patched > version which I currently use. This version does not need to modify > user groups and hence does not need an installer. I just pop it in > the application directory. If you send me a link where I can download > your OSX installer, I will have a quick look. > > Regards, > Joachim > > On 16.05.2006, at 10:01, WILLICon wrote: > > >> Hi, >> >> any ideas for my problem? >> >> Hans >> >> -------- Original-Nachricht -------- >> Betreff: [Rxtx] Problem under Mac OSX 10.3.9 >> Datum: Mon, 08 May 2006 18:47:20 +0200 >> Von: WILLICon >> Antwort an: RXTX Developers and Users >> An: RXTX Developers and Users >> >> >> Hi, >> >> I use for RXTX for communicate with CyclingComputers. >> >> It works good under Win32, Sloaris and Linux but with Mac OSX we >> have some problems. >> >> My users install the Mac OSX serial lib from the actual binary. >> >> After starting the program, they get this error message: >> >> java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while >> loading gnu.io.RXTXCommDriver >> >> Remember, this error comes only under Mac OSX. >> >> That is the code for the error: >> >> Enumeration portList = CommPortIdentifier.getPortIdentifiers(); >> spInUse = getBundleStr("serialPortInUse"); >> spFree = getBundleStr("serialPortFree"); >> while (portList.hasMoreElements()) { >> CommPortIdentifier portId = (CommPortIdentifier) >> portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (osName != null && osName.startsWith("mac")) { >> if (!portId.getName().startsWith("dev/cu.")) { >> continue; >> } >> } >> if (portId.isCurrentlyOwned()) { >> serialPortNames.add(portId.getName() + " - " + >> spInUse); >> } >> else { >> serialPortNames.add(portId.getName() + " - " + >> spFree); >> } >> } >> } >> if (serialPortNames.size() == 0) { >> serialPortNames.add(getBundleStr("serialPortNotFound")); >> } >> >> BTW: The methode isCurrentlyOwned() is not working. I get always >> the value "false". >> I can only get the status, while I open the port and catch the >> exception. >> >> Any ideas? >> >> Hans >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/948333be/attachment.html From jredman at ergotech.com Tue May 16 07:35:52 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 16 May 2006 07:35:52 -0600 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: <4469D538.6070408@ergotech.com> Hans, I have no direct insight, but would note that what you have is a "NoClassDefFoundError" not a "ClassNotFoundException". So the class javax/comm/CommDriver is found, but one of its dependencies is missing. NoClassDefFoundError are a bigger problem to resolve because you get no indication of the real problem. Jim WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we have > some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > * spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always the > value "false". > I can only get the status, while I open the port and catch the exception. > > Any ideas? > > Hans > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.de Tue May 16 08:01:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 16:01:21 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 In-Reply-To: <4469AFC3.6000002@willicon.de> References: <44698EBC.8000008@willicon.de> <8C5680C4-E2BA-42FF-B221-36E1124FA6A4@buechse.de> <4469AFC3.6000002@willicon.de> Message-ID: <9825A602-D6ED-4C28-BF33-9A7C984FACD5@buechse.de> Hallo Hans, you include RXTX 2.17 in your "bikeXexperience.jar" (2.17 uses Interfaces from gnu.io.* not javax.comm.*). Now inspect your error log closely: The class gnu.io.RXTXCommDriver tries to load javax.comm.CommDriver: this is only the case for RXTX 2.07. I assume, that the user has installed Version 2.07 into one of the java.ext.dirs . The VM always tries to load classes from the "system" path first. The current Mac installer distributed with RXTX in fact installs RXTXcomm.jar and librxtxSerial.jnilib into /Library/Java/Extensions. (I wrote some time ago that I consider this as a bad idea because of potential version conflicts-> thanks for delivering the example). For 2.07 it does so without installing the javax.comm classes it seems. I would recommend that you instruct your users to install version 2.17 only. Until RXTX is changed to use TIOCEXCL instead of lock files, you can hardly avoid the installer, as the user needs to be added to a special group and a lockfile directory needs be created. More precisely you are waiting for: http://bugzilla.qbang.org/show_bug.cgi?id=50 [RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL)] Regards, Joachim -------------- next part -------------- A non-text attachment was scrubbed... Name: log.tiff Type: image/tiff Size: 38394 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/e3e52128/log.tiff -------------- next part -------------- > > Ich verwende RXTX 2.17. Das orginal RXTXcomm.jar ist in > CyclingDataManager.jar enthalten. > From tjarvi at qbang.org Wed May 17 23:18:15 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 May 2006 23:18:15 -0600 (MDT) Subject: [Rxtx] update Message-ID: So we have several patches and these have stacked up. I'd like to thank everyone for being patient. Tests for the most intrusive patches look good so far. I still have to get some bits together on my end but it looks like we can catch everything up in CVS this week. I'll try to post a normal list of what went in by whom with links Saturday. But I'm not seeing anything that raises flags yet. I also think I'll be able to submit a patch for nonstandard baud rates. I have to confirm w32 but I think its going to be a one line fix. I don't know if its bugzilla or people tinkering with patch files before submitting but patches are not applying cleanly. So the patches have to be done by hand. This may make things difficult for people hoping to add other patches on top. I'm trying to make that go well but ... -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Thu May 18 02:23:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 May 2006 10:23:47 +0200 Subject: [Rxtx] update In-Reply-To: References: Message-ID: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Hello Trent, in fact I tinkered with the patches (never used this mechanism before, usually I "communicate" via cvs) ... so sorry for any trouble you had applying them. Basicly I edited the patches to make them self contained. Having the tests run with different speeds on different platforms, may well be an effect of caching. I have seen quite interesting propagation delays for the closing flag on my PowerPC system, which makes me doubt, that the propagation of output_buffer_empty_flag works as it should. Maybe the communication mechanism between the two threads should be replaced by something like pthread_cond_*. Could you describe which problems you see on Solaris/SPARC? I'd be interested to see if they exist on OS X (PowerPC) as well... As you seem to work on the stuff at the moment I would like to suggest the following additions (it looks more than it is, I posted some context to make clear where to apply the change). See the comments in braces for what was changed Greetings, Joachim (1) The end of the drain loop could be: --- report("drain_loop: received EINTR in tcdrain\n"); --- (added "in tcdrain" to make debug output clearer) (2) The start of the drain loop should be: --- for(i=0;;i++) { report_verbose("drain_loop: looping\n"); #if defined(__sun__) /* FIXME: No time to test on all OS's for production */ if( eis->eventloop_interrupted ) { goto end; } if (usleep(5000)) { report("drain_loop: received EINTR"); } #else if (usleep(1000000)) { report("drain_loop: received EINTR"); } #endif /* __sun__ */ --- (added a check for "eis->eventloop_interrupted" before the sleep) (3) The end of interrupt_event_loop could (and maybe should) be: --- #if !defined(TIOCSERGETLSR) && !defined(WIN32) /* make sure that the drainloop unblocks from tcdrain */ pthread_kill(index->drain_tid, SIGABRT); /* TODO use wait/join/SIGCHLD/?? instead of sleep? */ usleep(50 * 1000); /* Under normal conditions, SIGABRT will unblock tcdrain. However a non-responding USB device combined with an unclean driver may still block. This is very ugly because it may block the call to close indefinetly. */ if (index->closing != 1) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); index->closing = 1; } #endif report("interruptEventLoop: interrupted\n"); --- (added some comments and pthread_cancel for resisting drain thread) On 18.05.2006, at 07:18, Trent Jarvi wrote: > > So we have several patches and these have stacked up. I'd like to > thank > everyone for being patient. > > Tests for the most intrusive patches look good so far. I still > have to > get some bits together on my end but it looks like we can catch > everything > up in CVS this week. > > I'll try to post a normal list of what went in by whom with links > Saturday. But I'm not seeing anything that raises flags yet. I also > think I'll be able to submit a patch for nonstandard baud rates. > I have > to confirm w32 but I think its going to be a one line fix. > > I don't know if its bugzilla or people tinkering with patch files > before > submitting but patches are not applying cleanly. So the patches > have to > be done by hand. This may make things difficult for people hoping > to add > other patches on top. I'm trying to make that go well but ... > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu May 18 22:28:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 18 May 2006 22:28:00 -0600 (MDT) Subject: [Rxtx] update In-Reply-To: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> References: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Message-ID: On Thu, 18 May 2006, Joachim Buechse wrote: > Hello Trent, > > in fact I tinkered with the patches (never used this mechanism > before, usually I "communicate" via cvs) ... so sorry for any trouble > you had applying them. Basicly I edited the patches to make them self > contained. I think we are close to moving towards that. > > Having the tests run with different speeds on different platforms, > may well be an effect of caching. I have seen quite interesting > propagation delays for the closing flag on my PowerPC system, which > makes me doubt, that the propagation of output_buffer_empty_flag > works as it should. Maybe the communication mechanism between the two > threads should be replaced by something like pthread_cond_*. Could > you describe which problems you see on Solaris/SPARC? I'd be > interested to see if they exist on OS X (PowerPC) as well... This is interesting. I have seen problems with output buffer empty in applications that require it. I'm trying to get a bug list and or test results open for everyone to see but that may take time. But missed output buffer events ... yep. With Sparc, we have seen a few things. One was a kernel race condition that went away when we reimaged and updated 2.8. RXTX was hanging on close, top showed no cpu use but there was 2 second delays just typing on console. The other is our tests now take ~4 times longer on Solaris. Someone is looking at timing just open, close, read, write, ... to see if they can find where the slowdown is. This happened after solaris 2.8. I'll try to share more when/if there is something interesting. This may well not be solvable in userland. > > As you seem to work on the stuff at the moment I would like to > suggest the following additions (it looks more than it is, I posted > some context to make clear where to apply the change). See the > comments in braces for what was changed I'll take a look. This could all come together Saturday but I also have an event to attend that day. I may not wrap this up until Sunday. -- Trent Jarvi tjarvi at qbang.org From andrewlord at internode.on.net Sun May 21 20:10:02 2006 From: andrewlord at internode.on.net (Andrew Lord) Date: Mon, 22 May 2006 11:40:02 +0930 Subject: [Rxtx] Kernel include files do not match kernel Message-ID: <200605221140.03271.andrewlord@internode.on.net> Hi, I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel 2.6.12-18 with the command: ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include However I get the message: ## checking java.version 1.5.0_06 ## checking os.version 2.6.12-18mdk ## ## WARNING: Kernel include files do not match the current kernel ## ## configure: creating ./config.status etc. Is there a problem with the way I'm specifying the 'include' directory ? If not, how else can I specify the correct directory for the include files please ? Cheers, Andrew From tjarvi at qbang.org Sun May 21 20:31:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 May 2006 20:31:31 -0600 (MDT) Subject: [Rxtx] Kernel include files do not match kernel In-Reply-To: <200605221140.03271.andrewlord@internode.on.net> References: <200605221140.03271.andrewlord@internode.on.net> Message-ID: On Mon, 22 May 2006, Andrew Lord wrote: > Hi, > > I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel > 2.6.12-18 with the command: > > ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk > CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include > > However I get the message: > > ## checking java.version 1.5.0_06 > ## checking os.version 2.6.12-18mdk > ## > ## WARNING: Kernel include files do not match the current kernel > ## > ## configure: creating ./config.status > etc. > > Is there a problem with the way I'm specifying the 'include' directory ? If > not, how else can I specify the correct directory for the include files > please ? > Hi Andrew I'm fairly sure your --with-kernel option does nothing. The CPPFLAGS should do what you want. Maybe put an #error message in /usr/src/linux.../incude/linux/version.h But I don't recall a recent problem with version missmatches. It should work. Distros will even ship include files that don't match versions exactly. In theory it should never matter for users. I used to compile new kernels by hand and really didnt have a distro. I didnt have a seperate package of kernel headers for users (myself). When changing a gateway from linux 1.2.12 to 2.1.77, I would worry about such messages. So if you are doing something that weird, the message may be of use to you. If you just see the message on a distro you installed, it is more than likely harmless. -- Trent Jarvi tjarvi at qbang.org From mrogers at spro.net Mon May 22 14:45:39 2006 From: mrogers at spro.net (Mike Rogers) Date: Mon, 22 May 2006 14:45:39 -0600 Subject: [Rxtx] Sun's CommAPI -- think May? Message-ID: <447222F3.9040302@spro.net> Hi, Any word from Sun about progress towards fixing the Java CommAPI v3 "incompatibilities" so RXTX 2.0 can operate within the framework's namespace (javax.comm)? I recall mention of a May time frame. Thanks, Mike From paul.klissner at sun.com Mon May 22 15:09:27 2006 From: paul.klissner at sun.com (Paul Klissner) Date: Mon, 22 May 2006 14:09:27 -0700 Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <447222F3.9040302@spro.net> References: <447222F3.9040302@spro.net> Message-ID: <44722887.8080308@sun.com> Mike Rogers wrote: > Hi, > > Any word from Sun about progress towards fixing the Java CommAPI v3 > "incompatibilities" so RXTX 2.0 can operate within the framework's > namespace (javax.comm)? I recall mention of a May time frame. > > Thanks, > > Mike > We've had a lot of work come in. This hasn't been the only priority. I'm running behind the plan in addressing this, but will be looking at it again soon. Rather than state a new, I'll just say it is in progress, and not off the table. I'll get this fixed as soon as I can. Good timing for asking as we just started discussing javax.comm plans today, and I'll have some cycles to work on it soon. Paul From yhua537 at cse.unsw.edu.au Mon May 22 16:03:05 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Tue, 23 May 2006 08:03:05 +1000 (EST) Subject: [Rxtx] install rxtx in XP Message-ID: Hi Guys, I am new to serial port programming, and have no experience on programming java in xp, but my project require me to builld a communication link between xp and a UART device. Most of the information in the web site seems for linux only. including the commands such as export and chmod. How do I install rxtx in xp? cheers YiQi Huang From mark at mdsh.com Tue May 23 01:24:20 2006 From: mark at mdsh.com (Mark Himsley) Date: Tue, 23 May 2006 08:24:20 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off , it includes DLLs for Windows and the JAR for Java. Follow the Windows instructions in the INSTALL. ie RXTXcomm.jar goes in \jre\lib\ext (under java) rxtxSerial.dll goes in \jre\bin So, assuming a fairly standard Java install, copy RXTXcomm.jar into C:\Program Files\Java\jre1.5.0_06\lib\ext and copy rxtxSerial.dll into C:\Program Files\Java\jre1.5.0_06\bin Yes, it really is that simple. On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > I am new to serial port programming, and have no experience on > programming java in xp, but my project require me to builld a > communication link between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang -- Mark Himsley From joachim at buechse.de Tue May 23 02:51:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 23 May 2006 10:51:47 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) Unless it is absolutely required you should NOT install RXTX in your global Java Runtime Environment. This will for sure create versioning conflicts - if not now, than in the future, if not on your system than at your clients. Instead put the dll in your application directory and include the RXTXcomm.jar in your classpath. This is much safer and not a bit more complicated. Regards, Joachim On 23.05.2006, at 09:24, Mark Himsley wrote: > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR > for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > >> I am new to serial port programming, and have no experience on >> programming java in xp, but my project require me to builld a >> communication link between xp and a UART device. >> >> Most of the information in the web site seems for linux only. >> including >> the commands such as export and chmod. How do I install rxtx in xp? >> >> cheers >> YiQi Huang > > > > -- > Mark Himsley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tod at todbot.com Tue May 23 03:12:22 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 02:12:22 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I totally agree: do not contaminate the Java installation. I put all the RXTX files in a directory and then change my java invocation to be: % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* Alternatively, use Launch4J to create a double-clickable application and keep the RXTX libraries in the directory of the application. -=tod On May 23, 2006, at 1:51 AM, Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > >> Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off >> , it includes DLLs for Windows and the JAR >> for Java. >> >> Follow the Windows instructions in the INSTALL. >> >> ie >> >> RXTXcomm.jar goes in \jre\lib\ext (under java) >> rxtxSerial.dll goes in \jre\bin >> >> So, assuming a fairly standard Java install, copy RXTXcomm.jar into >> C:\Program Files\Java\jre1.5.0_06\lib\ext >> and copy rxtxSerial.dll into >> C:\Program Files\Java\jre1.5.0_06\bin >> >> Yes, it really is that simple. >> >> >> >> On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: >> >>> I am new to serial port programming, and have no experience on >>> programming java in xp, but my project require me to builld a >>> communication link between xp and a UART device. >>> >>> Most of the information in the web site seems for linux only. >>> including >>> the commands such as export and chmod. How do I install rxtx in xp? >>> >>> cheers >>> YiQi Huang >> >> >> >> -- >> Mark Himsley >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From smontgomery at mediaspansoftware.com Tue May 23 08:46:53 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Tue, 23 May 2006 10:46:53 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: Message-ID: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Joachim and Tod mentioned how to keep the files RXTX requires on Windows XP out of the Java installations - thanks gentlemen! Are there similar suggestions for an RXTX install on OS X? The current "canonical" OS X installation instructions "contaminate the Java installation", to use Tod's words. Our app will run fine under 1.4.2 and 5.0 on OS X, and a lot of users will have both. We've already been burned by the recent switch from 1.4.2 to 5.0 as the platform default. Any suggestions welcomed. From tod at todbot.com Tue May 23 13:27:55 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 12:27:55 -0700 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <9BA0F670-A862-42E7-BB2C-130D775ABDF9@todbot.com> Hi Sean, It depends on how you build and deploy your code. If you're using shell scripts, you can do something like this: #!/bin/sh # pick one JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/ Commands/java #JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/ Commands/java $JAVA -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* That both picks which VM to use and uses the RXTX in the directory called 'rxtxlib'. If you want your shell script to be clever, you could test for the existence of the different 'java' executables and go from there (maybe even use different jar files). I am almost positive all OS X systems with Java 1.5 are guaranteed to also have Java 1.4.2. If you're using Jar Builder or XCode, you can specify which JVM to use and add the extra args in the Info.plist file. The paths specified in the 'java' invocation then are based off of the $JAVAROOT variable that the JavaApplicationStub sets for you. For my app, I've have been compiling two sets of jars, one compiled with 1.4.2 and one with 1.5, but they both run under 1.5. So I have a similar shell script that chooses a different 'javac' depending on the need. -=tod On May 23, 2006, at 7:46 AM, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From yhua537 at cse.unsw.edu.au Tue May 23 11:09:37 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 03:09:37 +1000 (EST) Subject: [Rxtx] install rxtx in XP (Mark Himsley, Joachim Buechse, Tod E. Kurt> In-Reply-To: References: Message-ID: > Message: 8 > Date: Tue, 23 May 2006 08:03:05 +1000 (EST) > From: YiQi Huang > Subject: [Rxtx] install rxtx in XP > To: rxtx at qbang.org > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > Hi Guys, > > I am new to serial port programming, and have no experience on programming > java in xp, but my project require me to builld a communication link > between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang > > > ------------------------------ > > Message: 9 > Date: Tue, 23 May 2006 08:24:20 +0100 > From: Mark Himsley > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=us-ascii; format=flowed > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > ------------------------------ > > Message: 10 > Date: Tue, 23 May 2006 10:51:47 +0200 > From: Joachim Buechse > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > > ------------------------------ > > Message: 11 > Date: Tue, 23 May 2006 02:12:22 -0700 > From: "Tod E. Kurt" > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I totally agree: do not contaminate the Java installation. > > I put all the RXTX files in a directory and then change my java > invocation to be: > > % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* > > Alternatively, use Launch4J to create a double-clickable application > and keep the RXTX libraries in the directory of the application. > > -=tod > > Hi, Thanks guys, I don't know if this is the correct way to reply your mecessage, if wrong, please point out. Thank you for Mark to give the detail instructions and Joachim to point out the cons ot installing in the java directory, and specially thanks for Tod to give the instrection in detail. Sorry to ask another stupid question: I have followed Tod's instruction. Now I think i am ready to start hacking. But where is the RXTX API documentation? Is it the same as using normal java comm API? btw, where could i find some examples to start with? Thanks very much cheers YiQi Huang From tjarvi at qbang.org Tue May 23 16:09:32 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 May 2006 16:09:32 -0600 (MDT) Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <44722887.8080308@sun.com> References: <447222F3.9040302@spro.net> <44722887.8080308@sun.com> Message-ID: > Good timing for asking as we just started discussing javax.comm plans > today, and I'll have some cycles to work on it soon. Hi Paul I assume you mean Sun is discussing plans concerning its own internal actions and there is no community involvment at this point. -- Trent Jarvi tjarvi at qbang.org From yhua537 at cse.unsw.edu.au Tue May 23 22:50:01 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 14:50:01 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } From mmester at sps.edu Tue May 23 22:58:21 2006 From: mmester at sps.edu (Michael Mester) Date: Wed, 24 May 2006 00:58:21 -0400 Subject: [Rxtx] install rxtx in XP References: Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below -----Original Message----- From: rxtx-bounces at qbang.org on behalf of YiQi Huang Sent: Wed 5/24/2006 12:50 AM To: RXTX Developers and Users Subject: Re: [Rxtx] install rxtx in XP Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3950 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060523/b36d0c63/attachment.bin From yhua537 at cse.unsw.edu.au Tue May 23 23:05:50 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 15:05:50 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: Yes, Michael you are right, it should be semicolons, But it still can't find the correct library. On Wed, 24 May 2006, Michael Mester wrote: > I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below > > > -----Original Message----- > From: rxtx-bounces at qbang.org on behalf of YiQi Huang > Sent: Wed 5/24/2006 12:50 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] install rxtx in XP > > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > cheers YiQi Huang From tod at todbot.com Wed May 24 00:01:57 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 23:01:57 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Yes, sorry, classpath entries are semicolon-separated on Windows and colon-separated on everything else. Your example code below is importing the wrong set of classes. It should not "import javax.comm.*", instead it should "import gnu.io.*". When I make that change, your example program compiles. The "javax.comm" package is the one released by Sun, the "gnu.io" package is the RXTX one. You might've seen some discussion that the two will be merged or become compatible, but that hasn't happened yet. -=tod On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > > Yes, Michael you are right, it should be semicolons, But it still > can't > find the correct library. > > On Wed, 24 May 2006, Michael Mester wrote: > >> I believe the entries in the classpath need to be seperated with >> semicolons, not a colon as you have in your command below >> >> >> -----Original Message----- >> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >> Sent: Wed 5/24/2006 12:50 AM >> To: RXTX Developers and Users >> Subject: Re: [Rxtx] install rxtx in XP >> >> Hi, >> >> Sorry guys.I follow Tod's instruction, and here is what i did: >> >> put >> RXTXcomm.jar, >> rxtxParallel.dll, >> rxtxSerial.dll >> in >> C:\RXTX_files >> >> and I got a SimpleRead class attached below, compile it with : >> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >> it still saying "cannot find symbol". >> >> Is there anything I did wrong? Do I need the comm.jar from Sun? >> >> Thanks & regards >> YiQi Huang >> >> >> //////////////////////////////////////////////////////// >> // SimpleRead.java >> //////////////////////////////////////////////////////// >> >> import java.io.*; >> import java.util.*; >> import javax.comm.*; >> >> public class SimpleRead >> implements Runnable, SerialPortEventListener { >> static CommPortIdentifier portId; >> static Enumeration portList; >> InputStream inputStream; >> SerialPort serialPort; >> Thread readThread; >> public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == >> CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals("COM1")) { >> //if (portId.getName().equals("/dev/term/a")) { >> SimpleRead reader = new SimpleRead(); >> } >> } >> } >> } >> public SimpleRead() { >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", >> 2000); >> } catch (PortInUseException e) {} >> try { >> inputStream = serialPort.getInputStream(); >> } catch (IOException e) {} >> try { >> serialPort.addEventListener(this); >> } catch (TooManyListenersException e) {} >> serialPort.notifyOnDataAvailable(true); >> try { >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } catch (UnsupportedCommOperationException e) {} >> readThread = new Thread(this); >> readThread.start(); >> } >> public void run() { >> try { >> Thread.sleep(20000); >> } catch (InterruptedException e) {} >> } >> public void serialEvent(SerialPortEvent event) { >> switch(event.getEventType()) { >> case SerialPortEvent.BI: >> case SerialPortEvent.OE: >> case SerialPortEvent.FE: >> case SerialPortEvent.PE: >> case SerialPortEvent.CD: >> case SerialPortEvent.CTS: >> case SerialPortEvent.DSR: >> case SerialPortEvent.RI: >> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >> break; >> case SerialPortEvent.DATA_AVAILABLE: >> byte[] readBuffer = new byte[20]; >> try { >> while (inputStream.available() > 0) { >> int numBytes = inputStream.read(readBuffer); >> } >> System.out.print(new String(readBuffer)); >> } catch (IOException e) {} >> break; >> } >> } >> } >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > cheers > YiQi Huang > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From joachim at buechse.de Wed May 24 00:10:06 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:10:06 +0200 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Hi Sean, my preferred way of dealing with RXTX on OS X is to include the RXTX classes into my application jar and to put the RXTX lib in the same directory as this jar. To make it even more comfortable, you can include the lib in the jar and have some startup code extract it and write it to a temporary file from which you load it with System.load(). Unfortunately the current version of RXTX for OS X requires tinkering with user groups as it is based on lockfiles - and hence it needs the RXTX OS X installer or you need to duplicated this functionality in your own installer. I have created my own native version which is not based on lockfiles but tty locking (the standard way to do it on OSX). I hope that these patches will be integrated soon into the distribution. Regards, Joachim On 23.05.2006, at 16:46, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Wed May 24 00:16:12 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:16:12 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <7017ECFC-B13E-4806-B321-9FFCAC5830F0@buechse.de> I assume you downloaded rxtx-217 (not 207). Instead of importing javax.comm.* you must import gnu.io.* The classes have the same name, but they are not in the same package. On 24.05.2006, at 06:50, YiQi Huang wrote: > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From yhua537 at cse.unsw.edu.au Wed May 24 00:17:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 16:17:45 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Message-ID: Thanks Tod again, i kept reading "gnu.io.*" as "gun.io.*" last few hours after i read some commons from web. Thanks very much Tod. thanks YiQi Huang On Tue, 23 May 2006, Tod E. Kurt wrote: > Yes, sorry, classpath entries are semicolon-separated on Windows and > colon-separated on everything else. > > Your example code below is importing the wrong set of classes. It > should not "import javax.comm.*", instead it should "import > gnu.io.*". When I make that change, your example program compiles. > The "javax.comm" package is the one released by Sun, the "gnu.io" > package is the RXTX one. You might've seen some discussion that the > two will be merged or become compatible, but that hasn't happened yet. > > -=tod > > > On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > >> >> Yes, Michael you are right, it should be semicolons, But it still >> can't >> find the correct library. >> >> On Wed, 24 May 2006, Michael Mester wrote: >> >>> I believe the entries in the classpath need to be seperated with >>> semicolons, not a colon as you have in your command below >>> >>> >>> -----Original Message----- >>> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >>> Sent: Wed 5/24/2006 12:50 AM >>> To: RXTX Developers and Users >>> Subject: Re: [Rxtx] install rxtx in XP >>> >>> Hi, >>> >>> Sorry guys.I follow Tod's instruction, and here is what i did: >>> >>> put >>> RXTXcomm.jar, >>> rxtxParallel.dll, >>> rxtxSerial.dll >>> in >>> C:\RXTX_files >>> >>> and I got a SimpleRead class attached below, compile it with : >>> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >>> it still saying "cannot find symbol". >>> >>> Is there anything I did wrong? Do I need the comm.jar from Sun? >>> >>> Thanks & regards >>> YiQi Huang >>> >>> >>> //////////////////////////////////////////////////////// >>> // SimpleRead.java >>> //////////////////////////////////////////////////////// >>> >>> import java.io.*; >>> import java.util.*; >>> import javax.comm.*; >>> >>> public class SimpleRead >>> implements Runnable, SerialPortEventListener { >>> static CommPortIdentifier portId; >>> static Enumeration portList; >>> InputStream inputStream; >>> SerialPort serialPort; >>> Thread readThread; >>> public static void main(String[] args) { >>> portList = CommPortIdentifier.getPortIdentifiers(); >>> while (portList.hasMoreElements()) { >>> portId = (CommPortIdentifier) portList.nextElement(); >>> if (portId.getPortType() == >>> CommPortIdentifier.PORT_SERIAL) { >>> if (portId.getName().equals("COM1")) { >>> //if (portId.getName().equals("/dev/term/a")) { >>> SimpleRead reader = new SimpleRead(); >>> } >>> } >>> } >>> } >>> public SimpleRead() { >>> try { >>> serialPort = (SerialPort) portId.open("SimpleReadApp", >>> 2000); >>> } catch (PortInUseException e) {} >>> try { >>> inputStream = serialPort.getInputStream(); >>> } catch (IOException e) {} >>> try { >>> serialPort.addEventListener(this); >>> } catch (TooManyListenersException e) {} >>> serialPort.notifyOnDataAvailable(true); >>> try { >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, >>> SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> } catch (UnsupportedCommOperationException e) {} >>> readThread = new Thread(this); >>> readThread.start(); >>> } >>> public void run() { >>> try { >>> Thread.sleep(20000); >>> } catch (InterruptedException e) {} >>> } >>> public void serialEvent(SerialPortEvent event) { >>> switch(event.getEventType()) { >>> case SerialPortEvent.BI: >>> case SerialPortEvent.OE: >>> case SerialPortEvent.FE: >>> case SerialPortEvent.PE: >>> case SerialPortEvent.CD: >>> case SerialPortEvent.CTS: >>> case SerialPortEvent.DSR: >>> case SerialPortEvent.RI: >>> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >>> break; >>> case SerialPortEvent.DATA_AVAILABLE: >>> byte[] readBuffer = new byte[20]; >>> try { >>> while (inputStream.available() > 0) { >>> int numBytes = inputStream.read(readBuffer); >>> } >>> System.out.print(new String(readBuffer)); >>> } catch (IOException e) {} >>> break; >>> } >>> } >>> } >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> >> cheers >> YiQi Huang >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From smontgomery at mediaspansoftware.com Wed May 24 10:24:13 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 12:24:13 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: Tod & Joachim, Thanks for the info, that's very helpful. I'll give that a whirl when I move to rxtx 2.1. I'm still using the older 2.0.7 version for now (don't ask), which probably requires the Sun comm.jar, javax.comm.properties and librxtxSerial.jnilib to be in very specific places in each jvm's file hierarchy. From tjarvi at qbang.org Wed May 24 11:59:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 11:59:16 -0600 (MDT) Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: On Wed, 24 May 2006, Sean Montgomery wrote: > Tod & Joachim, > > Thanks for the info, that's very helpful. I'll give that a whirl > when I move to rxtx 2.1. I'm still using the older 2.0.7 version for > now (don't ask), which probably requires the Sun comm.jar, > javax.comm.properties and librxtxSerial.jnilib to be in very specific > places in each jvm's file hierarchy. > You will need comm.jar from Sun then. It must be Sun's version 2.* or older for Linux or Solaris. I assume they have this in download archives. The default offering from Sun is version 3.0. This version currently does not support rxtx. The older version will probably be fine for your needs. -- Trent Jarvi tjarvi at qbang.org From smontgomery at mediaspansoftware.com Wed May 24 12:19:06 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 14:19:06 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: <3939EFB8-11E1-4E3E-A684-5B3C525577CD@mediaspansoftware.com> Yup, that's right, thanks Trent. I've been using these files for quite a while now. Thanks for bringing it up. I almost didn't mention using 2.0.7 because I didn't want to give any new members of the list the wrong idea! :-) On May 24, 2006, at 1:59 PM, Trent Jarvi wrote: > On Wed, 24 May 2006, Sean Montgomery wrote: > >> Tod & Joachim, >> >> Thanks for the info, that's very helpful. I'll give that a whirl >> when I move to rxtx 2.1. I'm still using the older 2.0.7 version for >> now (don't ask), which probably requires the Sun comm.jar, >> javax.comm.properties and librxtxSerial.jnilib to be in very specific >> places in each jvm's file hierarchy. >> > > You will need comm.jar from Sun then. It must be Sun's version 2.* or > older for Linux or Solaris. I assume they have this in download > archives. > > The default offering from Sun is version 3.0. This version > currently does > not support rxtx. > > The older version will probably be fine for your needs. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mark at mdsh.com Wed May 24 15:55:46 2006 From: mark at mdsh.com (Mark Himsley) Date: Wed, 24 May 2006 22:55:46 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <37B0FC4B1F3237321F093ABE@MacMini.local> On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) That's no problem. BUT, do note that the instructions I elaborated on are in the INSTALL file within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone please update the INSTALL file? > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > > , it includes DLLs for Windows and the JAR > > for Java. > > > > Follow the Windows instructions in the INSTALL. > > > > ie > > > > RXTXcomm.jar goes in \jre\lib\ext (under java) > > rxtxSerial.dll goes in \jre\bin > > > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > > C:\Program Files\Java\jre1.5.0_06\lib\ext > > and copy rxtxSerial.dll into > > C:\Program Files\Java\jre1.5.0_06\bin > > > > Yes, it really is that simple. > > > > > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > > > >> I am new to serial port programming, and have no experience on > >> programming java in xp, but my project require me to builld a > >> communication link between xp and a UART device. > >> > >> Most of the information in the web site seems for linux only. > >> including > >> the commands such as export and chmod. How do I install rxtx in xp? > >> > >> cheers > >> YiQi Huang > > > > > > > > -- > > Mark Himsley > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Mark Himsley From tjarvi at qbang.org Wed May 24 16:41:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 16:41:46 -0600 (MDT) Subject: [Rxtx] install rxtx in XP In-Reply-To: <37B0FC4B1F3237321F093ABE@MacMini.local> References: <37B0FC4B1F3237321F093ABE@MacMini.local> Message-ID: On Wed, 24 May 2006, Mark Himsley wrote: > > > On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > >> I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > That's no problem. > > BUT, do note that the instructions I elaborated on are in the INSTALL file > within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone > please update the INSTALL file? > > The INSTALL file may be updated by anyone at anytime. http://rxtx.qbang.org/wiki/index.php/Installation We are moving it to the wiki so end users may put the type of answers they would like to see in. Sometimes it's best if developers don't give what appears to be cryptic answers. You can even put in that jre/lib/ext is not the right place but you don't understand the classpath solution mentioned on the mail-list and then we know what to add. -- Trent Jarvi tjarvi at qbang.org From stramit at gmail.com Wed May 24 21:45:31 2006 From: stramit at gmail.com (Tim Cooper) Date: Thu, 25 May 2006 13:45:31 +1000 Subject: [Rxtx] Accessing Virtual Com Port Message-ID: Hi, I have to develop an application that talks to a virtual com port (in this case com3) which translates any messages sent across a USB cable to a micro. Using C++ I can talk to this com port and I know that it is configured, present, and working. For the application that I am trying to write I want to use RXTX for the communication. My problem is that the configured virtual port (in windows) is not showing up when I do an enumeration over the available ports. The output I get is (com 3 is not present) : Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 PORT FOUND: COM1 PORT FOUND: LPT1 Is there anything that I need to do to make com3 available to RXTX and my application? Timothy Cooper -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060524/c5591648/attachment.html From antonio.luis at iscte.pt Thu May 25 01:39:13 2006 From: antonio.luis at iscte.pt (=?ISO-8859-1?Q?Ant=F3nio_Lopes?=) Date: Thu, 25 May 2006 08:39:13 +0100 Subject: [Rxtx] RXTX on Pocket PC Message-ID: <44755F21.8060103@iscte.pt> Hello everyone, I've been using RXTX to communicate with serial ports in Windows and it's been quite successful. However, I'm now considering porting my application from Windows to Pocket PC but I can't seem to find the RXTX binaries (*.jar and *.dll) to use in Pocket PC. I've been "digging" on the mailing list's archives and also on the web and I can't find these anywhere. Can anyone in this mailing list give me some pointers on this? Where can I find the necessary files and basic installation instructions? Thanks very much for your help. I very much appreciate any help that you can provide me. Regards, -- Ant?nio Lopes @contact: antonio.luis at iscte.pt @work: ADETTI - ISCTE @web: http://antonio.lopes.googlepages.com/home From doug at dupreeinc.com Fri May 26 15:45:50 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Fri, 26 May 2006 14:45:50 -0700 Subject: [Rxtx] rxtx slow startup Message-ID: <4477770E.9010400@dupreeinc.com> Hello, I hope there are people still reading this mailing list. The archive appeared to not have anything new after 4/2005. I was using the commapi from sun for a project where a java application reads data from test equipment connected to the serial port. I had to upgrade the ftdi vcp driver on my pc and the old sun commapi no longer works with hardware flow control. as an experiment I replaced the javax.com with gnu.io in the SerialDemo.java project that was included with the commapi. This compiled fine using JBuilder 2006 and JRE 1.5.0_05. RXTX also works with the latest ftdi drivers so life is wonderful again... almost... When using the commapi jar the SerialDemo program starts in about 1 second on my system. Using the RXTX jar it takes over 56 seconds to start. Has anyone else seen this problem? Is there a workaround to get the startup performance close to the old commapi? The last thing printed to the console before this delay is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks for your time! Doug From yhua537 at cse.unsw.edu.au Sat May 27 05:46:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 21:46:45 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <4477770E.9010400@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> Message-ID: hi Doug The archive hasn't been update for a long time, But people certainly still reading the list. I don't have enough experience to help on your problem, but without any detail about what your problem doing during that 56 seconds, it is hard to target the your question, I think. cheers YiQi On Fri, 26 May 2006, Doug Thistlethwaite wrote: > Hello, > > I hope there are people still reading this mailing list. The archive > appeared to not have anything new after 4/2005. > > I was using the commapi from sun for a project where a java application > reads data from test equipment connected to the serial port. I had to > upgrade the ftdi vcp driver on my pc and the old sun commapi no longer > works with hardware flow control. as an experiment I replaced the > javax.com with gnu.io in the SerialDemo.java project that was included > with the commapi. This compiled fine using JBuilder 2006 and JRE > 1.5.0_05. RXTX also works with the latest ftdi drivers so life is > wonderful again... almost... > > When using the commapi jar the SerialDemo program starts in about 1 > second on my system. Using the RXTX jar it takes over 56 seconds to > start. Has anyone else seen this problem? Is there a workaround to get > the startup performance close to the old commapi? > > The last thing printed to the console before this delay is: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Thanks for your time! > > Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------- Just a student, Still a student ------------------------------- From yhua537 at cse.unsw.edu.au Sat May 27 06:04:26 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 22:04:26 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: Sorry, I don't think you could understand what I mean .I mean this: Without any detail about what your program is doing during that 56 seconds, it is hard for anyone to target the problem. On Sat, 27 May 2006, YiQi Huang wrote: > hi Doug > > The archive hasn't been update for a long time, But people certainly still > reading the list. > > I don't have enough experience to help on your problem, but without any > detail about what your problem doing during that 56 seconds, it is hard to > target the your question, I think. > > cheers > YiQi > > On Fri, 26 May 2006, Doug Thistlethwaite wrote: > >> Hello, >> >> I hope there are people still reading this mailing list. The archive >> appeared to not have anything new after 4/2005. >> >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From jredman at ergotech.com Sat May 27 08:32:02 2006 From: jredman at ergotech.com (Jim Redman) Date: Sat, 27 May 2006 08:32:02 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: <447862E2.4080506@ergotech.com> Doug, Since you mentioned it, we have a system that is also seems slow. From memory (I don't have one of the slow systems around), I'm not sure that it's consistent, it seems that sometimes it may take longer than others. Since it's part of the bootup it hasn't raised a flag and I haven't researched it. The same code runs much faster on other systems, so now you've got me wondering what's different. The slow system boots DSL (http://www.damnsmalllinux.org/) from a compact flash. FC4 is on my desktop where I haven't noticed a slow down. I think that the rxtx code is the same in both cases with lock files disabled. The slow system has a bunch of serial ports defined, including 4 USB serial ports that do not exist - they are not plugged in. Any clues in there? Jim > On Fri, 26 May 2006, Doug Thistlethwaite wrote: >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Sat May 27 10:41:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 May 2006 10:41:54 -0600 (MDT) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447862E2.4080506@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: On Sat, 27 May 2006, Jim Redman wrote: > Doug, > > Since you mentioned it, we have a system that is also seems slow. From > memory (I don't have one of the slow systems around), I'm not sure that > it's consistent, it seems that sometimes it may take longer than others. > Since it's part of the bootup it hasn't raised a flag and I haven't > researched it. > > The same code runs much faster on other systems, so now you've got me > wondering what's different. > > The slow system boots DSL (http://www.damnsmalllinux.org/) from a > compact flash. FC4 is on my desktop where I haven't noticed a slow > down. I think that the rxtx code is the same in both cases with lock > files disabled. > > The slow system has a bunch of serial ports defined, including 4 USB > serial ports that do not exist - they are not plugged in. > > Any clues in there? > rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. When it does this, it will try to open each port and do a timed out read. most systems will not have entries in device if the port is not there. But some minimal systems will just put all the device files there in case hardware is added. The list of devices scanned used to be ~10-20 times longer than it is today. That was getting very slow. I suspect moving the device files not used to a backup directory would increase the enumeration. I'll look into why the mail-list archive is not updating. The last update was about when I thought I 'fixed' the cron jobs. I probably didn't actually fix it but rather moved the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon May 29 19:46:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 May 2006 19:46:47 -0600 (MDT) Subject: [Rxtx] Mail-List Archives are updating. Message-ID: It was pointed out earlier that the archive is dated. This was a missing crontab entry. The list is currently archived by the week on the web page. It is updated once a day. So every 7 days it starts a new link and updates it daily. I've been limited in what I could do while my cable modem was disconnected this last week. rxtx.org is something I do on my own time. The patches and credits will be comming next. Many of these can be seen in bugzilla right now. -- Trent Jarvi tjarvi at qbang.org From doug at dupreeinc.com Tue May 30 11:18:41 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 10:18:41 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: <447C7E71.4080204@dupreeinc.com> Trent, YiQi, and Jim: Thanks to all for the replies and information! I am just back from a long weekend and I am now trying to figure out what I was doing! :) As for more information. First off, this example is being run under windows XP. I am developing test equipment that communicates with a java application via a serial port. I have been using the commapi for several years and have not had a problem. Recently, I have started a design modification that will replace the RS232 connection with a USB port. I am using the ftdi module for prototyping and I discovered that their virtual com port driver was not compatible with the commapi that Sun released. It turns out that it has problems with hardware flow control ( it works on incoming but not outgoing communications). The way I figured this out was by experimenting with the SerialDemo that was included with the Sum commapi. One nice thing about this example is it has the ability to set incoming and outgoing flow control independently. After I installed RXTX into my JBuilder 2006 IDE, I just replaced all all instances of javax.comm with gnu.io and it compiled and runs without a hitch (except for the slow startup). I Paused the JBuilder IDE during this long pause and the last few entries in the stack trace are: testRead() : -1, gnu.io.RXTXCommDriver registerValidPorts() : 255, gnu.io.RXTXCommDriver registerScannedPorts() : 777, gnu.io.RXTXCommDriver This was all initiated by the following call in the programs init routine: Enumeration en = CommPortIdentifier.getPortIdentifiers(); After looking at this, My guess is that Trent is correct in that the delay is in scanning for ports. I guess one solution would be to not scan for ports, though it would be nice to detect what is available on the system. Is there any way to reduce the number of ports scanned by this function in windows XP? Thanks again for your time, Doug Trent Jarvi wrote: >On Sat, 27 May 2006, Jim Redman wrote: > > > >>Doug, >> >>Since you mentioned it, we have a system that is also seems slow. From >>memory (I don't have one of the slow systems around), I'm not sure that >>it's consistent, it seems that sometimes it may take longer than others. >>Since it's part of the bootup it hasn't raised a flag and I haven't >>researched it. >> >>The same code runs much faster on other systems, so now you've got me >>wondering what's different. >> >>The slow system boots DSL (http://www.damnsmalllinux.org/) from a >>compact flash. FC4 is on my desktop where I haven't noticed a slow >>down. I think that the rxtx code is the same in both cases with lock >>files disabled. >> >>The slow system has a bunch of serial ports defined, including 4 USB >>serial ports that do not exist - they are not plugged in. >> >>Any clues in there? >> >> >> > >rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. > >When it does this, it will try to open each port and do a timed out read. >most systems will not have entries in device if the port is not there. >But some minimal systems will just put all the device files there in case >hardware is added. > >The list of devices scanned used to be ~10-20 times longer than it is >today. That was getting very slow. > >I suspect moving the device files not used to a backup directory would >increase the enumeration. > >I'll look into why the mail-list archive is not updating. The last update >was about when I thought I 'fixed' the cron jobs. I probably didn't >actually fix it but rather moved the problem. > >-- >Trent Jarvi >tjarvi at qbang.org > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/86796453/attachment.html From doug at dupreeinc.com Tue May 30 14:36:09 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 13:36:09 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447C7E71.4080204@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com> Message-ID: <447CACB9.1000801@dupreeinc.com> Hello all, I also notice this pause (not as long however) when I call: CommPortIdentifier.getPortIdentifier(PortName); I would think that if I supply the name of the port, it would not have to go through the same discovery process. If you have any ideas of how to get rid of this startup delay, I would really appreciate it. Thanks, Doug Doug Thistlethwaite wrote: > Trent, YiQi, and Jim: > > Thanks to all for the replies and information! I am just back from a > long weekend and I am now trying to figure out what I was doing! :) > > As for more information. First off, this example is being run under > windows XP. I am developing test equipment that communicates with a > java application via a serial port. I have been using the commapi for > several years and have not had a problem. Recently, I have started a > design modification that will replace the RS232 connection with a USB > port. I am using the ftdi module for prototyping and I discovered > that their virtual com port driver was not compatible with the commapi > that Sun released. It turns out that it has problems with hardware > flow control ( it works on incoming but not outgoing communications). > The way I figured this out was by experimenting with the SerialDemo > that was included with the Sum commapi. One nice thing about this > example is it has the ability to set incoming and outgoing flow > control independently. > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup). > > I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are: > > testRead() : -1, gnu.io.RXTXCommDriver > registerValidPorts() : 255, gnu.io.RXTXCommDriver > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > This was all initiated by the following call in the programs init routine: > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > After looking at this, My guess is that Trent is correct in that the > delay is in scanning for ports. I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system. Is there any way to reduce the number of ports scanned by > this function in windows XP? > > Thanks again for your time, > > Doug > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/edaa5c3c/attachment.html From lynn at swcp.com Tue May 30 15:07:18 2006 From: lynn at swcp.com (lynn@swcp.com) Date: Tue, 30 May 2006 21:07:18 -0000 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CACB9.1000801@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: *IF* the name of the port is supplied, we might want to use the preferences mechanism (java.util.prefs) where we could have previously saved the info for the port. We could do a quick check to see that things have not changed before using it. If things have changed (or never been defined) we would do a full port scan and save detected ports in the preferences. This way if the hardware is not changed, you only pay the time penalty one time. just an idea... Lynn Doug Thistlethwaite said: > This is a multi-part message in MIME format. > --------------070808020900080005070500 > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > Content-Transfer-Encoding: 7bit > > Hello all, > > I also notice this pause (not as long however) when I call: > > CommPortIdentifier.getPortIdentifier(PortName); > > I would think that if I supply the name of the port, it would not have > to go through the same discovery process. If you have any ideas of how > to get rid of this startup delay, I would really appreciate it. > > Thanks, > > Doug > > Doug Thistlethwaite wrote: > > > Trent, YiQi, and Jim: > > > > Thanks to all for the replies and information! I am just back from a > > long weekend and I am now trying to figure out what I was doing! :) > > > > As for more information. First off, this example is being run under > > windows XP. I am developing test equipment that communicates with a > > java application via a serial port. I have been using the commapi for > > several years and have not had a problem. Recently, I have started a > > design modification that will replace the RS232 connection with a USB > > port. I am using the ftdi module for prototyping and I discovered > > that their virtual com port driver was not compatible with the commapi > > that Sun released. It turns out that it has problems with hardware > > flow control ( it works on incoming but not outgoing communications). > > The way I figured this out was by experimenting with the SerialDemo > > that was included with the Sum commapi. One nice thing about this > > example is it has the ability to set incoming and outgoing flow > > control independently. > > > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > > all instances of javax.comm with gnu.io and it compiled and runs > > without a hitch (except for the slow startup). > > > > I Paused the JBuilder IDE during this long pause and the last few > > entries in the stack trace are: > > > > testRead() : -1, gnu.io.RXTXCommDriver > > registerValidPorts() : 255, gnu.io.RXTXCommDriver > > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > > > This was all initiated by the following call in the programs init routine: > > > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > > > After looking at this, My guess is that Trent is correct in that the > > delay is in scanning for ports. I guess one solution would be to not > > scan for ports, though it would be nice to detect what is available on > > the system. Is there any way to reduce the number of ports scanned by > > this function in windows XP? > > > > Thanks again for your time, > > > > Doug > > > > --------------070808020900080005070500 > Content-Type: text/html; charset=ISO-8859-1 > Content-Transfer-Encoding: 7bit > > > > > > > > > Hello all,
>
> I also notice this pause (not as long however) when I call:
>
>          CommPortIdentifier.getPortIdentifier(PortName);
>
> I would think that if I supply the name of the port, it would not have > to go through the same discovery process.  If you have any ideas of how > to get rid of this startup delay, I would really appreciate it.
>
> Thanks,
>
> Doug
>
> Doug Thistlethwaite wrote: >
> > Trent, YiQi, and Jim:
>
> Thanks to all for the replies and information!  I am just back from a > long weekend and I am now trying to figure out what I was doing! :)
>
> As for more information.  First off, this example is being run under > windows XP.  I am developing test equipment that communicates with a > java application via a serial port.  I have been using the commapi for > several years and have not had a problem.  Recently, I have started a > design modification that will replace the RS232 connection with a USB > port.  I am using the ftdi module for prototyping and I discovered that > their virtual com port driver was not compatible with the commapi that > Sun released.  It turns out that it has problems with hardware flow > control ( it works on incoming but not outgoing communications).  The > way I figured this out was by experimenting with the SerialDemo that > was included with the Sum commapi.  One nice thing about this example > is it has the ability to set incoming and outgoing flow control > independently.
>
> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup).
>
> I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are:
>
> testRead() : -1, gnu.io.RXTXCommDriver
> registerValidPorts() : 255, gnu.io.RXTXCommDriver
> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>
> This was all initiated by the following call in the programs init > routine:
>
> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>
> After looking at this,  My guess is that Trent is correct in that the > delay is in scanning for ports.  I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system.  Is there any way to reduce the number of ports scanned by > this function in windows XP? 
>
> Thanks again for your time,
>
> Doug
>
>
> > > > --------------070808020900080005070500-- > -- From jredman at ergotech.com Tue May 30 15:42:35 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 30 May 2006 15:42:35 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: <447CBC4B.2080206@ergotech.com> Lynn, If I understand your idea correctly, I don't think that this would work well for, say, USB ports since these can be easily added/removed by the end user. Jim lynn at swcp.com wrote: > *IF* the name of the port is supplied, we might want to use the preferences > mechanism (java.util.prefs) where we could have previously saved the info for > the port. We could do a quick check to see that things have not changed > before using it. If things have changed (or never been defined) we would do a > full port scan and save detected ports in the preferences. > > This way if the hardware is not changed, you only pay the time penalty one time. > > just an idea... > Lynn > > > Doug Thistlethwaite said: > >> This is a multi-part message in MIME format. >> --------------070808020900080005070500 >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >> Content-Transfer-Encoding: 7bit >> >> Hello all, >> >> I also notice this pause (not as long however) when I call: >> >> CommPortIdentifier.getPortIdentifier(PortName); >> >> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process. If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it. >> >> Thanks, >> >> Doug >> >> Doug Thistlethwaite wrote: >> >>> Trent, YiQi, and Jim: >>> >>> Thanks to all for the replies and information! I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :) >>> >>> As for more information. First off, this example is being run under >>> windows XP. I am developing test equipment that communicates with a >>> java application via a serial port. I have been using the commapi for >>> several years and have not had a problem. Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port. I am using the ftdi module for prototyping and I discovered >>> that their virtual com port driver was not compatible with the commapi >>> that Sun released. It turns out that it has problems with hardware >>> flow control ( it works on incoming but not outgoing communications). >>> The way I figured this out was by experimenting with the SerialDemo >>> that was included with the Sum commapi. One nice thing about this >>> example is it has the ability to set incoming and outgoing flow >>> control independently. >>> >>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup). >>> >>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are: >>> >>> testRead() : -1, gnu.io.RXTXCommDriver >>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>> >>> This was all initiated by the following call in the programs init routine: >>> >>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>> >>> After looking at this, My guess is that Trent is correct in that the >>> delay is in scanning for ports. I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system. Is there any way to reduce the number of ports scanned by >>> this function in windows XP? >>> >>> Thanks again for your time, >>> >>> Doug >>> >> --------------070808020900080005070500 >> Content-Type: text/html; charset=ISO-8859-1 >> Content-Transfer-Encoding: 7bit >> >> >> >> >> >> >> >> >> Hello all,
>>
>> I also notice this pause (not as long however) when I call:
>>
>>         >  CommPortIdentifier.getPortIdentifier(PortName);
>>
>> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process.  If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it.
>>
>> Thanks,
>>
>> Doug
>>
>> Doug Thistlethwaite wrote: >>
>> >> Trent, YiQi, and Jim:
>>
>> Thanks to all for the replies and information!  I am just back from a >> long weekend and I am now trying to figure out what I was doing! :)
>>
>> As for more information.  First off, this example is being run under >> windows XP.  I am developing test equipment that communicates with a >> java application via a serial port.  I have been using the commapi for >> several years and have not had a problem.  Recently, I have started a >> design modification that will replace the RS232 connection with a USB >> port.  I am using the ftdi module for prototyping and I discovered that >> their virtual com port driver was not compatible with the commapi that >> Sun released.  It turns out that it has problems with hardware flow >> control ( it works on incoming but not outgoing communications).  The >> way I figured this out was by experimenting with the SerialDemo that >> was included with the Sum commapi.  One nice thing about this example >> is it has the ability to set incoming and outgoing flow control >> independently.
>>
>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >> all instances of javax.comm with gnu.io and it compiled and runs >> without a hitch (except for the slow startup).
>>
>> I Paused the JBuilder IDE during this long pause and the last few >> entries in the stack trace are:
>>
>> testRead() : -1, gnu.io.RXTXCommDriver
>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>
>> This was all initiated by the following call in the programs init >> routine:
>>
>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>
>> After looking at this,  My guess is that Trent is correct in that the >> delay is in scanning for ports.  I guess one solution would be to not >> scan for ports, though it would be nice to detect what is available on >> the system.  Is there any way to reduce the number of ports scanned by >> this function in windows XP? 
>>
>> Thanks again for your time,
>>
>> Doug
>>
>>
>> >> >> >> --------------070808020900080005070500-- >> > > > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From yhua537 at cse.unsw.edu.au Tue May 30 18:10:23 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 31 May 2006 10:10:23 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CBC4B.2080206@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: Doug, In the SerialDemo, it allow us to save the parameters into a file, and use it when your program start up. Would this help? YiQi On Tue, 30 May 2006, Jim Redman wrote: > Lynn, > > If I understand your idea correctly, I don't think that this would work > well for, say, USB ports since these can be easily added/removed by the > end user. > > Jim > > lynn at swcp.com wrote: >> *IF* the name of the port is supplied, we might want to use the preferences >> mechanism (java.util.prefs) where we could have previously saved the info for >> the port. We could do a quick check to see that things have not changed >> before using it. If things have changed (or never been defined) we would do a >> full port scan and save detected ports in the preferences. >> >> This way if the hardware is not changed, you only pay the time penalty one time. >> >> just an idea... >> Lynn >> >> >> Doug Thistlethwaite said: >> >>> This is a multi-part message in MIME format. >>> --------------070808020900080005070500 >>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>> Content-Transfer-Encoding: 7bit >>> >>> Hello all, >>> >>> I also notice this pause (not as long however) when I call: >>> >>> CommPortIdentifier.getPortIdentifier(PortName); >>> >>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process. If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it. >>> >>> Thanks, >>> >>> Doug >>> >>> Doug Thistlethwaite wrote: >>> >>>> Trent, YiQi, and Jim: >>>> >>>> Thanks to all for the replies and information! I am just back from a >>>> long weekend and I am now trying to figure out what I was doing! :) >>>> >>>> As for more information. First off, this example is being run under >>>> windows XP. I am developing test equipment that communicates with a >>>> java application via a serial port. I have been using the commapi for >>>> several years and have not had a problem. Recently, I have started a >>>> design modification that will replace the RS232 connection with a USB >>>> port. I am using the ftdi module for prototyping and I discovered >>>> that their virtual com port driver was not compatible with the commapi >>>> that Sun released. It turns out that it has problems with hardware >>>> flow control ( it works on incoming but not outgoing communications). >>>> The way I figured this out was by experimenting with the SerialDemo >>>> that was included with the Sum commapi. One nice thing about this >>>> example is it has the ability to set incoming and outgoing flow >>>> control independently. >>>> >>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>> all instances of javax.comm with gnu.io and it compiled and runs >>>> without a hitch (except for the slow startup). >>>> >>>> I Paused the JBuilder IDE during this long pause and the last few >>>> entries in the stack trace are: >>>> >>>> testRead() : -1, gnu.io.RXTXCommDriver >>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>> >>>> This was all initiated by the following call in the programs init routine: >>>> >>>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>> >>>> After looking at this, My guess is that Trent is correct in that the >>>> delay is in scanning for ports. I guess one solution would be to not >>>> scan for ports, though it would be nice to detect what is available on >>>> the system. Is there any way to reduce the number of ports scanned by >>>> this function in windows XP? >>>> >>>> Thanks again for your time, >>>> >>>> Doug >>>> >>> --------------070808020900080005070500 >>> Content-Type: text/html; charset=ISO-8859-1 >>> Content-Transfer-Encoding: 7bit >>> >>> >>> >>> >>> >>> >>> >>> >>> Hello all,
>>>
>>> I also notice this pause (not as long however) when I call:
>>>
>>>         >>  CommPortIdentifier.getPortIdentifier(PortName);
>>>
>>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process.  If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it.
>>>
>>> Thanks,
>>>
>>> Doug
>>>
>>> Doug Thistlethwaite wrote: >>>
>>> >>> Trent, YiQi, and Jim:
>>>
>>> Thanks to all for the replies and information!  I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :)
>>>
>>> As for more information.  First off, this example is being run under >>> windows XP.  I am developing test equipment that communicates with a >>> java application via a serial port.  I have been using the commapi for >>> several years and have not had a problem.  Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port.  I am using the ftdi module for prototyping and I discovered that >>> their virtual com port driver was not compatible with the commapi that >>> Sun released.  It turns out that it has problems with hardware flow >>> control ( it works on incoming but not outgoing communications).  The >>> way I figured this out was by experimenting with the SerialDemo that >>> was included with the Sum commapi.  One nice thing about this example >>> is it has the ability to set incoming and outgoing flow control >>> independently.
>>>
>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup).
>>>
>>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are:
>>>
>>> testRead() : -1, gnu.io.RXTXCommDriver
>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>
>>> This was all initiated by the following call in the programs init >>> routine:
>>>
>>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>
>>> After looking at this,  My guess is that Trent is correct in that the >>> delay is in scanning for ports.  I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system.  Is there any way to reduce the number of ports scanned by >>> this function in windows XP? 
>>>
>>> Thanks again for your time,
>>>
>>> Doug
>>>
>>>
>>> >>> >>> >>> --------------070808020900080005070500-- >>> >> >> >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From halbleib at rechnerbetriebsgruppe.de Wed May 31 02:06:16 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 10:06:16 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp Message-ID: <447D4E78.30302@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, I getting an error while reloading my app in tomcat. At the first start everything runs well, but if i reload mit webapp by tomcat manager i get the following error. java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader Is there a possibility to unload the native library rxtxSerial.dll? thx for all help! regards tom -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 b8FT80HQ1xlbDLnRecDANCc= =heb1 -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 02:52:17 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 10:52:17 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D4E78.30302@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> Message-ID: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Hello Tom, To the best of my knowledge it is impossible to unload native libraries once loaded into the JVM. The exception you see stems from the fact, that Tomcat creates a new classloader when you "reload" the weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar is loaded from the session class loader. Try to add RXTXComm.jar to your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. Regards, Joachim On 31.05.2006, at 10:06, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 > b8FT80HQ1xlbDLnRecDANCc= > =heb1 > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From halbleib at rechnerbetriebsgruppe.de Wed May 31 03:28:35 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 11:28:35 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Message-ID: <447D61C3.1030807@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Joachim, I'm still not getting it. How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml-file? Perhaps web.xml? Regards, Tom Joachim Buechse schrieb: > Hello Tom, > > To the best of my knowledge it is impossible to unload native > libraries once loaded into the JVM. The exception you see stems from > the fact, that Tomcat creates a new classloader when you "reload" the > weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar > is loaded from the session class loader. Try to add RXTXComm.jar to > your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. > > Regards, > Joachim > > On 31.05.2006, at 10:06, Tom Halbleib wrote: > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL tzNy+/0iIUfkYYgt1+UT1ko= =pkpY -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 04:03:42 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 12:03:42 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D61C3.1030807@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> <447D61C3.1030807@rechnerbetriebsgruppe.de> Message-ID: -Xbootclasspath/a: is a start option to the java vm. Google is your friend in finding how to modfiy it and what it means: tomcat modifying bootclasspath Regards, Joachim On 31.05.2006, at 11:28, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Joachim, > > I'm still not getting it. > How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml- > file? > Perhaps web.xml? > > Regards, > Tom > > Joachim Buechse schrieb: >> Hello Tom, >> >> To the best of my knowledge it is impossible to unload native >> libraries once loaded into the JVM. The exception you see stems from >> the fact, that Tomcat creates a new classloader when you "reload" the >> weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar >> is loaded from the session class loader. Try to add RXTXComm.jar to >> your bootlclasspath (-Xbootclasspath/a:) and the problem should go >> away. >> >> Regards, >> Joachim >> >> On 31.05.2006, at 10:06, Tom Halbleib wrote: >> >> Hi all, >> >> I getting an error while reloading my app in tomcat. At the first >> start >> everything runs well, but if i reload mit webapp by tomcat manager >> i get >> the following error. >> >> java.lang.UnsatisfiedLinkError: Native Library >> C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in >> another classloader thrown while loading gnu.io.RXTXCommDriver >> Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: >> Native >> Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already >> loaded >> in another classloader >> >> >> Is there a possibility to unload the native library rxtxSerial.dll? >> >> thx for all help! >> >> regards >> >> tom > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL > tzNy+/0iIUfkYYgt1+UT1ko= > =pkpY > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From impakt01 at optusnet.com.au Wed May 31 06:55:42 2006 From: impakt01 at optusnet.com.au (Daren) Date: Wed, 31 May 2006 22:55:42 +1000 Subject: [Rxtx] (no subject) Message-ID: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/ade7ad37/attachment.html From doug at dupreeinc.com Wed May 31 10:19:19 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 31 May 2006 09:19:19 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: <447DC207.3070702@dupreeinc.com> I am not sure what you are saying. The Save parameters menu option saves the current settings (baud, data bits, etc.). The long pause (~60 seconds) is when the application first starts (before loading the saved parameters). This does bring up a question, though I hate this type of kludge approach to getting this library to work... What exactly is a PortIdentifier? Is it always the same? If I stored the results from "CommPortIdentifier.getPortIdentifier(PortName);" in a file, could I use this the next time the program is executed? In this case I am using a virtual com port driver to connect to the device through a USB port. Doug YiQi Huang wrote: >Doug, > >In the SerialDemo, it allow us to save the parameters into a file, and use >it when your program start up. Would this help? > >YiQi > >On Tue, 30 May 2006, Jim Redman wrote: > > > >>Lynn, >> >>If I understand your idea correctly, I don't think that this would work >>well for, say, USB ports since these can be easily added/removed by the >>end user. >> >>Jim >> >>lynn at swcp.com wrote: >> >> >>>*IF* the name of the port is supplied, we might want to use the preferences >>>mechanism (java.util.prefs) where we could have previously saved the info for >>>the port. We could do a quick check to see that things have not changed >>>before using it. If things have changed (or never been defined) we would do a >>>full port scan and save detected ports in the preferences. >>> >>>This way if the hardware is not changed, you only pay the time penalty one time. >>> >>>just an idea... >>>Lynn >>> >>> >>>Doug Thistlethwaite said: >>> >>> >>> >>>>This is a multi-part message in MIME format. >>>>--------------070808020900080005070500 >>>>Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>>>Content-Transfer-Encoding: 7bit >>>> >>>>Hello all, >>>> >>>>I also notice this pause (not as long however) when I call: >>>> >>>> CommPortIdentifier.getPortIdentifier(PortName); >>>> >>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process. If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it. >>>> >>>>Thanks, >>>> >>>>Doug >>>> >>>>Doug Thistlethwaite wrote: >>>> >>>> >>>> >>>>>Trent, YiQi, and Jim: >>>>> >>>>>Thanks to all for the replies and information! I am just back from a >>>>>long weekend and I am now trying to figure out what I was doing! :) >>>>> >>>>>As for more information. First off, this example is being run under >>>>>windows XP. I am developing test equipment that communicates with a >>>>>java application via a serial port. I have been using the commapi for >>>>>several years and have not had a problem. Recently, I have started a >>>>>design modification that will replace the RS232 connection with a USB >>>>>port. I am using the ftdi module for prototyping and I discovered >>>>>that their virtual com port driver was not compatible with the commapi >>>>>that Sun released. It turns out that it has problems with hardware >>>>>flow control ( it works on incoming but not outgoing communications). >>>>>The way I figured this out was by experimenting with the SerialDemo >>>>>that was included with the Sum commapi. One nice thing about this >>>>>example is it has the ability to set incoming and outgoing flow >>>>>control independently. >>>>> >>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>>without a hitch (except for the slow startup). >>>>> >>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>>entries in the stack trace are: >>>>> >>>>>testRead() : -1, gnu.io.RXTXCommDriver >>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>>> >>>>>This was all initiated by the following call in the programs init routine: >>>>> >>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>>> >>>>>After looking at this, My guess is that Trent is correct in that the >>>>>delay is in scanning for ports. I guess one solution would be to not >>>>>scan for ports, though it would be nice to detect what is available on >>>>>the system. Is there any way to reduce the number of ports scanned by >>>>>this function in windows XP? >>>>> >>>>>Thanks again for your time, >>>>> >>>>>Doug >>>>> >>>>> >>>>> >>>>--------------070808020900080005070500 >>>>Content-Type: text/html; charset=ISO-8859-1 >>>>Content-Transfer-Encoding: 7bit >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>>Hello all,
>>>>
>>>>I also notice this pause (not as long however) when I call:
>>>>
>>>>        >>>> >>>> >>> CommPortIdentifier.getPortIdentifier(PortName);
>>> >>> >>>>
>>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process.  If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it.
>>>>
>>>>Thanks,
>>>>
>>>>Doug
>>>>
>>>>Doug Thistlethwaite wrote: >>>>
>>>> >>>>Trent, YiQi, and Jim:
>>>>
>>>>Thanks to all for the replies and information!  I am just back from a >>>>long weekend and I am now trying to figure out what I was doing! :)
>>>>
>>>>As for more information.  First off, this example is being run under >>>>windows XP.  I am developing test equipment that communicates with a >>>>java application via a serial port.  I have been using the commapi for >>>>several years and have not had a problem.  Recently, I have started a >>>>design modification that will replace the RS232 connection with a USB >>>>port.  I am using the ftdi module for prototyping and I discovered that >>>>their virtual com port driver was not compatible with the commapi that >>>>Sun released.  It turns out that it has problems with hardware flow >>>>control ( it works on incoming but not outgoing communications).  The >>>>way I figured this out was by experimenting with the SerialDemo that >>>>was included with the Sum commapi.  One nice thing about this example >>>>is it has the ability to set incoming and outgoing flow control >>>>independently.
>>>>
>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>without a hitch (except for the slow startup).
>>>>
>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>entries in the stack trace are:
>>>>
>>>>testRead() : -1, gnu.io.RXTXCommDriver
>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>>
>>>>This was all initiated by the following call in the programs init >>>>routine:
>>>>
>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>>
>>>>After looking at this,  My guess is that Trent is correct in that the >>>>delay is in scanning for ports.  I guess one solution would be to not >>>>scan for ports, though it would be nice to detect what is available on >>>>the system.  Is there any way to reduce the number of ports scanned by >>>>this function in windows XP? 
>>>>
>>>>Thanks again for your time,
>>>>
>>>>Doug
>>>>
>>>>
>>>> >>>> >>>> >>>>--------------070808020900080005070500-- >>>> >>>> >>>> >>> >>> >>> >>-- >>Jim Redman >>(505) 662 5156 x85 >>http://www.ergotech.com >>_______________________________________________ >>Rxtx mailing list >>Rxtx at qbang.org >>http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > >cheers >YiQi Huang >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/61d4d4c9/attachment.html From impakt01 at optusnet.com.au Wed May 31 17:02:54 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 09:02:54 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Message-ID: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Hi all, I downloaded 2.1.7-pre16 and managed to build it and get it going. I made the changes as suggested by Peter Smith in an old post, by adding his code to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. Still not working, it opens the port at 9600 according to portmon.exe . Has anyone managed to get this going at a custom rate? Here is the post I'm referring to: http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 Thanks, Daren ________________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Daren Sent: Wednesday, 31 May 2006 10:56 PM To: rxtx at qbang.org Subject: [Rxtx] (no subject) Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren From tjarvi at qbang.org Wed May 31 21:44:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 May 2006 21:44:01 -0600 (MDT) Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> References: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Message-ID: On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org From impakt01 at optusnet.com.au Wed May 31 22:06:04 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 14:06:04 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: Message-ID: <200606010406.k51464X2010447@mail03.syd.optusnet.com.au> Trent, I have managed to successfully open the port at this speed using Realterm (available on sourceforge). From memory this uses DLPortIO. Using portmon.exe with realterm, even there it says that the port has opened at 1953. I changed termios.c:560 to dcb->BaudRate = 1953 ; and it still opens the port at 9600. Daren -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Thursday, 1 June 2006 1:44 PM To: RXTX Developers and Users Subject: Re: [Rxtx] custom baud rate win32 On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From smontgomery at mediaspansoftware.com Mon May 1 09:52:28 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 11:52:28 -0400 Subject: [Rxtx] RXTX, Java COMM and Windows Server 2003 on x64 experiences? Message-ID: Just wondering if anybody here has had to deploy RXTX or the javax.comm on Windows Server 2003 machines running on x64 (i.e. Xeon EM64T) and would like to relate how things went. From Sun's site, the Supported System Configurations pages give the options for that system: Java 5.0: - 32-bit Java 5.0 running on the OS in the 32-bit mode - 64-bit Java 5.0 running on the OS in the 64-bit native mode Java 1.4.2: - no options listed for EM64T processors, but potentially the standard 32-bit Java 1.4.2 could run on the OS in 32-bit mode? I guess the two main points of failure would be 1) the JVM itself and 2) the jni components. Make that three: there's gotta be hardware vendor driver support for the OS in the various modes, too. Guess I better go look at Keyspan's website... Thanks in advance for any info anyone might be able to provide. From smontgomery at mediaspansoftware.com Mon May 1 10:18:33 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 12:18:33 -0400 Subject: [Rxtx] Mailing list archive out of date? Message-ID: The mailing list archive at: http://mailman.qbang.org/pipermail/rxtx/ only shows emails through the end of March. Is there a new archive somewhere else? Didn't see anything mentioned on the wiki. From p.cain at phasefale.com.au Mon May 1 22:33:09 2006 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 02 May 2006 14:33:09 +1000 Subject: [Rxtx] RXTX and the Linux kernel. Message-ID: <4456E105.5080106@phasefale.com.au> Hi, First off the problem I am having isn't caused by RXTX itself but I'm hoping someone out there may have some knowledge that may help me. Background: I have an application monitoring a control system through a standard PC serial port which I talk to with rxtx-2.0.5. The application runs on RedHat7.3 kernel version 2.4.18 using Java 1.4. This configuration has been in use for several years and has proved to be stable. But it has become necessary for me to upgrade the OS but I'm running into problems with the serial communications. Its not that the comms don't work on the new OS (its never that simple) the comms work for a variable period of time (sometimes several hours) and then just stop, nothing on the data lines and control lines all indicate that data could flow. The new OS is Ubuntu 5.10 running kernel version 2.6.12. I have installed the OS and software on a PC and had it perform ok, then install the new OS and same software on the very same hardware and experienced the problems of them comms stopping. In the new OS I'm using Java5 to run the app but since I have experience the problem I reverted back to Java1.4 which didn't fix the problem. I've moved the app to a different system RedHat FC3 running 2.6.14 had experienced the problem. Not wanting to go through all the thing I have tried but I have established that it seems to be the 2.6 versions of the kernel that seem to be the problem and not an individual distribution of Linux. I should point out that I am using the same jar and library files for each java and OS combination. So I'm just wondering if anyone has had or heard of problems similar to these ? Or perhaps might know of what changed in the Linux serial driver (something I'm having a hard time establishing). I'm starting to run low on ideas of what to try so any help would be much appreciated. -- Peter Cain Senior Programmer Phasefale Pty Ltd From tjarvi at qbang.org Wed May 3 07:31:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 May 2006 07:31:00 -0600 (MDT) Subject: [Rxtx] Re: Concering ircomm and RXTX In-Reply-To: References: Message-ID: On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From legolas.w at gmail.com Wed May 3 08:46:23 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 19:16:23 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <4458C23F.2000003@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From legolas.w at gmail.com Wed May 3 13:10:57 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 23:40:57 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <44590041.80706@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From Lars.Hennig at wow-portal.com Thu May 4 00:39:15 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Thu, 4 May 2006 08:39:15 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: Message-ID: Hi, I could not find any solution. I therefore decided to to my own native implementation. Allthough it only supports the functions I need, it works pretty well now for me. I think the main problem there is the use of a wrong Windows API function and not setting an timeout. Regards, Lars Hennig W?rth Online World GmbH Tel. (0049)7181-258183 Mob. (0049)160-3522889 Fax. (0049)7940-153299 Lars.Hennig at wow-portal.com Gesendet von: rxtx-bounces at qbang.org 09.04.2006 10:42 Bitte antworten zu RXTX Developers and Users An d.herwald at dsh-elektronik.de, RXTX Developers and Users Kopie Thema Re: [Rxtx] USB Serialport - disconnection problems WV Proj./Teilpr.: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/7b39f374/attachment-0001.html From Pawan.Kharbanda at dot.state.co.us Thu May 4 11:00:58 2006 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Thu, 4 May 2006 11:00:58 -0600 Subject: [Rxtx] Dangling Lock Files Message-ID: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Hi, I have been using RXTX API's for the Serial Communication for quite some time now and for some of the devices we are opening and closing the connection every 2 minutes. This works great for few days and then suddenly I start seeing some "Port in Use Exception" and I see that the Lock files are still in the /var/lock folder after manually removing the lock files it works good for few hours and I see the same problem again. Can somebody explain me the scenarios why I am seeing the dangling Lock files? I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise Servers. Thanks Pawan Kharbanda -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/ba0e9261/attachment-0001.html From tjarvi at qbang.org Thu May 4 14:10:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:10:30 -0600 (MDT) Subject: [Rxtx] Dangling Lock Files In-Reply-To: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> References: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Message-ID: On Thu, 4 May 2006, Kharbanda, Pawan wrote: > Hi, > I have been using RXTX API's for the Serial Communication for quite > some time now and for some of the devices we are opening and closing the > connection every 2 minutes. This works great for few days and then > suddenly I start seeing some "Port in Use Exception" and I see that the > Lock files are still in the /var/lock folder after manually removing the > lock files it works good for few hours and I see the same problem again. > Can somebody explain me the scenarios why I am seeing the dangling Lock > files? > > I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise > Servers. Hi Pawan The next time it happens, look in the lockfile. There will be a pid. ps aux |grep 'pid' I think you will see that the application is still running for some reason. RXTX does a kill -0 on the pid to see if its alive. If not, it will remove the lockfile. So I suspect the previous program did not exit as you expected. -- Trent Jarvi tjarvi at qbang.org From Scott.Hughes at dalsemi.com Thu May 4 14:23:11 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 4 May 2006 15:23:11 -0500 Subject: [Rxtx] Wiki instructions... Message-ID: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire demo apps, when I stumbled across this tip on the wiki to add yourself to the uucp group: It may be simpler to just run usermod -G uucp jarvi Taken from: http://rxtx.qbang.org/wiki/index.php/Installation This does not work as advertised. I should have read the man page for usermod before I tried that out. If there are any groups which are not listed after the -G switch, the user is removed from those groups. On Ubuntu, this is bad... I removed myself from the Admin group, which removed my sudo priviledges. Ubuntu has no root account, so I've disabled the only account which could fix it. Anyone know of a good workaround? Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor From tjarvi at qbang.org Thu May 4 14:32:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:32:09 -0600 (MDT) Subject: [Rxtx] Wiki instructions... In-Reply-To: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> Message-ID: On Thu, 4 May 2006, Scott Hughes wrote: > I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire > demo apps, when I stumbled across this tip on the wiki to add yourself to > the uucp group: > > It may be simpler to just run > > usermod -G uucp jarvi > > Taken from: > http://rxtx.qbang.org/wiki/index.php/Installation > > This does not work as advertised. I should have read the man page for > usermod before I tried that out. If there are any groups which are not > listed after the -G switch, the user is removed from those groups. On > Ubuntu, this is bad... I removed myself from the Admin group, which removed > my sudo priviledges. Ubuntu has no root account, so I've disabled the only > account which could fix it. > > Anyone know of a good workaround? > Yikes This will get your permissions back: in grub/lilo/.. pass the following option to the kernel init=/bin/sh You are now root. when it boots, mount -o remount,rw / add yourself to the groups, reboot to get normal init going. Thats about all I can think of without sudo/root. -- Trent Jarvi tjarvi at qbang.org From Gettings at earth.utah.edu Thu May 4 14:41:22 2006 From: Gettings at earth.utah.edu (Paul Gettings) Date: Thu, 4 May 2006 14:41:22 -0600 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <20060504204122.GA6534@earth.utah.edu> When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get messages on stdout from the JVM: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 As the only change was the version of RXTX (from 2.1.6), I am unsure why the messages suddenly appeared. Anyone know how to get rid of them? Thanks. -- 101 USES FOR A DEAD MICROPROCESSOR (23) Dead cat brush From mmester at sps.edu Mon May 1 21:22:28 2006 From: mmester at sps.edu (Michael Mester) Date: Mon, 1 May 2006 23:22:28 -0400 Subject: [Rxtx] Windows PortInUseException Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> I'm trying to get simple serial communication going with RxTx under Windows XP. I can enumerate the ports fine, but I always run into problems when I try to open one. I get a PortInUseException, but the owner application is "Unknown" and the port is never open. I've tried this on several different systems and all of them give the same behavior. The only thing I can thiunk of that might be causing the problem is that fact that I had to put the serial .dll file in system32 instead of the reccommended folder, because it didn't work in the folder the documentation gives. The library loads fine, though, so I'm not sure whether that makes sense, and I don't know how to fix it anyway. Any help is greatly appreciated. Below is the output of the program, right up to the PortInUseException and the NullPointerException it causes (because the serial port object is not instantiated). C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI Starting GPSTalkerGUI... Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 gnu.io.PortInUseException: Unknown Application Exception in thread "main" java.lang.NullPointerException at GPSTalkerGUI.(GPSTalkerGUI.java:102) at GPSTalkerGUI.main(GPSTalkerGUI.java:161) Again, thank you very much for any help you can give. From lshellman at qwest.net Wed May 3 01:38:34 2006 From: lshellman at qwest.net (Lucious Shellman) Date: Wed, 03 May 2006 01:38:34 -0600 Subject: [Rxtx] Help needed: Project using parallel port Message-ID: <1146641914.8337.14.camel@localhost.localdomain> I was looking for a way to access the parallel port on a PC using Java. Searching the Internet, I came across this site (rxtx.org). What I am trying to do is detect logic levels from a TTL logic IC on the parallel port. I am not trying to do classic parallel port communication. I just want to detect whether a line(s) is (are) high or low. I am using Windows 98. Can rxtx be used to do this? If yes, is there a tutorial for using rxtx posted on the Internet that someone can direct me to. If you need more information, feel free to e-mail me. Unfortunately for me, I need the information ASAP. Thanks. lshellman at qwest.net From webmaster at egyhelp.com Wed May 3 18:43:39 2006 From: webmaster at egyhelp.com (Mohamed Samy) Date: Thu, 4 May 2006 02:43:39 +0200 Subject: [Rxtx] RE: Concering ircomm and RXTX In-Reply-To: Message-ID: <20060503184362.SM01044@Geek> Hey, I issue the command "modprobe ircomm-tty" yet no ttyircomm appears, while the ircomm appear by "modprobe ircomm" so forgive me but I am bit lost. Even searching google for the keyword "ttyircomm" only returns 3 matches. So any way I can start the ttyircomm???? Thanks a lot. -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Wednesday, May 03, 2006 3:31 PM To: Mohamed Samy; rxtx at qbang.org Cc: taj at www.linux.org.uk Subject: Re: Concering ircomm and RXTX On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 4 15:49:49 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 15:49:49 -0600 (MDT) Subject: [Rxtx] Windows PortInUseException In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> Message-ID: On Mon, 1 May 2006, Michael Mester wrote: > > I'm trying to get simple serial communication going with RxTx under > Windows XP. I can enumerate the ports fine, but I always run into > problems when I try to open one. I get a PortInUseException, but the > owner application is "Unknown" and the port is never open. I've tried > this on several different systems and all of them give the same > behavior. The only thing I can thiunk of that might be causing the > problem is that fact that I had to put the serial .dll file in system32 > instead of the reccommended folder, because it didn't work in the folder > the documentation gives. The library loads fine, though, so I'm not sure > whether that makes sense, and I don't know how to fix it anyway. Any > help is greatly appreciated. Below is the output of the program, right > up to the PortInUseException and the NullPointerException it causes > (because the serial port object is not instantiated). > > C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI > Starting GPSTalkerGUI... > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > gnu.io.PortInUseException: Unknown Application > Exception in thread "main" java.lang.NullPointerException > at GPSTalkerGUI.(GPSTalkerGUI.java:102) > at GPSTalkerGUI.main(GPSTalkerGUI.java:161) > Perhaps you are trying to open the port twice in your code? rxtx does open the ports, do a timed out read and then close the ports during enumeration. I think the port is being opened fine. The Unknown Application is always reported. On linux, there is some code that finds the actual application but on windows, its always unknown. If the port enumeration is returning the ports you expect, rxtx has opened the port and closed it with success. The port should open. There is also example code in the contrib directory that comes with rxtx source that has examples you can modify to work. -- Trent Jarvi tjarvi at qbang.org From Christian.Klemke at t-online.de Thu May 4 23:37:23 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Fri, 5 May 2006 07:37:23 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu> Message-ID: <004f01c67005$fc72fee0$016a10ac@NB600> Hi Paul, I was wondering about the same question some days ago and took a look at the source files. Unfortunately, I found that you can only get rid of that messages by altering and recompiling the Java code. There is a final static boolean variable called "devel" in the file "RXTXCommDriver.java" which is set to "true". This constellation causes the output after the native libraries have been loaded. No mechanism exists to suppress them otherwise :-(. Trent, does that mean that 2.1.7 is still officially a "development" version ? When will this value be changed to "false" by default ? With 2.1.8 ? It would be nice to provide a means to suppress such messages besides that static flag (maybe by setting a property called "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The output can indeed by annoying, especially when used with console applications, where the message potentially appears "in the middle" of your own output. Another possibility would be not to use System.out directly, but instead some PrintStream field which is initially set to System.out but can programatically be changed. That would allow for any kind of redirection or suppression by implementing appropriate user-defined PrintStream subclasses and making RXTX use that stream. What do you think ? Best regards, Christian ----- Original Message ----- From: "Paul Gettings" To: Sent: Thursday, May 04, 2006 10:41 PM Subject: [Rxtx] RXTX causing stdout messages > When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get > messages on stdout from the JVM: > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > As the only change was the version of RXTX (from 2.1.6), I am unsure > why the messages suddenly appeared. Anyone know how to get rid of > them? > > Thanks. > > -- > 101 USES FOR A DEAD MICROPROCESSOR > (23) Dead cat brush > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri May 5 06:09:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 06:09:46 -0600 (MDT) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <004f01c67005$fc72fee0$016a10ac@NB600> References: <20060504204122.GA6534@earth.utah.edu> <004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: On Fri, 5 May 2006, Christian Klemke wrote: > Hi Paul, > > I was wondering about the same question some days ago and took a look at the > source files. Unfortunately, I found that you can only get rid of that > messages by altering and recompiling the Java code. There is a final static > boolean variable called "devel" in the file "RXTXCommDriver.java" which is > set to "true". This constellation causes the output after the native > libraries have been loaded. No mechanism exists to suppress them otherwise > :-(. > > Trent, does that mean that 2.1.7 is still officially a "development" version > ? When will this value be changed to "false" by default ? With 2.1.8 ? It > would be nice to provide a means to suppress such messages besides that > static flag (maybe by setting a property called > "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The > output can indeed by annoying, especially when used with console > applications, where the message potentially appears "in the middle" of your > own output. Another possibility would be not to use System.out directly, but > instead some PrintStream field which is initially set to System.out but can > programatically be changed. That would allow for any kind of redirection or > suppression by implementing appropriate user-defined PrintStream subclasses > and making RXTX use that stream. What do you think ? > A patch for using properties would be accepted I'm sure. The reason the default is to display the message is not related to the development state of rxtx anymore. The problem is that people first using rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. The message prevents a great deal of email thats easily explained by the message. I question if we should support rxtx 2.0 at all anymore. If you post a patch in bugzilla, we'll put it into CVS this weekend. we'll be going through and doing such things anyhow. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri May 5 13:23:56 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 13:23:56 -0600 (MDT) Subject: [Rxtx] How to read from RxTx parallel port in Win XP In-Reply-To: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> References: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> Message-ID: On Thu, 27 Apr 2006, Worsley, Bob (Development Engineer) wrote: > I'm sorry if this is a dumb question, but I didn't find the answer in > the archives. > > I'm using the RxTx binaries for Windows on a reasonably current notebook > PC running Windows XP. I can send stuff to a printer on the parallel > port (LPT1), but I can't get anything back. > > I wrote a class that has the methods listed below. I write some data to > the printer with the "write" method and then try to read a response > using the "read" method, but I never get any data. I'd greatly > appreciate any help you can give! > > Bob Worsley > bobwoyid2 at yahoo.com > > > > > private ParallelPort parallelPort = null; > private RXTXCommDriver parallelPortDriver = null; > > > public boolean initialize() throws IOException { > if (parallelPort != null) { > return false; // Already initialized > } > > // Create the parallel port; > parallelPortDriver = new RXTXCommDriver(); > parallelPort = > (ParallelPort)parallelPortDriver.getCommPort(address, > CommPortIdentifier.PORT_PARALLEL); > > // Set the parallel port parameters. > try { > parallelPort.enableReceiveTimeout(READ_TIMEOUT); > parallelPort.disableReceiveFraming(); > parallelPort.disableReceiveThreshold(); > //parallelPort.setMode(mode); !!!!errors > } catch (UnsupportedCommOperationException e) { > throw (new IOException("Parallel port with address '" + > address > + "' cannot be configured as specified")); > } > > return true; > } > > > > public void write(final byte[] bytes) throws IOException { > initialize(); > while (busyReading) { > Thread.yield(); > } > busyWriting = true; > if (bytes.length < 1) { > return; > } > OutputStream outputStream = parallelPort.getOutputStream(); > outputStream.write(bytes); > outputStream.flush(); > outputStream.close(); > Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); > busyWriting = false; > } > > > public byte[] read() throws IOException { > > // Read up to MAX_BYTES bytes. > initialize(); > while (busyWriting) { > Thread.yield(); > } > busyReading = true; > byte[] buff = new byte[MAX_BYTES_READ]; > InputStream inputStream = parallelPort.getInputStream(); > // This read blocks until input data is available > int bytesRead = inputStream.read(buff); > inputStream.close(); > // If no data read, create empty array > if (bytesRead == -1) { > bytesRead = 0; > } > byte[] deviceBytes = new byte[bytesRead]; > System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); > if (bytesRead > 0) { > Debug.p("PPIOP.read - got data: '" + new > String(deviceBytes) + "'"); > } > busyReading = false; > return deviceBytes; > } > Hi Bob I've only used rxtx to test a hello world page printing but there are others that have used it. PPIOP? hmm what is this? :) The rxtx parallel support is behind the serial support but should be OK. As you note, the setting of modes is not supported. rxtx uses what is provided when the port is open. Are your asserting the pin for the printer being online? I suspect what often happens is people try to just use the data pins but the C API rxtx uses wants the printer to be online. There should be some posts relating to this in the rxtx mail-list archive. Some APIs are probably reading and writing from the port address (also suggested in your code as something you are looking at). RXTX currently uses a higher level C/C++ API for port access. This can still work if the API thinks the 'printer' is there. -- Trent Jarvi tjarvi at qbang.org From agrodellic at gmail.com Sat May 6 08:39:40 2006 From: agrodellic at gmail.com (Leigh Stewart) Date: Sat, 6 May 2006 10:39:40 -0400 Subject: [Rxtx] sun commapi 3 Message-ID: I think I read here: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html that rxtx-2.0 is basically fracked for now? Does anyone know of a workaround? ie can i somehow get an older version of sun's comm api and use that (not easy to find)? i mean 2.0 must be working for someone...how is it being tested. 2.1 isnt working for me....im getting nasty native exceptions etc, which is why im so set on 2.0... any ideas? From tjarvi at qbang.org Sun May 7 15:40:27 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 7 May 2006 15:40:27 -0600 (MDT) Subject: [Rxtx] sun commapi 3 In-Reply-To: References: Message-ID: On Sat, 6 May 2006, Leigh Stewart wrote: > > 2.1 isnt working for me....im getting nasty native exceptions etc, > which is why im so set on 2.0... any ideas? > Hi Leigh What native exceptions are you seeing? Which OS? The native code is almost identical between rxtx 2.0 and 2.1. Only the names have been changed to protect the inocent. :) ie: javax_comm_... vs gnu_io_... So the odds are very likely that even if you do find commapi 2.0 and get it installed, you will run into the same error. It would be better to just find and fix the problem. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Mon May 8 10:47:20 2006 From: mail at willicon.de (WILLICon) Date: Mon, 08 May 2006 18:47:20 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 Message-ID: <445F7618.3070303@willicon.de> Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/ef37e8ec/attachment-0001.html From tjarvi at qbang.org Mon May 8 16:14:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 May 2006 16:14:51 -0600 (MDT) Subject: [Rxtx] Screenshot of Application using RXTX (fwd) Message-ID: Just though someone may end up searching for 0x0D and 0x0A. Here are the details from his system. SuSE Linux 10.0 (x86_64) Kernel 2.6.13-15.8 j2se 1.4.2_11 (i586) Sun: comm3.0_u1 rxtx: rxtx-2.1-7 ---------- Forwarded message ---------- Date: Sat, 6 May 2006 20:01:46 +0200 From: Michael Poppitz To: taj at www.linux.org.uk Subject: Screenshot of Application using RXTX Hi Trent, the rxtx package works like a charm. Sun's package seemed to replace all 0x0D with 0x0A in received data on my Linux box, which is really annoying when transfering binary data. But rxtx came and saved the day - and turned out to be a lot more convenient as it does not require a configuration file. I use it for connecting to a home made logic analyzer. (http://www.sump.org/projects/analyzer/) Thanks for your great job, Michael -------------- next part -------------- A non-text attachment was scrubbed... Name: la_client.png Type: image/png Size: 16592 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/45494fbb/la_client-0001.png From tjarvi at qbang.org Tue May 9 14:56:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 May 2006 14:56:05 -0600 (MDT) Subject: [Rxtx] RXTX javax.comm: which one to install? In-Reply-To: <20060509161742.43547.qmail@web53814.mail.yahoo.com> References: <20060509161742.43547.qmail@web53814.mail.yahoo.com> Message-ID: On Tue, 9 May 2006, Adenilson Cavalcanti wrote: > Dear Trent Jarvi > > I'm trying to write a small Java app running in linux that interfaces with a device connected to serial port. > > I do have some questions about RXTX and javax.comm state of affairs, since I'm new to Java programming (used to program in plain old C writting to devices using termios and open/write/read syscalls, but this is another story). > > I ask you the favor to clarify this issues (if possible...): > > a) Sun offers to download a file (comm3.0_u1_PUTAUNIXVERSION.zip) which does contain .so files. Does it work out of box? > > b) Case negative, its there that we should use 'librxtx*.so' provided by your site? > > c) Sun's comm3 API version does work with which version of rxtx? > > I already searched google and read documentation available in rxtx site ("Java Comm Serial API How-to") but still have this issues unsolved. Any help will be appreciated. > > Best regards > > Adenilson Hi Adenilson, RXTX does not currently support javax.comm in Sun's CommAPI 3.0. I would recommend using package gnu.io provided by rxtx 2.1. -- Trent Jarvi tjarvi at qbang.org From chris.develder at intec.ugent.be Wed May 10 08:45:40 2006 From: chris.develder at intec.ugent.be (Chris Develder) Date: Wed, 10 May 2006 16:45:40 +0200 Subject: [Rxtx] rxtx troubles on ARM Message-ID: <4461FC94.6040909@intec.ugent.be> Hi all, Sorry to bother you, but I don't seem to get RXTX working on an ARM processor (xscale ixp 425, big endian). I managed to crosscompile the rxtx libs and moved it over to the ARM. Using jamvm (which is the only open source java VM we got working on the ARM), I get the following error result when running SimpleRead from Sun's javax.comm examples (commapi\examples\Simple\SimpleRead) -- see bottom of mail for complete output: "java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver" However, output shows that the RXTXCommDriver code is accessible (cf. debug and devel output of lib versions). So it doesn't seem to be a missing lib/jar issue. The error happens before RXTXCommDriver.initialize() is called, since the first line there is System.out.println("RXTXCommDriver:initialize()"); Any ideas? Cheers, Chris ---------------------------- [root at xxx(ttyp1) /work/cdvelder/xscale/test]# jamvm -Djava.library.path=/work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/jre/lib/arm -classpath /work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/lib/ext/RXTXcomm.jar:./comm.jar:. SimpleRead RXTXCommDriver {} Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTXCommDriver: Jar version = RXTX-2.1-7 native lib Version = RXTX-2.1-7 java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver gnu/io/RXTXCommDriver at javax.comm.CommPortIdentifier.loadDriver (CommPortIdentifier.java:239) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:109) at SimpleRead.main (Unknown Source) java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive (Native Method) at com.sun.comm.Portmapping.registerCommPorts (Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase (Portmapping.java:100) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:138) at SimpleRead.main (Unknown Source) From joachim at buechse.de Fri May 12 00:44:48 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 08:44:48 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) Message-ID: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Good day, I guess that only a selected few (hi Trent) will be able to answer this question, but the answer might be interesting for anyone trying to debug or understand the code. Apparently the MonitorThread is started and stopped in RXTXPort.addEventListener and RXTXPort.removeEventListener. This would indicate that (originally?) the MonitorThread is only required when there is an EventListener. However the MonitorThread is also started in the RXTXPort constructor, which could mean that RXTX won't work at all if it isn't there. It seems to me, that if anyone would add an event listener and later on remove it, he could potentially wreak the port. Because the second action would kill the MonitorThread. For the moment I am only trying to understand the role of and idea behind the MonitorThread. But of course there is a deeper reason thor my question: If the MonitorThread needs to exist anyway, it could be the thread that cleans up the port (ie calls nativeClose) - this would eliminate (a further) problem I am seeing with some USB drivers on Mac OSX. (Close blocks (after releasing the tty, but still) in the USB driver if the device is "not responding"). Greetings, Joachim From tjarvi at qbang.org Fri May 12 07:10:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 12 May 2006 07:10:59 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Fri, 12 May 2006, Joachim Buechse wrote: > Good day, > > I guess that only a selected few (hi Trent) will be able to answer > this question, but the answer might be interesting for anyone trying > to debug or understand the code. > > Apparently the MonitorThread is started and stopped in > RXTXPort.addEventListener and RXTXPort.removeEventListener. This > would indicate that (originally?) the MonitorThread is only required > when there is an EventListener. However the MonitorThread is also > started in the RXTXPort constructor, which could mean that RXTX won't > work at all if it isn't there. > > It seems to me, that if anyone would add an event listener and later > on remove it, he could potentially wreak the port. Because the second > action would kill the MonitorThread. > > > For the moment I am only trying to understand the role of and idea > behind the MonitorThread. But of course there is a deeper reason thor > my question: > > If the MonitorThread needs to exist anyway, it could be the thread > that cleans up the port (ie calls nativeClose) - this would eliminate > (a further) problem I am seeing with some USB drivers on Mac OSX. > (Close blocks (after releasing the tty, but still) in the USB driver > if the device is "not responding"). > Hi Jaochim Before commapi, rxtx did not support events. You could read, write and change port settings. The MonitorThread was added as an afterthought to support commapi events. So the way things are now his historical spaghetti not a well devised plan. It is my opinion that the MonitorThread should exist as long as the port is open. The odd starting of the thread in the constructor and addEventListener was just to get past the obvious problem of people using the port without adding listeners. -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Fri May 12 07:59:50 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 15:59:50 +0200 Subject: [Rxtx] MonitorThread -> ChangeRequest In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: <2B1E508C-8CEE-4AB7-914D-E7BA25C871A2@buechse.de> In this case I suggest removing the starting/stopping of MonitorThread in addEventListener / removeEventListener. This should not affect existing projects. On 12.05.2006, at 15:10, Trent Jarvi wrote: > It is my opinion that the MonitorThread should exist as long as the > port > is open. The odd starting of the thread in the constructor and > addEventListener was just to get past the obvious problem of people > using > the port without adding listeners. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Fri May 12 11:43:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 19:43:21 +0200 Subject: [Rxtx] Spring Cleaning - some suggestions Message-ID: The current implementation of RXTX contains quite a lot of code that will break if it is used from several threads (especially on a multi processor machine). I think it would be nice to clean this up. I suggest the following changes (which keep the current semantics and should not influence existing projects in a negative way): - InterruptedException will never be ignored or reset - read methods will be protected with a Monitor - write methods will be protected with a (separate) Monitor - close() sets the read and write monitors into a "closed" state which will lead to IOExceptions for any following call to RXTXPort.read/write. - close() will wait a finite amount of time (maybe 500ms) for the release of the read and write monitors after that, it will trigger the closing of the file descriptor to abort any pending read or write. - close() will not call close(file_desc). Instead it will "interrupt" (ie set a flag and then, pthread_kill(ABRT)) the MonitorThread, the MonitorThread will call close(file_desc). - the monitors are properly released in a finally block the try of which starts directly after obtaining the monitor. - finally will not call close(file_desc) it will only "interrupt" the MonitorThread (see above) - the native-code (esp read) does not use SA_RESTART but checks Thread.interrupted() when it receives a SIGNAL (ie system call returns with EINTR or other signalling method). The read/write monitors will be allocated from a factory whose mode can be set to fast/normal/advanced. In fast-mode it will create "non thread safe, non synchronized" pseudo-monitors. In default mode, the monitors will store the owning thread. In "advanced" mode setting the monitors into closed state will "interrupt()" threads which are blocked in a native read/write. {Reasoning close behaviour: Calling close on a file descriptor in Windows unblocks any read() or write() on the same file descriptor with an error. On Solaris < 2.7 and MacOS X however the close() will/ can block - until the read or write have finished:-(( Even the JDK people have trouble with this. I dont know how Linux reacts in this case. The best practice for BSD/Solaris is to send a signal to the thread which will usually unblock the read/write with an EINTR - this however is not guarenteed as it also depends on the device driver. So the only resolution that will certainly not block the thread calling RXTXPort.close() (which will often enough be the AWT event dispatcher or the VM finalizer thread) is to call close(fd) from another thread.} {Reasoning read behaviour: It is rather uncommon to receive a signal while reading or writing - it will happen, but checking Thread.interrupted() when it happens will not degrade performance. The checking of Thread.interrupted() can be handled by returning to Java and potententially reentering into the native code if the thread was not interrupted or by calling back into the VM from the native code. On top of this, many functions like read(byte[]) or read(byte [], int, int) are allowed to return less than the requested amount of data. Only int read() is a bit more tricky. } [Trent: From the code I can tell, that you experimented quite a bit with signals. Do you know if the Java Thread.interrupt() triggers a unix signal on Linux/Solaris? If so, which one?? References: - http://java.sun.com/docs/hotspot/VMOptions.html - http://www.hp.com/products1/unix/java/infolibrary/prog_guide/ signals.html ] On OS X (hotspot client jdk-1.4.2) I did not see any signal propagated to the SELECT of the event_loop/MonitorThread (ie no EINTR) when I call monThread.interrupt(). This is a pitty, but thats the way it is. I simply assume this is true for most system calls. How to handle this? Of course it would be possible to install/ deinstall a specific signal handler before/after every native read and to natively send an ABRT signal if RXTXPort.close is called. A more elegant solution might be to have an additional "signaling" socket which is always included in the SELECT. Or the simplest solution: cap the timeout of the select to 500 ms (the loop around it exists already) after every timeout check the Thread.interrupted() flag. From a performance perspective this should be completely invisible... On the other hand, all write() calls need to be preceeded by a SELECT as well, to avoid running into a blocking write. Best regards, Joachim From lyon at docjava.com Sat May 13 05:54:52 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 13 May 2006 07:54:52 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Dmitry suggests that we acquire an implementation of a serial port reference, use it, then release it (i.e., check it back in). Joachim says that making serial ports thread friendly might be a good idea. This is a good idea. The design pattern that is close to this idea is the "Object Pool Design Pattern". # Object Pool Manage the reuse of objects for a type of object that is expensive to create or only a limited number of a kind of object can be created. It has been described at: http://www.developer.com/java/ent/article.php/626171 and in Marks' book, Patterns in Java, Volume 1. However, the Object Pool is intended to pool objects so that each object is just like every other object. The intent of the Parametric Singleton is to enable others to access the same resource at the same time (as long as the same parameters were used in construction). It sounds like we need a NEW Design Pattern (Oh no, Doug is doing it again!). Yes friends, you got me on a role (roll) :) If you like design patterns, you can thank me later. If you don't like design patterns, blame Dmitry, it was his idea ;) And Dave, thanks for the feedback on Singleton abuse. It has led me to change the way I think about application contexts, which we will see, below. We need (drum roll please): The Parametric Object Pool Design Pattern (POP) By Douglas A. Lyon ABSTRACT The goal of the Parametric Singleton design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values, in a given context. In comparison, the goal of the POP design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values and that only one reference to the class is checked out at a time, in a given context. A context is a namespace for holding identifiers during execution. In Java, A context can be changed in any of several ways. For example, creation of a new class loader, the deserialization of an old POP or the creation of a new process all create a new namespace. The POP Design Pattern combines the Parametric Singleton Design Pattern with the check out mechanism of the Object Pool Design Pattern. This enables unique creation of instances of a class. These instances are cached in a table. When a clients asks for an instance with these parameters, the cache is checked. If the instance is not in the cache it is created. If the instance is available, the clients checks out the instance. A reference is left to the clients that checked out the instance. The POP has the role of creating objects uniquely, from parameters. It also has the role of keeping track of which clients has checked out a given object. This is just like a library keeping track of who borrowed a book. If a resource is left unavailable in a system, a deadlock can occur. Deadlock debugging is facilitated by mapping a resource to the clients that have checked it out. We apply our POP Design Pattern to the retrieval of serial ports. The goal of our system is to make sure that serial ports are checked out to only one client at a time, and that they be checked back in when the client is done. The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. Users are discouraged from calling this the Parametric Object Oriented Pool (POOP). Introduction The intent of the POP Design Pattern is to ensure that a class has only one instance for a given set of parameter values. It also provides a point of access that is global to a given context. The POP uses the Singleton Design Pattern to ensure that there is only one POP, in the given context. The POP DP is responsible for checking out a reference to a given instance, and keeping track of that instance. The instance is responsible for sharing that instance. POP requires that users of the DP implement an interface that enables a recall facility. Thus, if there is a contention for a consumed resource, the deadlock can be resolved in an orderly fashion. Motivation A system cannot tolerate multiple instances of some classes with identical parameters used by different instances at the same time. For example, you cannot have two instances use the same serial port, at the same time. You cannot have two instances that are trying to listen to the same socket connection. You cannot have two instances writing to the same file structure at the same time. Further, once a serial port is checked out by a client, it is assigned to the client. This is like the spin-lock service provided by the operating system, only in the application layer. Naturally, deadlock will occur if a resource is not released, therefore the client of the resource is tracked. Recalling a resource is required for the POP DP by virtue of the implementation of an interface. The policy on how to break a deadlock (by honoring the recall) is application specific. As the operating system is often thought of as the arbiter of consumed resources (i.e., tape drives, serial ports, etc.) we frequently leave it to an operating system implementation to resolve these contention issues. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on naming conventions (which are not well standardized). The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. The POP Design Pattern can take on the role of the peer method mapper that homogenizes the API for different operating environments. That is, it can wrapper the different locking mechanisms used in different operating systems. POP that is responsible for keeping track of the instances created and the client that has checked them out. The POP Design Pattern is implemented using the Singleton Design Pattern. In Java, the POP implementation is declared final, so that it cannot be subclassed. The class also has a private constructor, so that other classes cannot instance it. The new design pattern is called the POP design pattern and it provides a way to check out and create instances with given parameters. Applicability Use the POP Design Pattern when: 1. There must be exactly one instance of a class with the given parameters in a given context. 2. The instances must be accessible to clients from a well-known access point. 3. The instances are reusable. 4. Only one client can check out an instance at a time. Structure Insert UML diagram here. Participants The POP Clients that need instances 1. The POP defines an instance upon request from a client, if, and only if, the instance does not already exist. 2. The POP returns the instance to the client. 3. The POP is responsible for creating unique instances from given parameters. 4. The POP is responsible to recalling instances from clients. Collaborations Clients obtain a reference to a POP instance only through the singleton design pattern. If the POP instance is left in an improper state (e.g., the serial port was left open) it is NOT the role of the POP to close the IO port. However, the POP can be requested to get the instance released. Nor is it the role of the POP Design Pattern to open the port. That role is delegate to some other part of the system. Further, it is the role of the POP Design Pattern to check out resources. However, it is still possible to have, multiple threads that have multiple references to the same resource at the same time. Checkout and resource requests are MUTEX locked (i.e., synchronized). Consequences The POP Design Pattern has several benefits: 1. Controlled access to parametrically defined instances. Since the POP encapsulates its instances, there is some limited control over how and when clients access it. 2. Reduced name space. The POP pattern avoids global variables that store instances created from the same parameter. Implementation Here are implementation issues to consider when using the POP pattern: 1. Unique mapping of parameters. The POP pattern requires that there be a mean to isomorphically map the parameter space into the instance space and back again. 2. Ensure unique instances. The POP pattern makes unique instances from parameters, and it does so only once. 3. Cache instances for fast retrieval. The POP must be able to look up instances, given some set of parameters, and do so from some data structure. That is, there must be enough space to hold references to all the instances the program will need. Also, a mechanism is needed to look up and retrieve the instances quickly enough to satisfy the clients. Sample Code To be written....any volunteers? Thanks! - Doug >I don't think I get it > >On Mar 22, 2006, at 9:36 AM, David Garnier wrote: >>Using the singleton pattern in this case is >>just convenient for the programmer. Problems >>arises >>pretty quickly, especially if you attempt to unit-test your classes. > > >so you're saying that something isn't so good >because you can not test it in the convenient >way? >if that's true, I'm totally disagree >change your test, debug whatever, but if >software is efficient at runtime, works fine and >only problem is some unit test >(which is some kind of framework for testing) >then dump that unit test , dump that unit >framework and make something appropriate to the >software >you're testing > >so if Douglas want to use singletons, what's the problem? >and what do you mean by abusing of singleton usage? > >of course singleton doesn't prevent concurrent >access to the resource across the processes >unless >you're using some OS facility to prevent it, besides >singleton as it was introduced is relevant only >and only inside of the same process >otherwise it's not singleton it's something else >(let's say network singleton: so you have remote >invocation facility >and some factory method that return object created by that facility) > >I don't have any problem with using any kind of singletons. > Parametric Singleton idea (if I understand it >right) could be easily implemented in the >following way: >use a map >populate map with instances of some class and key is your parameter >(you can use lazy population too) > >if somebody ask the key check the value if it's null so resource is taken >if somebody returns the resource put it back to the map > >public synchronized static Object getSomeResource(Object parameter); >public synchronized static void returnResource(Object parameter); > >getSomeResource (inside of the same process) could return null in 2 cases >1. if somebody (from other thread for example) already took that resource >2. if OS API said that resource corresponded to >that parameter (serial port with parameter = 1 >(port #)) >is locked and unavailable; >I'm not sure that in case of serial ports we >even need those Parametric Singletons >(unless lock checking is a very expensive operation) >just ask the OS about availability of that >resource and if it's available give it away >and then OS will lock it and therefore in next >time somebody ask it just answer that resource >is locked >and return null > >for example system has 2 serial ports available >so I ask getResource("tty"); >or I ask getResource("Bluetooth-Modem"); > >and if OS is ok you can give tty or Bluetooth-Modem or both > >no need for any additional pattern I think > >back to the problem >mac os x doesn't recognize locking via files, so >it handles locking via some API >an instance of the singleton in each process >should recognize that resource is locked >(by using that API) that's all >we don't have to make things more complicate >then they are just because there is some nice >design pattern or nice unit test framework or whatever >keep things simple, make them work fast, don't introduce middle layers >unless you have really good reason to do so > >of course I could be entirely wrong, so sorry about that in advance > >thanks > > >Dmitry Markman > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx >Good day, > >I guess that only a selected few (hi Trent) will be able to answer? >this question, but the answer might be interesting for anyone trying? >to debug or understand the code. > >Apparently the MonitorThread is started and stopped in? >RXTXPort.addEventListener and RXTXPort.removeEventListener. This? >would indicate that (originally?) the MonitorThread is only required? >when there is an EventListener. However the MonitorThread is also? >started in the RXTXPort constructor, which could mean that RXTX won't? >work at all if it isn't there. > >It seems to me, that if anyone would add an event listener and later? >on remove it, he could potentially wreak the port. Because the second? >action would kill the MonitorThread. > > >For the moment I am only trying to understand the role of and idea? >behind the MonitorThread. But of course there is a deeper reason thor? >my question: > >If the MonitorThread needs to exist anyway, it could be the thread? >that cleans up the port (ie calls nativeClose) - this would eliminate? >(a further) problem I am seeing with some USB drivers on Mac OSX.? >(Close blocks (after releasing the tty, but still) in the USB driver? >if the device is "not responding"). > >Greetings, >Joachim > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Sat May 13 10:07:37 2006 From: joachim at buechse.de (Joachim Buechse) Date: Sat, 13 May 2006 18:07:37 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Douglas, Looking at the current code, leaves me with the feeling, that there is a lot to do. Defining an API that wraps javax.comm to provide what you describe is certainly possible, but I wonder how much benefit it will actually provide. Personally I think the API defined by javax.comm "request/lock" a port with: cp= new CommunicationPort(identifier) "release" a port with: cp.close(); works quite nice for 99% of the applications. In my experience, the most efficient and elegant implementation is to wrap a port/socket/.. into a business object which declares the remote operations that are possible. Ie "uploadFile", "waitForPrompt", "getSerialNumber", "sendContact", "executeCommand", etc Those methods are then either synchronized or guarded by a monitor. I do not see how your design pattern applied to the port resource would help implementing this. [details start, skip if you agree to the above] When I talked about "thread-safe" I didn't mean several independent "sessions" accessing the port concurrently. I think this is a very rare usage. I believe the most common use case for serial ports today is the control of an external device from a PC running a GUI based application. To implement a clean Swing/AWT-GUI one needs to pass any action that can block to a "worker" thread (else the GUI blocks, the application appears dead). While it is possible to use own prespawned thread that will accept Runnables which operate on the port, this is not very elegant. It is more common to spawn a new thread for every action triggered by the user. Additionally the ABORT of a running operation is often implemented via a port.close() delegated to a different thread. - During the lifetime of a port, it will usually be accessed from several different threads. Instance variables need to be set/read in synchronized regions to guarantee a correct operation based on the Java memory model. - Synchronizing the access is usually handled on the application level (synchronizing the reads/writes is usually useless from the applications view because it is not a transaction mechanism). [details end] I am very open to learn about other scenarios where your proposed design pattern applied to the port resource is beneficial to the application implementor. Best regards, Joachim On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > Dmitry suggests that we acquire an implementation of > a serial port reference, use it, then release it (i.e., check it > back in). > > Joachim says that making serial ports thread friendly might be a > good idea. > > This is a good idea. The design pattern that is close to this idea > is the "Object Pool Design Pattern". > # Object Pool From jredman at ergotech.com Sun May 14 14:28:24 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 14:28:24 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers Message-ID: <446792E8.4000506@ergotech.com> Does anyone know of any work to make RXTX work with Ethernet (telent) Terminal Servers? If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? We've used RXTX with upwards of 100 virtual COM ports on Windows and it works well. Linux is more problematic. It would be good to have an OS independent solution to accesses remote Ethernet serial ports. Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From legolas.w at gmail.com Sun May 14 14:26:34 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:56:34 +0430 Subject: [Rxtx] does any one have a working sample of RXTX and LPT port Message-ID: <4467927A.4000008@gmail.com> Hi Thank you for reading my post does any one has a working sample for RXTX and LPT port ? Thanks From legolas.w at gmail.com Sun May 14 14:27:29 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:57:29 +0430 Subject: [Rxtx] does RXTX support Trigerr on parallel port? Message-ID: <446792B1.4040905@gmail.com> Hi does RXTX support trigger on LPT port ? if so , how i can use it ? Thanks From tjarvi at qbang.org Sun May 14 17:40:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 17:40:59 -0600 (MDT) Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: <446792E8.4000506@ergotech.com> References: <446792E8.4000506@ergotech.com> Message-ID: On Sun, 14 May 2006, Jim Redman wrote: > Does anyone know of any work to make RXTX work with Ethernet (telent) > Terminal Servers? > > If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 > Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? > Hi Jim It appears the author of NVTCom has decided to release the library into the public domain. Integration with rxtx is possible but it would be best to contact the author and find out what his intent is. I would suggest contacting the author with a proposal of what you would like to do and take it from there. We could 'take' public domain software but its better to show respect to the authors and respect their wishes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:10:23 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:10:23 -0600 (MDT) Subject: [Rxtx] does any one have a working sample of RXTX and LPT port In-Reply-To: <4467927A.4000008@gmail.com> References: <4467927A.4000008@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > Thank you for reading my post > does any one has a working sample for RXTX and LPT port ? > Thanks Hi Legolas LPT port support in rxtx is spotty. That means some people have sent in patches for what they do and it works well for them. The original code was not very good. It may have been 3 hours work :/ To get started, Sun has some demo programs with their commapi. With rxtx 2.1 you can change their code from using javax.com to gnu.io and it -should- work. But if it does not you can post here and on bugzilla. There has been more interest lately off the list and maybe there will be enough community resources to get what you need going. If you do get a sample program together, we would gladly put it in the contrib directory so the next person can get things going faster. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:12:12 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:12:12 -0600 (MDT) Subject: [Rxtx] does RXTX support Trigerr on parallel port? In-Reply-To: <446792B1.4040905@gmail.com> References: <446792B1.4040905@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > does RXTX support trigger on LPT port ? > if so , how i can use it ? > Hi Legolas As mentioned in the previous post, rxtx parallel support is not very mature. But if you can point to something that describes the trigger feature, we can probably make sure its there and give a quick code example. -- Trent Jarvi tjarvi at qbang.org From jredman at ergotech.com Sun May 14 22:22:48 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 22:22:48 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: References: <446792E8.4000506@ergotech.com> Message-ID: <44680218.4080008@ergotech.com> Trent, Trent Jarvi wrote: > On Sun, 14 May 2006, Jim Redman wrote: > >> Does anyone know of any work to make RXTX work with Ethernet (telent) >> Terminal Servers? >> >> If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 >> Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? >> > > Hi Jim > > It appears the author of NVTCom has decided to release the library into > the public domain. Integration with rxtx is possible but it would be best > to contact the author and find out what his intent is. > > I would suggest contacting the author with a proposal of what you would > like to do and take it from there. We could 'take' public domain software > but its better to show respect to the authors and respect their wishes. > I sent Marco(?), the author of the library, a note before asking the list - I'll let you know the response. If anyone is already working on it, or has an interest and more time and energy than me, I'd hate to duplicate the efforts. If no one is, and no one objects, maybe I'll see what I can do. Jim > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From Christian.Klemke at t-online.de Mon May 15 02:23:06 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Mon, 15 May 2006 10:23:06 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu><004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: <008a01c677f8$cae18590$02fea8c0@NB600> Hi Trent, Hi Paul, I finally found some time to create a simple patch to enable the optional suppression of version output to the console. It is based on a new system property called "gnu.io.rxtx.NoVersionOutput" which can by set to "true" if necessary. I had some problems accessing CVS, therefore I downloaded the rxtx-2.1-7r2 source archive from ftp.qbang.org (which is linked on the rxtx.org download page) and worked with that release. Please find my proposed patch in the attachment ! Regards, Christian ----- Original Message ----- From: "Trent Jarvi" To: "RXTX Developers and Users" Cc: ""Paul Gettings"" Sent: Friday, May 05, 2006 2:09 PM Subject: Re: [Rxtx] RXTX causing stdout messages > On Fri, 5 May 2006, Christian Klemke wrote: > >> Hi Paul, >> >> I was wondering about the same question some days ago and took a look at >> the >> source files. Unfortunately, I found that you can only get rid of that >> messages by altering and recompiling the Java code. There is a final >> static >> boolean variable called "devel" in the file "RXTXCommDriver.java" which >> is >> set to "true". This constellation causes the output after the native >> libraries have been loaded. No mechanism exists to suppress them >> otherwise >> :-(. >> >> Trent, does that mean that 2.1.7 is still officially a "development" >> version >> ? When will this value be changed to "false" by default ? With 2.1.8 ? It >> would be nice to provide a means to suppress such messages besides that >> static flag (maybe by setting a property called >> "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The >> output can indeed by annoying, especially when used with console >> applications, where the message potentially appears "in the middle" of >> your >> own output. Another possibility would be not to use System.out directly, >> but >> instead some PrintStream field which is initially set to System.out but >> can >> programatically be changed. That would allow for any kind of redirection >> or >> suppression by implementing appropriate user-defined PrintStream >> subclasses >> and making RXTX use that stream. What do you think ? >> > > A patch for using properties would be accepted I'm sure. > > The reason the default is to display the message is not related to the > development state of rxtx anymore. The problem is that people first using > rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. > The message prevents a great deal of email thats easily explained by the > message. > > I question if we should support rxtx 2.0 at all anymore. > > If you post a patch in bugzilla, we'll put it into CVS this weekend. > we'll be going through and doing such things anyhow. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_version_output_patch.diff Type: application/octet-stream Size: 991 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060515/3173c2b6/rxtx_version_output_patch-0001.obj From lyon at docjava.com Mon May 15 06:06:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 May 2006 08:06:21 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Joachim makes several good points. Let me see if I can address some of them below: >Hello Douglas, > >Looking at the current code, leaves me with the feeling, that there? >is a lot to do. Yes! >Defining an API that wraps javax.comm to provide what? >you describe is certainly possible, but I wonder how much benefit it? >will actually provide. > >Personally I think the API defined by javax.comm > >"request/lock" a port with: > cp= new CommunicationPort(identifier) >"release" a port with: > cp.close(); > >works quite nice for 99% of the applications. I don't know what percentage of applications turn off locking, the way that I do in my version of the RXTX lib. I do know that this is not safe practice. I also know that it was motivated by the multi-platform nature of my code and that this was the only way I could make things work, at the time. Java does not appear to have a cross-platform standard for locking resources on various platforms. Each OS appears to have its own standard. The question of who breaks deadlocks and how this is done remains open, as this is not an easy question to resolve. Let me continue, below: > >In my experience, the most efficient and elegant implementation is to? >wrap a port/socket/.. into a business object which declares the? >remote operations that are possible. Ie "uploadFile",? >"waitForPrompt", "getSerialNumber", "sendContact", "executeCommand",? >etc Those methods are then either synchronized or guarded by a? >monitor. I do not see how your design pattern applied to the port? >resource would help implementing this. I have no problem with high-level wrappers that are application specific. That is a very good idea, but orthogonal with respect to the issue of deadlocks. More below: > >[details start, skip if you agree to the above] >When I talked about "thread-safe" I didn't mean several independent? >"sessions" accessing the port concurrently. I think this is a very? >rare usage. That is probably why turning locking off works so well! On the other hand, it is not safe and I shouldn't do it. >I believe the most common use case for serial ports today? >is the control of an external device from a PC running a GUI based? >application. To implement a clean Swing/AWT-GUI one needs to pass any? >action that can block to a "worker" thread (else the GUI blocks, the? >application appears dead). While it is possible to use own prespawned? >thread that will accept Runnables which operate on the port, this is? >not very elegant. It is more common to spawn a new thread for every? >action triggered by the user. Additionally the ABORT of a running? >operation is often implemented via a port.close() delegated to a? >different thread. Here lies the heart of serial port concern. An application opens a serial port and then dies. The application is restarted and finds the port locked. How do we clear the lock? Must the application's user reside in the UUCP group? Must installers of the serial port add users to the UUCP group? Should locking be handled at a high-level of abstraction in an operating system independent way? Should the implementation of the locking mechanism be translated into an API that is dependent on the OS convention? Suppose that we restrict the discussion to serial ports. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on inconsistent naming conventions. Hence my feeling that we need to mirror what is done in other API's; we need a locking toolkit that references peer methods, IMHO. >From the Java programming point of view, the locking API is portable across different platforms, but has, as its implementation, a native peer method that uses the conventions of the underlying OS. This enables portable resource locking (in theory!). Consider, for example: org.apache.commons.transaction.locking with: Interface LockManager at: http://jakarta.apache.org/commons/transaction/apidocs/org/apache/commons/transaction/locking/LockManager.html Or, more recently: java.util.concurrent.locks Interface Lock based on Doug Lea's code: http://kickjava.com/src/EDU/oswego/cs/dl/util/concurrent/ReadWriteLock.java.htm Should we incorporate a clean, portable design into serial port use, one that is consistent with current locking APIs? Basically, a comm port is a resource and resources are typically controlled by managers. Thus, I suggest that we make use of a CommPortManager to help control and centralize serial port usage. The question of how this is done remains open, IMHO, but using core API's like: java.util.concurrent.locks might not be amiss. High-level methods (getAllPorts, getAllSerialPorts, getAllParallelPorts, etc...) might be welcome additions. Basic questions like, "what if a port is in use?" remain open, hence my proposal for the new design pattern. Isn't it the CommPortManager's role to break the deadlock? Cheers! - Doug > >- During the lifetime of a port, it will usually be accessed from? >several different threads. Instance variables need to be set/read in? >synchronized regions to guarantee a correct operation based on the? >Java memory model. >- Synchronizing the access is usually handled on the application? >level (synchronizing the reads/writes is usually useless from the? >applications view because it is not a transaction mechanism). >[details end] > >I am very open to learn about other scenarios where your proposed? >design pattern applied to the port resource is beneficial to the? >application implementor. > >Best regards, >Joachim > >On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > >> Dmitry suggests that we acquire an implementation of >> a serial port reference, use it, then release it (i.e., check it? >> back in). >> > > Joachim says that making serial ports thread friendly might be a? >> good idea. >> >> This is a good idea. The design pattern that is close to this idea >> is the "Object Pool Design Pattern". >> # Object Pool > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Mon May 15 06:58:19 2006 From: joachim at buechse.de (Joachim Buechse) Date: Mon, 15 May 2006 14:58:19 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Doug, I agree fully, that locking of the system resource should be abstracted from the user (programmer). Currently this is already the case, but I agree it might be nice to extract the code into a separate class, which uses platform dependent providers to do its job. What I described in my email was not targeted at allocating the system resource, but at handling an already allocated system resource inside the framework. I agree that it may be possible to combine the two - however, I would suggest to do this in phase2. I can contribute a work over of RXTXPort.java which implements clean internal locking and proper close behavior (which I would call phase 1). I could do this this week. However I strongly believe that there is little sense in trying to do this as a series of patches. It will be closer to a rewrite than to a patch. I have already provided a number of suggested patches via Bugzilla, but this is quite inconvenient (for me). My working copy diverges more and more from the master and hence it gets more and more annoying to provide self contained patches. Best regards, Joachim From tjarvi at qbang.org Mon May 15 08:27:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 May 2006 08:27:51 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Mon, 15 May 2006, Joachim Buechse wrote: > Hello Doug, > > I agree fully, that locking of the system resource should be > abstracted from the user (programmer). Currently this is already the > case, but I agree it might be nice to extract the code into a > separate class, which uses platform dependent providers to do its job. > > What I described in my email was not targeted at allocating the > system resource, but at handling an already allocated system resource > inside the framework. I agree that it may be possible to combine the > two - however, I would suggest to do this in phase2. > > I can contribute a work over of RXTXPort.java which implements clean > internal locking and proper close behavior (which I would call phase > 1). I could do this this week. > > However I strongly believe that there is little sense in trying to do > this as a series of patches. It will be closer to a rewrite than to a > patch. I have already provided a number of suggested patches via > Bugzilla, but this is quite inconvenient (for me). My working copy > diverges more and more from the master and hence it gets more and > more annoying to provide self contained patches. > For methodical testing purposes (which does go on) the incremental patches are better. I'm lagging behind in bugzilla but thats soon to change (this week). It has just been rather chaotic up until now. I moved, purchased a house, and jumped into the fire of a feature freeze timeframe at a new job. btw, we see the Solaris close issues on 2.8 also. 9 and 10 are fine. I'll work towards making those test results public and allow others to run new rxtx code through them. We had the OK at one point but setting up the environment is involved. It isn't just a collection of java classes. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Tue May 16 02:01:47 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:01:47 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] Message-ID: <446986EB.209@willicon.de> Hi, any ideas for my problem? Hans -------- Original-Nachricht -------- Betreff: [Rxtx] Problem under Mac OSX 10.3.9 Datum: Mon, 08 May 2006 18:47:20 +0200 Von: WILLICon Antwort an: RXTX Developers and Users An: RXTX Developers and Users Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/b0741c2b/attachment-0001.html From joachim at buechse.de Tue May 16 02:15:08 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 10:15:08 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: Hello Hans, I am using RXTX on OS X for my own project. I do not see the problem you describe. I had some troubles installing it because the current version uses lock files which is non-standard on OS X. I have created a patched version which I currently use. This version does not need to modify user groups and hence does not need an installer. I just pop it in the application directory. If you send me a link where I can download your OSX installer, I will have a quick look. Regards, Joachim On 16.05.2006, at 10:01, WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we > have some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + > spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + > spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always > the value "false". > I can only get the status, while I open the port and catch the > exception. > > Any ideas? > > Hans > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail at willicon.de Tue May 16 02:26:53 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:26:53 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: References: <446986EB.209@willicon.de> Message-ID: <44698CCD.7050709@willicon.de> Joachim, tanks for the answer. I'll send You a mail. Hans Joachim Buechse schrieb: > Hello Hans, > > I am using RXTX on OS X for my own project. I do not see the problem > you describe. > > I had some troubles installing it because the current version uses > lock files which is non-standard on OS X. I have created a patched > version which I currently use. This version does not need to modify > user groups and hence does not need an installer. I just pop it in > the application directory. If you send me a link where I can download > your OSX installer, I will have a quick look. > > Regards, > Joachim > > On 16.05.2006, at 10:01, WILLICon wrote: > > >> Hi, >> >> any ideas for my problem? >> >> Hans >> >> -------- Original-Nachricht -------- >> Betreff: [Rxtx] Problem under Mac OSX 10.3.9 >> Datum: Mon, 08 May 2006 18:47:20 +0200 >> Von: WILLICon >> Antwort an: RXTX Developers and Users >> An: RXTX Developers and Users >> >> >> Hi, >> >> I use for RXTX for communicate with CyclingComputers. >> >> It works good under Win32, Sloaris and Linux but with Mac OSX we >> have some problems. >> >> My users install the Mac OSX serial lib from the actual binary. >> >> After starting the program, they get this error message: >> >> java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while >> loading gnu.io.RXTXCommDriver >> >> Remember, this error comes only under Mac OSX. >> >> That is the code for the error: >> >> Enumeration portList = CommPortIdentifier.getPortIdentifiers(); >> spInUse = getBundleStr("serialPortInUse"); >> spFree = getBundleStr("serialPortFree"); >> while (portList.hasMoreElements()) { >> CommPortIdentifier portId = (CommPortIdentifier) >> portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (osName != null && osName.startsWith("mac")) { >> if (!portId.getName().startsWith("dev/cu.")) { >> continue; >> } >> } >> if (portId.isCurrentlyOwned()) { >> serialPortNames.add(portId.getName() + " - " + >> spInUse); >> } >> else { >> serialPortNames.add(portId.getName() + " - " + >> spFree); >> } >> } >> } >> if (serialPortNames.size() == 0) { >> serialPortNames.add(getBundleStr("serialPortNotFound")); >> } >> >> BTW: The methode isCurrentlyOwned() is not working. I get always >> the value "false". >> I can only get the status, while I open the port and catch the >> exception. >> >> Any ideas? >> >> Hans >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/948333be/attachment-0001.html From jredman at ergotech.com Tue May 16 07:35:52 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 16 May 2006 07:35:52 -0600 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: <4469D538.6070408@ergotech.com> Hans, I have no direct insight, but would note that what you have is a "NoClassDefFoundError" not a "ClassNotFoundException". So the class javax/comm/CommDriver is found, but one of its dependencies is missing. NoClassDefFoundError are a bigger problem to resolve because you get no indication of the real problem. Jim WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we have > some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > * spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always the > value "false". > I can only get the status, while I open the port and catch the exception. > > Any ideas? > > Hans > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.de Tue May 16 08:01:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 16:01:21 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 In-Reply-To: <4469AFC3.6000002@willicon.de> References: <44698EBC.8000008@willicon.de> <8C5680C4-E2BA-42FF-B221-36E1124FA6A4@buechse.de> <4469AFC3.6000002@willicon.de> Message-ID: <9825A602-D6ED-4C28-BF33-9A7C984FACD5@buechse.de> Hallo Hans, you include RXTX 2.17 in your "bikeXexperience.jar" (2.17 uses Interfaces from gnu.io.* not javax.comm.*). Now inspect your error log closely: The class gnu.io.RXTXCommDriver tries to load javax.comm.CommDriver: this is only the case for RXTX 2.07. I assume, that the user has installed Version 2.07 into one of the java.ext.dirs . The VM always tries to load classes from the "system" path first. The current Mac installer distributed with RXTX in fact installs RXTXcomm.jar and librxtxSerial.jnilib into /Library/Java/Extensions. (I wrote some time ago that I consider this as a bad idea because of potential version conflicts-> thanks for delivering the example). For 2.07 it does so without installing the javax.comm classes it seems. I would recommend that you instruct your users to install version 2.17 only. Until RXTX is changed to use TIOCEXCL instead of lock files, you can hardly avoid the installer, as the user needs to be added to a special group and a lockfile directory needs be created. More precisely you are waiting for: http://bugzilla.qbang.org/show_bug.cgi?id=50 [RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL)] Regards, Joachim -------------- next part -------------- A non-text attachment was scrubbed... Name: log.tiff Type: image/tiff Size: 38394 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/e3e52128/log-0001.tiff -------------- next part -------------- > > Ich verwende RXTX 2.17. Das orginal RXTXcomm.jar ist in > CyclingDataManager.jar enthalten. > From tjarvi at qbang.org Wed May 17 23:18:15 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 May 2006 23:18:15 -0600 (MDT) Subject: [Rxtx] update Message-ID: So we have several patches and these have stacked up. I'd like to thank everyone for being patient. Tests for the most intrusive patches look good so far. I still have to get some bits together on my end but it looks like we can catch everything up in CVS this week. I'll try to post a normal list of what went in by whom with links Saturday. But I'm not seeing anything that raises flags yet. I also think I'll be able to submit a patch for nonstandard baud rates. I have to confirm w32 but I think its going to be a one line fix. I don't know if its bugzilla or people tinkering with patch files before submitting but patches are not applying cleanly. So the patches have to be done by hand. This may make things difficult for people hoping to add other patches on top. I'm trying to make that go well but ... -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Thu May 18 02:23:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 May 2006 10:23:47 +0200 Subject: [Rxtx] update In-Reply-To: References: Message-ID: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Hello Trent, in fact I tinkered with the patches (never used this mechanism before, usually I "communicate" via cvs) ... so sorry for any trouble you had applying them. Basicly I edited the patches to make them self contained. Having the tests run with different speeds on different platforms, may well be an effect of caching. I have seen quite interesting propagation delays for the closing flag on my PowerPC system, which makes me doubt, that the propagation of output_buffer_empty_flag works as it should. Maybe the communication mechanism between the two threads should be replaced by something like pthread_cond_*. Could you describe which problems you see on Solaris/SPARC? I'd be interested to see if they exist on OS X (PowerPC) as well... As you seem to work on the stuff at the moment I would like to suggest the following additions (it looks more than it is, I posted some context to make clear where to apply the change). See the comments in braces for what was changed Greetings, Joachim (1) The end of the drain loop could be: --- report("drain_loop: received EINTR in tcdrain\n"); --- (added "in tcdrain" to make debug output clearer) (2) The start of the drain loop should be: --- for(i=0;;i++) { report_verbose("drain_loop: looping\n"); #if defined(__sun__) /* FIXME: No time to test on all OS's for production */ if( eis->eventloop_interrupted ) { goto end; } if (usleep(5000)) { report("drain_loop: received EINTR"); } #else if (usleep(1000000)) { report("drain_loop: received EINTR"); } #endif /* __sun__ */ --- (added a check for "eis->eventloop_interrupted" before the sleep) (3) The end of interrupt_event_loop could (and maybe should) be: --- #if !defined(TIOCSERGETLSR) && !defined(WIN32) /* make sure that the drainloop unblocks from tcdrain */ pthread_kill(index->drain_tid, SIGABRT); /* TODO use wait/join/SIGCHLD/?? instead of sleep? */ usleep(50 * 1000); /* Under normal conditions, SIGABRT will unblock tcdrain. However a non-responding USB device combined with an unclean driver may still block. This is very ugly because it may block the call to close indefinetly. */ if (index->closing != 1) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); index->closing = 1; } #endif report("interruptEventLoop: interrupted\n"); --- (added some comments and pthread_cancel for resisting drain thread) On 18.05.2006, at 07:18, Trent Jarvi wrote: > > So we have several patches and these have stacked up. I'd like to > thank > everyone for being patient. > > Tests for the most intrusive patches look good so far. I still > have to > get some bits together on my end but it looks like we can catch > everything > up in CVS this week. > > I'll try to post a normal list of what went in by whom with links > Saturday. But I'm not seeing anything that raises flags yet. I also > think I'll be able to submit a patch for nonstandard baud rates. > I have > to confirm w32 but I think its going to be a one line fix. > > I don't know if its bugzilla or people tinkering with patch files > before > submitting but patches are not applying cleanly. So the patches > have to > be done by hand. This may make things difficult for people hoping > to add > other patches on top. I'm trying to make that go well but ... > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu May 18 22:28:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 18 May 2006 22:28:00 -0600 (MDT) Subject: [Rxtx] update In-Reply-To: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> References: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Message-ID: On Thu, 18 May 2006, Joachim Buechse wrote: > Hello Trent, > > in fact I tinkered with the patches (never used this mechanism > before, usually I "communicate" via cvs) ... so sorry for any trouble > you had applying them. Basicly I edited the patches to make them self > contained. I think we are close to moving towards that. > > Having the tests run with different speeds on different platforms, > may well be an effect of caching. I have seen quite interesting > propagation delays for the closing flag on my PowerPC system, which > makes me doubt, that the propagation of output_buffer_empty_flag > works as it should. Maybe the communication mechanism between the two > threads should be replaced by something like pthread_cond_*. Could > you describe which problems you see on Solaris/SPARC? I'd be > interested to see if they exist on OS X (PowerPC) as well... This is interesting. I have seen problems with output buffer empty in applications that require it. I'm trying to get a bug list and or test results open for everyone to see but that may take time. But missed output buffer events ... yep. With Sparc, we have seen a few things. One was a kernel race condition that went away when we reimaged and updated 2.8. RXTX was hanging on close, top showed no cpu use but there was 2 second delays just typing on console. The other is our tests now take ~4 times longer on Solaris. Someone is looking at timing just open, close, read, write, ... to see if they can find where the slowdown is. This happened after solaris 2.8. I'll try to share more when/if there is something interesting. This may well not be solvable in userland. > > As you seem to work on the stuff at the moment I would like to > suggest the following additions (it looks more than it is, I posted > some context to make clear where to apply the change). See the > comments in braces for what was changed I'll take a look. This could all come together Saturday but I also have an event to attend that day. I may not wrap this up until Sunday. -- Trent Jarvi tjarvi at qbang.org From andrewlord at internode.on.net Sun May 21 20:10:02 2006 From: andrewlord at internode.on.net (Andrew Lord) Date: Mon, 22 May 2006 11:40:02 +0930 Subject: [Rxtx] Kernel include files do not match kernel Message-ID: <200605221140.03271.andrewlord@internode.on.net> Hi, I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel 2.6.12-18 with the command: ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include However I get the message: ## checking java.version 1.5.0_06 ## checking os.version 2.6.12-18mdk ## ## WARNING: Kernel include files do not match the current kernel ## ## configure: creating ./config.status etc. Is there a problem with the way I'm specifying the 'include' directory ? If not, how else can I specify the correct directory for the include files please ? Cheers, Andrew From tjarvi at qbang.org Sun May 21 20:31:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 May 2006 20:31:31 -0600 (MDT) Subject: [Rxtx] Kernel include files do not match kernel In-Reply-To: <200605221140.03271.andrewlord@internode.on.net> References: <200605221140.03271.andrewlord@internode.on.net> Message-ID: On Mon, 22 May 2006, Andrew Lord wrote: > Hi, > > I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel > 2.6.12-18 with the command: > > ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk > CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include > > However I get the message: > > ## checking java.version 1.5.0_06 > ## checking os.version 2.6.12-18mdk > ## > ## WARNING: Kernel include files do not match the current kernel > ## > ## configure: creating ./config.status > etc. > > Is there a problem with the way I'm specifying the 'include' directory ? If > not, how else can I specify the correct directory for the include files > please ? > Hi Andrew I'm fairly sure your --with-kernel option does nothing. The CPPFLAGS should do what you want. Maybe put an #error message in /usr/src/linux.../incude/linux/version.h But I don't recall a recent problem with version missmatches. It should work. Distros will even ship include files that don't match versions exactly. In theory it should never matter for users. I used to compile new kernels by hand and really didnt have a distro. I didnt have a seperate package of kernel headers for users (myself). When changing a gateway from linux 1.2.12 to 2.1.77, I would worry about such messages. So if you are doing something that weird, the message may be of use to you. If you just see the message on a distro you installed, it is more than likely harmless. -- Trent Jarvi tjarvi at qbang.org From mrogers at spro.net Mon May 22 14:45:39 2006 From: mrogers at spro.net (Mike Rogers) Date: Mon, 22 May 2006 14:45:39 -0600 Subject: [Rxtx] Sun's CommAPI -- think May? Message-ID: <447222F3.9040302@spro.net> Hi, Any word from Sun about progress towards fixing the Java CommAPI v3 "incompatibilities" so RXTX 2.0 can operate within the framework's namespace (javax.comm)? I recall mention of a May time frame. Thanks, Mike From paul.klissner at sun.com Mon May 22 15:09:27 2006 From: paul.klissner at sun.com (Paul Klissner) Date: Mon, 22 May 2006 14:09:27 -0700 Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <447222F3.9040302@spro.net> References: <447222F3.9040302@spro.net> Message-ID: <44722887.8080308@sun.com> Mike Rogers wrote: > Hi, > > Any word from Sun about progress towards fixing the Java CommAPI v3 > "incompatibilities" so RXTX 2.0 can operate within the framework's > namespace (javax.comm)? I recall mention of a May time frame. > > Thanks, > > Mike > We've had a lot of work come in. This hasn't been the only priority. I'm running behind the plan in addressing this, but will be looking at it again soon. Rather than state a new, I'll just say it is in progress, and not off the table. I'll get this fixed as soon as I can. Good timing for asking as we just started discussing javax.comm plans today, and I'll have some cycles to work on it soon. Paul From yhua537 at cse.unsw.edu.au Mon May 22 16:03:05 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Tue, 23 May 2006 08:03:05 +1000 (EST) Subject: [Rxtx] install rxtx in XP Message-ID: Hi Guys, I am new to serial port programming, and have no experience on programming java in xp, but my project require me to builld a communication link between xp and a UART device. Most of the information in the web site seems for linux only. including the commands such as export and chmod. How do I install rxtx in xp? cheers YiQi Huang From mark at mdsh.com Tue May 23 01:24:20 2006 From: mark at mdsh.com (Mark Himsley) Date: Tue, 23 May 2006 08:24:20 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off , it includes DLLs for Windows and the JAR for Java. Follow the Windows instructions in the INSTALL. ie RXTXcomm.jar goes in \jre\lib\ext (under java) rxtxSerial.dll goes in \jre\bin So, assuming a fairly standard Java install, copy RXTXcomm.jar into C:\Program Files\Java\jre1.5.0_06\lib\ext and copy rxtxSerial.dll into C:\Program Files\Java\jre1.5.0_06\bin Yes, it really is that simple. On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > I am new to serial port programming, and have no experience on > programming java in xp, but my project require me to builld a > communication link between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang -- Mark Himsley From joachim at buechse.de Tue May 23 02:51:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 23 May 2006 10:51:47 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) Unless it is absolutely required you should NOT install RXTX in your global Java Runtime Environment. This will for sure create versioning conflicts - if not now, than in the future, if not on your system than at your clients. Instead put the dll in your application directory and include the RXTXcomm.jar in your classpath. This is much safer and not a bit more complicated. Regards, Joachim On 23.05.2006, at 09:24, Mark Himsley wrote: > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR > for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > >> I am new to serial port programming, and have no experience on >> programming java in xp, but my project require me to builld a >> communication link between xp and a UART device. >> >> Most of the information in the web site seems for linux only. >> including >> the commands such as export and chmod. How do I install rxtx in xp? >> >> cheers >> YiQi Huang > > > > -- > Mark Himsley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tod at todbot.com Tue May 23 03:12:22 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 02:12:22 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I totally agree: do not contaminate the Java installation. I put all the RXTX files in a directory and then change my java invocation to be: % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* Alternatively, use Launch4J to create a double-clickable application and keep the RXTX libraries in the directory of the application. -=tod On May 23, 2006, at 1:51 AM, Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > >> Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off >> , it includes DLLs for Windows and the JAR >> for Java. >> >> Follow the Windows instructions in the INSTALL. >> >> ie >> >> RXTXcomm.jar goes in \jre\lib\ext (under java) >> rxtxSerial.dll goes in \jre\bin >> >> So, assuming a fairly standard Java install, copy RXTXcomm.jar into >> C:\Program Files\Java\jre1.5.0_06\lib\ext >> and copy rxtxSerial.dll into >> C:\Program Files\Java\jre1.5.0_06\bin >> >> Yes, it really is that simple. >> >> >> >> On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: >> >>> I am new to serial port programming, and have no experience on >>> programming java in xp, but my project require me to builld a >>> communication link between xp and a UART device. >>> >>> Most of the information in the web site seems for linux only. >>> including >>> the commands such as export and chmod. How do I install rxtx in xp? >>> >>> cheers >>> YiQi Huang >> >> >> >> -- >> Mark Himsley >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From smontgomery at mediaspansoftware.com Tue May 23 08:46:53 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Tue, 23 May 2006 10:46:53 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: Message-ID: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Joachim and Tod mentioned how to keep the files RXTX requires on Windows XP out of the Java installations - thanks gentlemen! Are there similar suggestions for an RXTX install on OS X? The current "canonical" OS X installation instructions "contaminate the Java installation", to use Tod's words. Our app will run fine under 1.4.2 and 5.0 on OS X, and a lot of users will have both. We've already been burned by the recent switch from 1.4.2 to 5.0 as the platform default. Any suggestions welcomed. From tod at todbot.com Tue May 23 13:27:55 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 12:27:55 -0700 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <9BA0F670-A862-42E7-BB2C-130D775ABDF9@todbot.com> Hi Sean, It depends on how you build and deploy your code. If you're using shell scripts, you can do something like this: #!/bin/sh # pick one JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/ Commands/java #JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/ Commands/java $JAVA -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* That both picks which VM to use and uses the RXTX in the directory called 'rxtxlib'. If you want your shell script to be clever, you could test for the existence of the different 'java' executables and go from there (maybe even use different jar files). I am almost positive all OS X systems with Java 1.5 are guaranteed to also have Java 1.4.2. If you're using Jar Builder or XCode, you can specify which JVM to use and add the extra args in the Info.plist file. The paths specified in the 'java' invocation then are based off of the $JAVAROOT variable that the JavaApplicationStub sets for you. For my app, I've have been compiling two sets of jars, one compiled with 1.4.2 and one with 1.5, but they both run under 1.5. So I have a similar shell script that chooses a different 'javac' depending on the need. -=tod On May 23, 2006, at 7:46 AM, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From yhua537 at cse.unsw.edu.au Tue May 23 11:09:37 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 03:09:37 +1000 (EST) Subject: [Rxtx] install rxtx in XP (Mark Himsley, Joachim Buechse, Tod E. Kurt> In-Reply-To: References: Message-ID: > Message: 8 > Date: Tue, 23 May 2006 08:03:05 +1000 (EST) > From: YiQi Huang > Subject: [Rxtx] install rxtx in XP > To: rxtx at qbang.org > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > Hi Guys, > > I am new to serial port programming, and have no experience on programming > java in xp, but my project require me to builld a communication link > between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang > > > ------------------------------ > > Message: 9 > Date: Tue, 23 May 2006 08:24:20 +0100 > From: Mark Himsley > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=us-ascii; format=flowed > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > ------------------------------ > > Message: 10 > Date: Tue, 23 May 2006 10:51:47 +0200 > From: Joachim Buechse > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > > ------------------------------ > > Message: 11 > Date: Tue, 23 May 2006 02:12:22 -0700 > From: "Tod E. Kurt" > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I totally agree: do not contaminate the Java installation. > > I put all the RXTX files in a directory and then change my java > invocation to be: > > % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* > > Alternatively, use Launch4J to create a double-clickable application > and keep the RXTX libraries in the directory of the application. > > -=tod > > Hi, Thanks guys, I don't know if this is the correct way to reply your mecessage, if wrong, please point out. Thank you for Mark to give the detail instructions and Joachim to point out the cons ot installing in the java directory, and specially thanks for Tod to give the instrection in detail. Sorry to ask another stupid question: I have followed Tod's instruction. Now I think i am ready to start hacking. But where is the RXTX API documentation? Is it the same as using normal java comm API? btw, where could i find some examples to start with? Thanks very much cheers YiQi Huang From tjarvi at qbang.org Tue May 23 16:09:32 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 May 2006 16:09:32 -0600 (MDT) Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <44722887.8080308@sun.com> References: <447222F3.9040302@spro.net> <44722887.8080308@sun.com> Message-ID: > Good timing for asking as we just started discussing javax.comm plans > today, and I'll have some cycles to work on it soon. Hi Paul I assume you mean Sun is discussing plans concerning its own internal actions and there is no community involvment at this point. -- Trent Jarvi tjarvi at qbang.org From yhua537 at cse.unsw.edu.au Tue May 23 22:50:01 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 14:50:01 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } From mmester at sps.edu Tue May 23 22:58:21 2006 From: mmester at sps.edu (Michael Mester) Date: Wed, 24 May 2006 00:58:21 -0400 Subject: [Rxtx] install rxtx in XP References: Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below -----Original Message----- From: rxtx-bounces at qbang.org on behalf of YiQi Huang Sent: Wed 5/24/2006 12:50 AM To: RXTX Developers and Users Subject: Re: [Rxtx] install rxtx in XP Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3950 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060523/b36d0c63/attachment-0001.bin From yhua537 at cse.unsw.edu.au Tue May 23 23:05:50 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 15:05:50 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: Yes, Michael you are right, it should be semicolons, But it still can't find the correct library. On Wed, 24 May 2006, Michael Mester wrote: > I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below > > > -----Original Message----- > From: rxtx-bounces at qbang.org on behalf of YiQi Huang > Sent: Wed 5/24/2006 12:50 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] install rxtx in XP > > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > cheers YiQi Huang From tod at todbot.com Wed May 24 00:01:57 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 23:01:57 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Yes, sorry, classpath entries are semicolon-separated on Windows and colon-separated on everything else. Your example code below is importing the wrong set of classes. It should not "import javax.comm.*", instead it should "import gnu.io.*". When I make that change, your example program compiles. The "javax.comm" package is the one released by Sun, the "gnu.io" package is the RXTX one. You might've seen some discussion that the two will be merged or become compatible, but that hasn't happened yet. -=tod On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > > Yes, Michael you are right, it should be semicolons, But it still > can't > find the correct library. > > On Wed, 24 May 2006, Michael Mester wrote: > >> I believe the entries in the classpath need to be seperated with >> semicolons, not a colon as you have in your command below >> >> >> -----Original Message----- >> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >> Sent: Wed 5/24/2006 12:50 AM >> To: RXTX Developers and Users >> Subject: Re: [Rxtx] install rxtx in XP >> >> Hi, >> >> Sorry guys.I follow Tod's instruction, and here is what i did: >> >> put >> RXTXcomm.jar, >> rxtxParallel.dll, >> rxtxSerial.dll >> in >> C:\RXTX_files >> >> and I got a SimpleRead class attached below, compile it with : >> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >> it still saying "cannot find symbol". >> >> Is there anything I did wrong? Do I need the comm.jar from Sun? >> >> Thanks & regards >> YiQi Huang >> >> >> //////////////////////////////////////////////////////// >> // SimpleRead.java >> //////////////////////////////////////////////////////// >> >> import java.io.*; >> import java.util.*; >> import javax.comm.*; >> >> public class SimpleRead >> implements Runnable, SerialPortEventListener { >> static CommPortIdentifier portId; >> static Enumeration portList; >> InputStream inputStream; >> SerialPort serialPort; >> Thread readThread; >> public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == >> CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals("COM1")) { >> //if (portId.getName().equals("/dev/term/a")) { >> SimpleRead reader = new SimpleRead(); >> } >> } >> } >> } >> public SimpleRead() { >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", >> 2000); >> } catch (PortInUseException e) {} >> try { >> inputStream = serialPort.getInputStream(); >> } catch (IOException e) {} >> try { >> serialPort.addEventListener(this); >> } catch (TooManyListenersException e) {} >> serialPort.notifyOnDataAvailable(true); >> try { >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } catch (UnsupportedCommOperationException e) {} >> readThread = new Thread(this); >> readThread.start(); >> } >> public void run() { >> try { >> Thread.sleep(20000); >> } catch (InterruptedException e) {} >> } >> public void serialEvent(SerialPortEvent event) { >> switch(event.getEventType()) { >> case SerialPortEvent.BI: >> case SerialPortEvent.OE: >> case SerialPortEvent.FE: >> case SerialPortEvent.PE: >> case SerialPortEvent.CD: >> case SerialPortEvent.CTS: >> case SerialPortEvent.DSR: >> case SerialPortEvent.RI: >> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >> break; >> case SerialPortEvent.DATA_AVAILABLE: >> byte[] readBuffer = new byte[20]; >> try { >> while (inputStream.available() > 0) { >> int numBytes = inputStream.read(readBuffer); >> } >> System.out.print(new String(readBuffer)); >> } catch (IOException e) {} >> break; >> } >> } >> } >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > cheers > YiQi Huang > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From joachim at buechse.de Wed May 24 00:10:06 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:10:06 +0200 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Hi Sean, my preferred way of dealing with RXTX on OS X is to include the RXTX classes into my application jar and to put the RXTX lib in the same directory as this jar. To make it even more comfortable, you can include the lib in the jar and have some startup code extract it and write it to a temporary file from which you load it with System.load(). Unfortunately the current version of RXTX for OS X requires tinkering with user groups as it is based on lockfiles - and hence it needs the RXTX OS X installer or you need to duplicated this functionality in your own installer. I have created my own native version which is not based on lockfiles but tty locking (the standard way to do it on OSX). I hope that these patches will be integrated soon into the distribution. Regards, Joachim On 23.05.2006, at 16:46, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Wed May 24 00:16:12 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:16:12 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <7017ECFC-B13E-4806-B321-9FFCAC5830F0@buechse.de> I assume you downloaded rxtx-217 (not 207). Instead of importing javax.comm.* you must import gnu.io.* The classes have the same name, but they are not in the same package. On 24.05.2006, at 06:50, YiQi Huang wrote: > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From yhua537 at cse.unsw.edu.au Wed May 24 00:17:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 16:17:45 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Message-ID: Thanks Tod again, i kept reading "gnu.io.*" as "gun.io.*" last few hours after i read some commons from web. Thanks very much Tod. thanks YiQi Huang On Tue, 23 May 2006, Tod E. Kurt wrote: > Yes, sorry, classpath entries are semicolon-separated on Windows and > colon-separated on everything else. > > Your example code below is importing the wrong set of classes. It > should not "import javax.comm.*", instead it should "import > gnu.io.*". When I make that change, your example program compiles. > The "javax.comm" package is the one released by Sun, the "gnu.io" > package is the RXTX one. You might've seen some discussion that the > two will be merged or become compatible, but that hasn't happened yet. > > -=tod > > > On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > >> >> Yes, Michael you are right, it should be semicolons, But it still >> can't >> find the correct library. >> >> On Wed, 24 May 2006, Michael Mester wrote: >> >>> I believe the entries in the classpath need to be seperated with >>> semicolons, not a colon as you have in your command below >>> >>> >>> -----Original Message----- >>> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >>> Sent: Wed 5/24/2006 12:50 AM >>> To: RXTX Developers and Users >>> Subject: Re: [Rxtx] install rxtx in XP >>> >>> Hi, >>> >>> Sorry guys.I follow Tod's instruction, and here is what i did: >>> >>> put >>> RXTXcomm.jar, >>> rxtxParallel.dll, >>> rxtxSerial.dll >>> in >>> C:\RXTX_files >>> >>> and I got a SimpleRead class attached below, compile it with : >>> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >>> it still saying "cannot find symbol". >>> >>> Is there anything I did wrong? Do I need the comm.jar from Sun? >>> >>> Thanks & regards >>> YiQi Huang >>> >>> >>> //////////////////////////////////////////////////////// >>> // SimpleRead.java >>> //////////////////////////////////////////////////////// >>> >>> import java.io.*; >>> import java.util.*; >>> import javax.comm.*; >>> >>> public class SimpleRead >>> implements Runnable, SerialPortEventListener { >>> static CommPortIdentifier portId; >>> static Enumeration portList; >>> InputStream inputStream; >>> SerialPort serialPort; >>> Thread readThread; >>> public static void main(String[] args) { >>> portList = CommPortIdentifier.getPortIdentifiers(); >>> while (portList.hasMoreElements()) { >>> portId = (CommPortIdentifier) portList.nextElement(); >>> if (portId.getPortType() == >>> CommPortIdentifier.PORT_SERIAL) { >>> if (portId.getName().equals("COM1")) { >>> //if (portId.getName().equals("/dev/term/a")) { >>> SimpleRead reader = new SimpleRead(); >>> } >>> } >>> } >>> } >>> public SimpleRead() { >>> try { >>> serialPort = (SerialPort) portId.open("SimpleReadApp", >>> 2000); >>> } catch (PortInUseException e) {} >>> try { >>> inputStream = serialPort.getInputStream(); >>> } catch (IOException e) {} >>> try { >>> serialPort.addEventListener(this); >>> } catch (TooManyListenersException e) {} >>> serialPort.notifyOnDataAvailable(true); >>> try { >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, >>> SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> } catch (UnsupportedCommOperationException e) {} >>> readThread = new Thread(this); >>> readThread.start(); >>> } >>> public void run() { >>> try { >>> Thread.sleep(20000); >>> } catch (InterruptedException e) {} >>> } >>> public void serialEvent(SerialPortEvent event) { >>> switch(event.getEventType()) { >>> case SerialPortEvent.BI: >>> case SerialPortEvent.OE: >>> case SerialPortEvent.FE: >>> case SerialPortEvent.PE: >>> case SerialPortEvent.CD: >>> case SerialPortEvent.CTS: >>> case SerialPortEvent.DSR: >>> case SerialPortEvent.RI: >>> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >>> break; >>> case SerialPortEvent.DATA_AVAILABLE: >>> byte[] readBuffer = new byte[20]; >>> try { >>> while (inputStream.available() > 0) { >>> int numBytes = inputStream.read(readBuffer); >>> } >>> System.out.print(new String(readBuffer)); >>> } catch (IOException e) {} >>> break; >>> } >>> } >>> } >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> >> cheers >> YiQi Huang >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From smontgomery at mediaspansoftware.com Wed May 24 10:24:13 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 12:24:13 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: Tod & Joachim, Thanks for the info, that's very helpful. I'll give that a whirl when I move to rxtx 2.1. I'm still using the older 2.0.7 version for now (don't ask), which probably requires the Sun comm.jar, javax.comm.properties and librxtxSerial.jnilib to be in very specific places in each jvm's file hierarchy. From tjarvi at qbang.org Wed May 24 11:59:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 11:59:16 -0600 (MDT) Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: On Wed, 24 May 2006, Sean Montgomery wrote: > Tod & Joachim, > > Thanks for the info, that's very helpful. I'll give that a whirl > when I move to rxtx 2.1. I'm still using the older 2.0.7 version for > now (don't ask), which probably requires the Sun comm.jar, > javax.comm.properties and librxtxSerial.jnilib to be in very specific > places in each jvm's file hierarchy. > You will need comm.jar from Sun then. It must be Sun's version 2.* or older for Linux or Solaris. I assume they have this in download archives. The default offering from Sun is version 3.0. This version currently does not support rxtx. The older version will probably be fine for your needs. -- Trent Jarvi tjarvi at qbang.org From smontgomery at mediaspansoftware.com Wed May 24 12:19:06 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 14:19:06 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: <3939EFB8-11E1-4E3E-A684-5B3C525577CD@mediaspansoftware.com> Yup, that's right, thanks Trent. I've been using these files for quite a while now. Thanks for bringing it up. I almost didn't mention using 2.0.7 because I didn't want to give any new members of the list the wrong idea! :-) On May 24, 2006, at 1:59 PM, Trent Jarvi wrote: > On Wed, 24 May 2006, Sean Montgomery wrote: > >> Tod & Joachim, >> >> Thanks for the info, that's very helpful. I'll give that a whirl >> when I move to rxtx 2.1. I'm still using the older 2.0.7 version for >> now (don't ask), which probably requires the Sun comm.jar, >> javax.comm.properties and librxtxSerial.jnilib to be in very specific >> places in each jvm's file hierarchy. >> > > You will need comm.jar from Sun then. It must be Sun's version 2.* or > older for Linux or Solaris. I assume they have this in download > archives. > > The default offering from Sun is version 3.0. This version > currently does > not support rxtx. > > The older version will probably be fine for your needs. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mark at mdsh.com Wed May 24 15:55:46 2006 From: mark at mdsh.com (Mark Himsley) Date: Wed, 24 May 2006 22:55:46 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <37B0FC4B1F3237321F093ABE@MacMini.local> On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) That's no problem. BUT, do note that the instructions I elaborated on are in the INSTALL file within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone please update the INSTALL file? > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > > , it includes DLLs for Windows and the JAR > > for Java. > > > > Follow the Windows instructions in the INSTALL. > > > > ie > > > > RXTXcomm.jar goes in \jre\lib\ext (under java) > > rxtxSerial.dll goes in \jre\bin > > > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > > C:\Program Files\Java\jre1.5.0_06\lib\ext > > and copy rxtxSerial.dll into > > C:\Program Files\Java\jre1.5.0_06\bin > > > > Yes, it really is that simple. > > > > > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > > > >> I am new to serial port programming, and have no experience on > >> programming java in xp, but my project require me to builld a > >> communication link between xp and a UART device. > >> > >> Most of the information in the web site seems for linux only. > >> including > >> the commands such as export and chmod. How do I install rxtx in xp? > >> > >> cheers > >> YiQi Huang > > > > > > > > -- > > Mark Himsley > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Mark Himsley From tjarvi at qbang.org Wed May 24 16:41:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 16:41:46 -0600 (MDT) Subject: [Rxtx] install rxtx in XP In-Reply-To: <37B0FC4B1F3237321F093ABE@MacMini.local> References: <37B0FC4B1F3237321F093ABE@MacMini.local> Message-ID: On Wed, 24 May 2006, Mark Himsley wrote: > > > On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > >> I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > That's no problem. > > BUT, do note that the instructions I elaborated on are in the INSTALL file > within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone > please update the INSTALL file? > > The INSTALL file may be updated by anyone at anytime. http://rxtx.qbang.org/wiki/index.php/Installation We are moving it to the wiki so end users may put the type of answers they would like to see in. Sometimes it's best if developers don't give what appears to be cryptic answers. You can even put in that jre/lib/ext is not the right place but you don't understand the classpath solution mentioned on the mail-list and then we know what to add. -- Trent Jarvi tjarvi at qbang.org From stramit at gmail.com Wed May 24 21:45:31 2006 From: stramit at gmail.com (Tim Cooper) Date: Thu, 25 May 2006 13:45:31 +1000 Subject: [Rxtx] Accessing Virtual Com Port Message-ID: Hi, I have to develop an application that talks to a virtual com port (in this case com3) which translates any messages sent across a USB cable to a micro. Using C++ I can talk to this com port and I know that it is configured, present, and working. For the application that I am trying to write I want to use RXTX for the communication. My problem is that the configured virtual port (in windows) is not showing up when I do an enumeration over the available ports. The output I get is (com 3 is not present) : Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 PORT FOUND: COM1 PORT FOUND: LPT1 Is there anything that I need to do to make com3 available to RXTX and my application? Timothy Cooper -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060524/c5591648/attachment-0001.html From antonio.luis at iscte.pt Thu May 25 01:39:13 2006 From: antonio.luis at iscte.pt (=?ISO-8859-1?Q?Ant=F3nio_Lopes?=) Date: Thu, 25 May 2006 08:39:13 +0100 Subject: [Rxtx] RXTX on Pocket PC Message-ID: <44755F21.8060103@iscte.pt> Hello everyone, I've been using RXTX to communicate with serial ports in Windows and it's been quite successful. However, I'm now considering porting my application from Windows to Pocket PC but I can't seem to find the RXTX binaries (*.jar and *.dll) to use in Pocket PC. I've been "digging" on the mailing list's archives and also on the web and I can't find these anywhere. Can anyone in this mailing list give me some pointers on this? Where can I find the necessary files and basic installation instructions? Thanks very much for your help. I very much appreciate any help that you can provide me. Regards, -- Ant?nio Lopes @contact: antonio.luis at iscte.pt @work: ADETTI - ISCTE @web: http://antonio.lopes.googlepages.com/home From doug at dupreeinc.com Fri May 26 15:45:50 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Fri, 26 May 2006 14:45:50 -0700 Subject: [Rxtx] rxtx slow startup Message-ID: <4477770E.9010400@dupreeinc.com> Hello, I hope there are people still reading this mailing list. The archive appeared to not have anything new after 4/2005. I was using the commapi from sun for a project where a java application reads data from test equipment connected to the serial port. I had to upgrade the ftdi vcp driver on my pc and the old sun commapi no longer works with hardware flow control. as an experiment I replaced the javax.com with gnu.io in the SerialDemo.java project that was included with the commapi. This compiled fine using JBuilder 2006 and JRE 1.5.0_05. RXTX also works with the latest ftdi drivers so life is wonderful again... almost... When using the commapi jar the SerialDemo program starts in about 1 second on my system. Using the RXTX jar it takes over 56 seconds to start. Has anyone else seen this problem? Is there a workaround to get the startup performance close to the old commapi? The last thing printed to the console before this delay is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks for your time! Doug From yhua537 at cse.unsw.edu.au Sat May 27 05:46:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 21:46:45 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <4477770E.9010400@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> Message-ID: hi Doug The archive hasn't been update for a long time, But people certainly still reading the list. I don't have enough experience to help on your problem, but without any detail about what your problem doing during that 56 seconds, it is hard to target the your question, I think. cheers YiQi On Fri, 26 May 2006, Doug Thistlethwaite wrote: > Hello, > > I hope there are people still reading this mailing list. The archive > appeared to not have anything new after 4/2005. > > I was using the commapi from sun for a project where a java application > reads data from test equipment connected to the serial port. I had to > upgrade the ftdi vcp driver on my pc and the old sun commapi no longer > works with hardware flow control. as an experiment I replaced the > javax.com with gnu.io in the SerialDemo.java project that was included > with the commapi. This compiled fine using JBuilder 2006 and JRE > 1.5.0_05. RXTX also works with the latest ftdi drivers so life is > wonderful again... almost... > > When using the commapi jar the SerialDemo program starts in about 1 > second on my system. Using the RXTX jar it takes over 56 seconds to > start. Has anyone else seen this problem? Is there a workaround to get > the startup performance close to the old commapi? > > The last thing printed to the console before this delay is: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Thanks for your time! > > Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------- Just a student, Still a student ------------------------------- From yhua537 at cse.unsw.edu.au Sat May 27 06:04:26 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 22:04:26 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: Sorry, I don't think you could understand what I mean .I mean this: Without any detail about what your program is doing during that 56 seconds, it is hard for anyone to target the problem. On Sat, 27 May 2006, YiQi Huang wrote: > hi Doug > > The archive hasn't been update for a long time, But people certainly still > reading the list. > > I don't have enough experience to help on your problem, but without any > detail about what your problem doing during that 56 seconds, it is hard to > target the your question, I think. > > cheers > YiQi > > On Fri, 26 May 2006, Doug Thistlethwaite wrote: > >> Hello, >> >> I hope there are people still reading this mailing list. The archive >> appeared to not have anything new after 4/2005. >> >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From jredman at ergotech.com Sat May 27 08:32:02 2006 From: jredman at ergotech.com (Jim Redman) Date: Sat, 27 May 2006 08:32:02 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: <447862E2.4080506@ergotech.com> Doug, Since you mentioned it, we have a system that is also seems slow. From memory (I don't have one of the slow systems around), I'm not sure that it's consistent, it seems that sometimes it may take longer than others. Since it's part of the bootup it hasn't raised a flag and I haven't researched it. The same code runs much faster on other systems, so now you've got me wondering what's different. The slow system boots DSL (http://www.damnsmalllinux.org/) from a compact flash. FC4 is on my desktop where I haven't noticed a slow down. I think that the rxtx code is the same in both cases with lock files disabled. The slow system has a bunch of serial ports defined, including 4 USB serial ports that do not exist - they are not plugged in. Any clues in there? Jim > On Fri, 26 May 2006, Doug Thistlethwaite wrote: >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Sat May 27 10:41:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 May 2006 10:41:54 -0600 (MDT) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447862E2.4080506@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: On Sat, 27 May 2006, Jim Redman wrote: > Doug, > > Since you mentioned it, we have a system that is also seems slow. From > memory (I don't have one of the slow systems around), I'm not sure that > it's consistent, it seems that sometimes it may take longer than others. > Since it's part of the bootup it hasn't raised a flag and I haven't > researched it. > > The same code runs much faster on other systems, so now you've got me > wondering what's different. > > The slow system boots DSL (http://www.damnsmalllinux.org/) from a > compact flash. FC4 is on my desktop where I haven't noticed a slow > down. I think that the rxtx code is the same in both cases with lock > files disabled. > > The slow system has a bunch of serial ports defined, including 4 USB > serial ports that do not exist - they are not plugged in. > > Any clues in there? > rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. When it does this, it will try to open each port and do a timed out read. most systems will not have entries in device if the port is not there. But some minimal systems will just put all the device files there in case hardware is added. The list of devices scanned used to be ~10-20 times longer than it is today. That was getting very slow. I suspect moving the device files not used to a backup directory would increase the enumeration. I'll look into why the mail-list archive is not updating. The last update was about when I thought I 'fixed' the cron jobs. I probably didn't actually fix it but rather moved the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon May 29 19:46:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 May 2006 19:46:47 -0600 (MDT) Subject: [Rxtx] Mail-List Archives are updating. Message-ID: It was pointed out earlier that the archive is dated. This was a missing crontab entry. The list is currently archived by the week on the web page. It is updated once a day. So every 7 days it starts a new link and updates it daily. I've been limited in what I could do while my cable modem was disconnected this last week. rxtx.org is something I do on my own time. The patches and credits will be comming next. Many of these can be seen in bugzilla right now. -- Trent Jarvi tjarvi at qbang.org From doug at dupreeinc.com Tue May 30 11:18:41 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 10:18:41 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: <447C7E71.4080204@dupreeinc.com> Trent, YiQi, and Jim: Thanks to all for the replies and information! I am just back from a long weekend and I am now trying to figure out what I was doing! :) As for more information. First off, this example is being run under windows XP. I am developing test equipment that communicates with a java application via a serial port. I have been using the commapi for several years and have not had a problem. Recently, I have started a design modification that will replace the RS232 connection with a USB port. I am using the ftdi module for prototyping and I discovered that their virtual com port driver was not compatible with the commapi that Sun released. It turns out that it has problems with hardware flow control ( it works on incoming but not outgoing communications). The way I figured this out was by experimenting with the SerialDemo that was included with the Sum commapi. One nice thing about this example is it has the ability to set incoming and outgoing flow control independently. After I installed RXTX into my JBuilder 2006 IDE, I just replaced all all instances of javax.comm with gnu.io and it compiled and runs without a hitch (except for the slow startup). I Paused the JBuilder IDE during this long pause and the last few entries in the stack trace are: testRead() : -1, gnu.io.RXTXCommDriver registerValidPorts() : 255, gnu.io.RXTXCommDriver registerScannedPorts() : 777, gnu.io.RXTXCommDriver This was all initiated by the following call in the programs init routine: Enumeration en = CommPortIdentifier.getPortIdentifiers(); After looking at this, My guess is that Trent is correct in that the delay is in scanning for ports. I guess one solution would be to not scan for ports, though it would be nice to detect what is available on the system. Is there any way to reduce the number of ports scanned by this function in windows XP? Thanks again for your time, Doug Trent Jarvi wrote: >On Sat, 27 May 2006, Jim Redman wrote: > > > >>Doug, >> >>Since you mentioned it, we have a system that is also seems slow. From >>memory (I don't have one of the slow systems around), I'm not sure that >>it's consistent, it seems that sometimes it may take longer than others. >>Since it's part of the bootup it hasn't raised a flag and I haven't >>researched it. >> >>The same code runs much faster on other systems, so now you've got me >>wondering what's different. >> >>The slow system boots DSL (http://www.damnsmalllinux.org/) from a >>compact flash. FC4 is on my desktop where I haven't noticed a slow >>down. I think that the rxtx code is the same in both cases with lock >>files disabled. >> >>The slow system has a bunch of serial ports defined, including 4 USB >>serial ports that do not exist - they are not plugged in. >> >>Any clues in there? >> >> >> > >rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. > >When it does this, it will try to open each port and do a timed out read. >most systems will not have entries in device if the port is not there. >But some minimal systems will just put all the device files there in case >hardware is added. > >The list of devices scanned used to be ~10-20 times longer than it is >today. That was getting very slow. > >I suspect moving the device files not used to a backup directory would >increase the enumeration. > >I'll look into why the mail-list archive is not updating. The last update >was about when I thought I 'fixed' the cron jobs. I probably didn't >actually fix it but rather moved the problem. > >-- >Trent Jarvi >tjarvi at qbang.org > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/86796453/attachment-0001.html From doug at dupreeinc.com Tue May 30 14:36:09 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 13:36:09 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447C7E71.4080204@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com> Message-ID: <447CACB9.1000801@dupreeinc.com> Hello all, I also notice this pause (not as long however) when I call: CommPortIdentifier.getPortIdentifier(PortName); I would think that if I supply the name of the port, it would not have to go through the same discovery process. If you have any ideas of how to get rid of this startup delay, I would really appreciate it. Thanks, Doug Doug Thistlethwaite wrote: > Trent, YiQi, and Jim: > > Thanks to all for the replies and information! I am just back from a > long weekend and I am now trying to figure out what I was doing! :) > > As for more information. First off, this example is being run under > windows XP. I am developing test equipment that communicates with a > java application via a serial port. I have been using the commapi for > several years and have not had a problem. Recently, I have started a > design modification that will replace the RS232 connection with a USB > port. I am using the ftdi module for prototyping and I discovered > that their virtual com port driver was not compatible with the commapi > that Sun released. It turns out that it has problems with hardware > flow control ( it works on incoming but not outgoing communications). > The way I figured this out was by experimenting with the SerialDemo > that was included with the Sum commapi. One nice thing about this > example is it has the ability to set incoming and outgoing flow > control independently. > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup). > > I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are: > > testRead() : -1, gnu.io.RXTXCommDriver > registerValidPorts() : 255, gnu.io.RXTXCommDriver > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > This was all initiated by the following call in the programs init routine: > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > After looking at this, My guess is that Trent is correct in that the > delay is in scanning for ports. I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system. Is there any way to reduce the number of ports scanned by > this function in windows XP? > > Thanks again for your time, > > Doug > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/edaa5c3c/attachment-0001.html From lynn at swcp.com Tue May 30 15:07:18 2006 From: lynn at swcp.com (lynn@swcp.com) Date: Tue, 30 May 2006 21:07:18 -0000 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CACB9.1000801@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: *IF* the name of the port is supplied, we might want to use the preferences mechanism (java.util.prefs) where we could have previously saved the info for the port. We could do a quick check to see that things have not changed before using it. If things have changed (or never been defined) we would do a full port scan and save detected ports in the preferences. This way if the hardware is not changed, you only pay the time penalty one time. just an idea... Lynn Doug Thistlethwaite said: > This is a multi-part message in MIME format. > --------------070808020900080005070500 > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > Content-Transfer-Encoding: 7bit > > Hello all, > > I also notice this pause (not as long however) when I call: > > CommPortIdentifier.getPortIdentifier(PortName); > > I would think that if I supply the name of the port, it would not have > to go through the same discovery process. If you have any ideas of how > to get rid of this startup delay, I would really appreciate it. > > Thanks, > > Doug > > Doug Thistlethwaite wrote: > > > Trent, YiQi, and Jim: > > > > Thanks to all for the replies and information! I am just back from a > > long weekend and I am now trying to figure out what I was doing! :) > > > > As for more information. First off, this example is being run under > > windows XP. I am developing test equipment that communicates with a > > java application via a serial port. I have been using the commapi for > > several years and have not had a problem. Recently, I have started a > > design modification that will replace the RS232 connection with a USB > > port. I am using the ftdi module for prototyping and I discovered > > that their virtual com port driver was not compatible with the commapi > > that Sun released. It turns out that it has problems with hardware > > flow control ( it works on incoming but not outgoing communications). > > The way I figured this out was by experimenting with the SerialDemo > > that was included with the Sum commapi. One nice thing about this > > example is it has the ability to set incoming and outgoing flow > > control independently. > > > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > > all instances of javax.comm with gnu.io and it compiled and runs > > without a hitch (except for the slow startup). > > > > I Paused the JBuilder IDE during this long pause and the last few > > entries in the stack trace are: > > > > testRead() : -1, gnu.io.RXTXCommDriver > > registerValidPorts() : 255, gnu.io.RXTXCommDriver > > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > > > This was all initiated by the following call in the programs init routine: > > > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > > > After looking at this, My guess is that Trent is correct in that the > > delay is in scanning for ports. I guess one solution would be to not > > scan for ports, though it would be nice to detect what is available on > > the system. Is there any way to reduce the number of ports scanned by > > this function in windows XP? > > > > Thanks again for your time, > > > > Doug > > > > --------------070808020900080005070500 > Content-Type: text/html; charset=ISO-8859-1 > Content-Transfer-Encoding: 7bit > > > > > > > > > Hello all,
>
> I also notice this pause (not as long however) when I call:
>
>          CommPortIdentifier.getPortIdentifier(PortName);
>
> I would think that if I supply the name of the port, it would not have > to go through the same discovery process.  If you have any ideas of how > to get rid of this startup delay, I would really appreciate it.
>
> Thanks,
>
> Doug
>
> Doug Thistlethwaite wrote: >
> > Trent, YiQi, and Jim:
>
> Thanks to all for the replies and information!  I am just back from a > long weekend and I am now trying to figure out what I was doing! :)
>
> As for more information.  First off, this example is being run under > windows XP.  I am developing test equipment that communicates with a > java application via a serial port.  I have been using the commapi for > several years and have not had a problem.  Recently, I have started a > design modification that will replace the RS232 connection with a USB > port.  I am using the ftdi module for prototyping and I discovered that > their virtual com port driver was not compatible with the commapi that > Sun released.  It turns out that it has problems with hardware flow > control ( it works on incoming but not outgoing communications).  The > way I figured this out was by experimenting with the SerialDemo that > was included with the Sum commapi.  One nice thing about this example > is it has the ability to set incoming and outgoing flow control > independently.
>
> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup).
>
> I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are:
>
> testRead() : -1, gnu.io.RXTXCommDriver
> registerValidPorts() : 255, gnu.io.RXTXCommDriver
> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>
> This was all initiated by the following call in the programs init > routine:
>
> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>
> After looking at this,  My guess is that Trent is correct in that the > delay is in scanning for ports.  I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system.  Is there any way to reduce the number of ports scanned by > this function in windows XP? 
>
> Thanks again for your time,
>
> Doug
>
>
> > > > --------------070808020900080005070500-- > -- From jredman at ergotech.com Tue May 30 15:42:35 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 30 May 2006 15:42:35 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: <447CBC4B.2080206@ergotech.com> Lynn, If I understand your idea correctly, I don't think that this would work well for, say, USB ports since these can be easily added/removed by the end user. Jim lynn at swcp.com wrote: > *IF* the name of the port is supplied, we might want to use the preferences > mechanism (java.util.prefs) where we could have previously saved the info for > the port. We could do a quick check to see that things have not changed > before using it. If things have changed (or never been defined) we would do a > full port scan and save detected ports in the preferences. > > This way if the hardware is not changed, you only pay the time penalty one time. > > just an idea... > Lynn > > > Doug Thistlethwaite said: > >> This is a multi-part message in MIME format. >> --------------070808020900080005070500 >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >> Content-Transfer-Encoding: 7bit >> >> Hello all, >> >> I also notice this pause (not as long however) when I call: >> >> CommPortIdentifier.getPortIdentifier(PortName); >> >> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process. If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it. >> >> Thanks, >> >> Doug >> >> Doug Thistlethwaite wrote: >> >>> Trent, YiQi, and Jim: >>> >>> Thanks to all for the replies and information! I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :) >>> >>> As for more information. First off, this example is being run under >>> windows XP. I am developing test equipment that communicates with a >>> java application via a serial port. I have been using the commapi for >>> several years and have not had a problem. Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port. I am using the ftdi module for prototyping and I discovered >>> that their virtual com port driver was not compatible with the commapi >>> that Sun released. It turns out that it has problems with hardware >>> flow control ( it works on incoming but not outgoing communications). >>> The way I figured this out was by experimenting with the SerialDemo >>> that was included with the Sum commapi. One nice thing about this >>> example is it has the ability to set incoming and outgoing flow >>> control independently. >>> >>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup). >>> >>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are: >>> >>> testRead() : -1, gnu.io.RXTXCommDriver >>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>> >>> This was all initiated by the following call in the programs init routine: >>> >>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>> >>> After looking at this, My guess is that Trent is correct in that the >>> delay is in scanning for ports. I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system. Is there any way to reduce the number of ports scanned by >>> this function in windows XP? >>> >>> Thanks again for your time, >>> >>> Doug >>> >> --------------070808020900080005070500 >> Content-Type: text/html; charset=ISO-8859-1 >> Content-Transfer-Encoding: 7bit >> >> >> >> >> >> >> >> >> Hello all,
>>
>> I also notice this pause (not as long however) when I call:
>>
>>         >  CommPortIdentifier.getPortIdentifier(PortName);
>>
>> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process.  If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it.
>>
>> Thanks,
>>
>> Doug
>>
>> Doug Thistlethwaite wrote: >>
>> >> Trent, YiQi, and Jim:
>>
>> Thanks to all for the replies and information!  I am just back from a >> long weekend and I am now trying to figure out what I was doing! :)
>>
>> As for more information.  First off, this example is being run under >> windows XP.  I am developing test equipment that communicates with a >> java application via a serial port.  I have been using the commapi for >> several years and have not had a problem.  Recently, I have started a >> design modification that will replace the RS232 connection with a USB >> port.  I am using the ftdi module for prototyping and I discovered that >> their virtual com port driver was not compatible with the commapi that >> Sun released.  It turns out that it has problems with hardware flow >> control ( it works on incoming but not outgoing communications).  The >> way I figured this out was by experimenting with the SerialDemo that >> was included with the Sum commapi.  One nice thing about this example >> is it has the ability to set incoming and outgoing flow control >> independently.
>>
>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >> all instances of javax.comm with gnu.io and it compiled and runs >> without a hitch (except for the slow startup).
>>
>> I Paused the JBuilder IDE during this long pause and the last few >> entries in the stack trace are:
>>
>> testRead() : -1, gnu.io.RXTXCommDriver
>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>
>> This was all initiated by the following call in the programs init >> routine:
>>
>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>
>> After looking at this,  My guess is that Trent is correct in that the >> delay is in scanning for ports.  I guess one solution would be to not >> scan for ports, though it would be nice to detect what is available on >> the system.  Is there any way to reduce the number of ports scanned by >> this function in windows XP? 
>>
>> Thanks again for your time,
>>
>> Doug
>>
>>
>> >> >> >> --------------070808020900080005070500-- >> > > > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From yhua537 at cse.unsw.edu.au Tue May 30 18:10:23 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 31 May 2006 10:10:23 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CBC4B.2080206@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: Doug, In the SerialDemo, it allow us to save the parameters into a file, and use it when your program start up. Would this help? YiQi On Tue, 30 May 2006, Jim Redman wrote: > Lynn, > > If I understand your idea correctly, I don't think that this would work > well for, say, USB ports since these can be easily added/removed by the > end user. > > Jim > > lynn at swcp.com wrote: >> *IF* the name of the port is supplied, we might want to use the preferences >> mechanism (java.util.prefs) where we could have previously saved the info for >> the port. We could do a quick check to see that things have not changed >> before using it. If things have changed (or never been defined) we would do a >> full port scan and save detected ports in the preferences. >> >> This way if the hardware is not changed, you only pay the time penalty one time. >> >> just an idea... >> Lynn >> >> >> Doug Thistlethwaite said: >> >>> This is a multi-part message in MIME format. >>> --------------070808020900080005070500 >>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>> Content-Transfer-Encoding: 7bit >>> >>> Hello all, >>> >>> I also notice this pause (not as long however) when I call: >>> >>> CommPortIdentifier.getPortIdentifier(PortName); >>> >>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process. If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it. >>> >>> Thanks, >>> >>> Doug >>> >>> Doug Thistlethwaite wrote: >>> >>>> Trent, YiQi, and Jim: >>>> >>>> Thanks to all for the replies and information! I am just back from a >>>> long weekend and I am now trying to figure out what I was doing! :) >>>> >>>> As for more information. First off, this example is being run under >>>> windows XP. I am developing test equipment that communicates with a >>>> java application via a serial port. I have been using the commapi for >>>> several years and have not had a problem. Recently, I have started a >>>> design modification that will replace the RS232 connection with a USB >>>> port. I am using the ftdi module for prototyping and I discovered >>>> that their virtual com port driver was not compatible with the commapi >>>> that Sun released. It turns out that it has problems with hardware >>>> flow control ( it works on incoming but not outgoing communications). >>>> The way I figured this out was by experimenting with the SerialDemo >>>> that was included with the Sum commapi. One nice thing about this >>>> example is it has the ability to set incoming and outgoing flow >>>> control independently. >>>> >>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>> all instances of javax.comm with gnu.io and it compiled and runs >>>> without a hitch (except for the slow startup). >>>> >>>> I Paused the JBuilder IDE during this long pause and the last few >>>> entries in the stack trace are: >>>> >>>> testRead() : -1, gnu.io.RXTXCommDriver >>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>> >>>> This was all initiated by the following call in the programs init routine: >>>> >>>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>> >>>> After looking at this, My guess is that Trent is correct in that the >>>> delay is in scanning for ports. I guess one solution would be to not >>>> scan for ports, though it would be nice to detect what is available on >>>> the system. Is there any way to reduce the number of ports scanned by >>>> this function in windows XP? >>>> >>>> Thanks again for your time, >>>> >>>> Doug >>>> >>> --------------070808020900080005070500 >>> Content-Type: text/html; charset=ISO-8859-1 >>> Content-Transfer-Encoding: 7bit >>> >>> >>> >>> >>> >>> >>> >>> >>> Hello all,
>>>
>>> I also notice this pause (not as long however) when I call:
>>>
>>>         >>  CommPortIdentifier.getPortIdentifier(PortName);
>>>
>>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process.  If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it.
>>>
>>> Thanks,
>>>
>>> Doug
>>>
>>> Doug Thistlethwaite wrote: >>>
>>> >>> Trent, YiQi, and Jim:
>>>
>>> Thanks to all for the replies and information!  I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :)
>>>
>>> As for more information.  First off, this example is being run under >>> windows XP.  I am developing test equipment that communicates with a >>> java application via a serial port.  I have been using the commapi for >>> several years and have not had a problem.  Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port.  I am using the ftdi module for prototyping and I discovered that >>> their virtual com port driver was not compatible with the commapi that >>> Sun released.  It turns out that it has problems with hardware flow >>> control ( it works on incoming but not outgoing communications).  The >>> way I figured this out was by experimenting with the SerialDemo that >>> was included with the Sum commapi.  One nice thing about this example >>> is it has the ability to set incoming and outgoing flow control >>> independently.
>>>
>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup).
>>>
>>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are:
>>>
>>> testRead() : -1, gnu.io.RXTXCommDriver
>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>
>>> This was all initiated by the following call in the programs init >>> routine:
>>>
>>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>
>>> After looking at this,  My guess is that Trent is correct in that the >>> delay is in scanning for ports.  I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system.  Is there any way to reduce the number of ports scanned by >>> this function in windows XP? 
>>>
>>> Thanks again for your time,
>>>
>>> Doug
>>>
>>>
>>> >>> >>> >>> --------------070808020900080005070500-- >>> >> >> >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From halbleib at rechnerbetriebsgruppe.de Wed May 31 02:06:16 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 10:06:16 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp Message-ID: <447D4E78.30302@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, I getting an error while reloading my app in tomcat. At the first start everything runs well, but if i reload mit webapp by tomcat manager i get the following error. java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader Is there a possibility to unload the native library rxtxSerial.dll? thx for all help! regards tom -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 b8FT80HQ1xlbDLnRecDANCc= =heb1 -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 02:52:17 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 10:52:17 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D4E78.30302@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> Message-ID: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Hello Tom, To the best of my knowledge it is impossible to unload native libraries once loaded into the JVM. The exception you see stems from the fact, that Tomcat creates a new classloader when you "reload" the weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar is loaded from the session class loader. Try to add RXTXComm.jar to your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. Regards, Joachim On 31.05.2006, at 10:06, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 > b8FT80HQ1xlbDLnRecDANCc= > =heb1 > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From halbleib at rechnerbetriebsgruppe.de Wed May 31 03:28:35 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 11:28:35 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Message-ID: <447D61C3.1030807@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Joachim, I'm still not getting it. How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml-file? Perhaps web.xml? Regards, Tom Joachim Buechse schrieb: > Hello Tom, > > To the best of my knowledge it is impossible to unload native > libraries once loaded into the JVM. The exception you see stems from > the fact, that Tomcat creates a new classloader when you "reload" the > weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar > is loaded from the session class loader. Try to add RXTXComm.jar to > your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. > > Regards, > Joachim > > On 31.05.2006, at 10:06, Tom Halbleib wrote: > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL tzNy+/0iIUfkYYgt1+UT1ko= =pkpY -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 04:03:42 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 12:03:42 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D61C3.1030807@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> <447D61C3.1030807@rechnerbetriebsgruppe.de> Message-ID: -Xbootclasspath/a: is a start option to the java vm. Google is your friend in finding how to modfiy it and what it means: tomcat modifying bootclasspath Regards, Joachim On 31.05.2006, at 11:28, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Joachim, > > I'm still not getting it. > How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml- > file? > Perhaps web.xml? > > Regards, > Tom > > Joachim Buechse schrieb: >> Hello Tom, >> >> To the best of my knowledge it is impossible to unload native >> libraries once loaded into the JVM. The exception you see stems from >> the fact, that Tomcat creates a new classloader when you "reload" the >> weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar >> is loaded from the session class loader. Try to add RXTXComm.jar to >> your bootlclasspath (-Xbootclasspath/a:) and the problem should go >> away. >> >> Regards, >> Joachim >> >> On 31.05.2006, at 10:06, Tom Halbleib wrote: >> >> Hi all, >> >> I getting an error while reloading my app in tomcat. At the first >> start >> everything runs well, but if i reload mit webapp by tomcat manager >> i get >> the following error. >> >> java.lang.UnsatisfiedLinkError: Native Library >> C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in >> another classloader thrown while loading gnu.io.RXTXCommDriver >> Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: >> Native >> Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already >> loaded >> in another classloader >> >> >> Is there a possibility to unload the native library rxtxSerial.dll? >> >> thx for all help! >> >> regards >> >> tom > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL > tzNy+/0iIUfkYYgt1+UT1ko= > =pkpY > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From impakt01 at optusnet.com.au Wed May 31 06:55:42 2006 From: impakt01 at optusnet.com.au (Daren) Date: Wed, 31 May 2006 22:55:42 +1000 Subject: [Rxtx] (no subject) Message-ID: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/ade7ad37/attachment-0001.html From doug at dupreeinc.com Wed May 31 10:19:19 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 31 May 2006 09:19:19 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: <447DC207.3070702@dupreeinc.com> I am not sure what you are saying. The Save parameters menu option saves the current settings (baud, data bits, etc.). The long pause (~60 seconds) is when the application first starts (before loading the saved parameters). This does bring up a question, though I hate this type of kludge approach to getting this library to work... What exactly is a PortIdentifier? Is it always the same? If I stored the results from "CommPortIdentifier.getPortIdentifier(PortName);" in a file, could I use this the next time the program is executed? In this case I am using a virtual com port driver to connect to the device through a USB port. Doug YiQi Huang wrote: >Doug, > >In the SerialDemo, it allow us to save the parameters into a file, and use >it when your program start up. Would this help? > >YiQi > >On Tue, 30 May 2006, Jim Redman wrote: > > > >>Lynn, >> >>If I understand your idea correctly, I don't think that this would work >>well for, say, USB ports since these can be easily added/removed by the >>end user. >> >>Jim >> >>lynn at swcp.com wrote: >> >> >>>*IF* the name of the port is supplied, we might want to use the preferences >>>mechanism (java.util.prefs) where we could have previously saved the info for >>>the port. We could do a quick check to see that things have not changed >>>before using it. If things have changed (or never been defined) we would do a >>>full port scan and save detected ports in the preferences. >>> >>>This way if the hardware is not changed, you only pay the time penalty one time. >>> >>>just an idea... >>>Lynn >>> >>> >>>Doug Thistlethwaite said: >>> >>> >>> >>>>This is a multi-part message in MIME format. >>>>--------------070808020900080005070500 >>>>Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>>>Content-Transfer-Encoding: 7bit >>>> >>>>Hello all, >>>> >>>>I also notice this pause (not as long however) when I call: >>>> >>>> CommPortIdentifier.getPortIdentifier(PortName); >>>> >>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process. If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it. >>>> >>>>Thanks, >>>> >>>>Doug >>>> >>>>Doug Thistlethwaite wrote: >>>> >>>> >>>> >>>>>Trent, YiQi, and Jim: >>>>> >>>>>Thanks to all for the replies and information! I am just back from a >>>>>long weekend and I am now trying to figure out what I was doing! :) >>>>> >>>>>As for more information. First off, this example is being run under >>>>>windows XP. I am developing test equipment that communicates with a >>>>>java application via a serial port. I have been using the commapi for >>>>>several years and have not had a problem. Recently, I have started a >>>>>design modification that will replace the RS232 connection with a USB >>>>>port. I am using the ftdi module for prototyping and I discovered >>>>>that their virtual com port driver was not compatible with the commapi >>>>>that Sun released. It turns out that it has problems with hardware >>>>>flow control ( it works on incoming but not outgoing communications). >>>>>The way I figured this out was by experimenting with the SerialDemo >>>>>that was included with the Sum commapi. One nice thing about this >>>>>example is it has the ability to set incoming and outgoing flow >>>>>control independently. >>>>> >>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>>without a hitch (except for the slow startup). >>>>> >>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>>entries in the stack trace are: >>>>> >>>>>testRead() : -1, gnu.io.RXTXCommDriver >>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>>> >>>>>This was all initiated by the following call in the programs init routine: >>>>> >>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>>> >>>>>After looking at this, My guess is that Trent is correct in that the >>>>>delay is in scanning for ports. I guess one solution would be to not >>>>>scan for ports, though it would be nice to detect what is available on >>>>>the system. Is there any way to reduce the number of ports scanned by >>>>>this function in windows XP? >>>>> >>>>>Thanks again for your time, >>>>> >>>>>Doug >>>>> >>>>> >>>>> >>>>--------------070808020900080005070500 >>>>Content-Type: text/html; charset=ISO-8859-1 >>>>Content-Transfer-Encoding: 7bit >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>>Hello all,
>>>>
>>>>I also notice this pause (not as long however) when I call:
>>>>
>>>>        >>>> >>>> >>> CommPortIdentifier.getPortIdentifier(PortName);
>>> >>> >>>>
>>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process.  If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it.
>>>>
>>>>Thanks,
>>>>
>>>>Doug
>>>>
>>>>Doug Thistlethwaite wrote: >>>>
>>>> >>>>Trent, YiQi, and Jim:
>>>>
>>>>Thanks to all for the replies and information!  I am just back from a >>>>long weekend and I am now trying to figure out what I was doing! :)
>>>>
>>>>As for more information.  First off, this example is being run under >>>>windows XP.  I am developing test equipment that communicates with a >>>>java application via a serial port.  I have been using the commapi for >>>>several years and have not had a problem.  Recently, I have started a >>>>design modification that will replace the RS232 connection with a USB >>>>port.  I am using the ftdi module for prototyping and I discovered that >>>>their virtual com port driver was not compatible with the commapi that >>>>Sun released.  It turns out that it has problems with hardware flow >>>>control ( it works on incoming but not outgoing communications).  The >>>>way I figured this out was by experimenting with the SerialDemo that >>>>was included with the Sum commapi.  One nice thing about this example >>>>is it has the ability to set incoming and outgoing flow control >>>>independently.
>>>>
>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>without a hitch (except for the slow startup).
>>>>
>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>entries in the stack trace are:
>>>>
>>>>testRead() : -1, gnu.io.RXTXCommDriver
>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>>
>>>>This was all initiated by the following call in the programs init >>>>routine:
>>>>
>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>>
>>>>After looking at this,  My guess is that Trent is correct in that the >>>>delay is in scanning for ports.  I guess one solution would be to not >>>>scan for ports, though it would be nice to detect what is available on >>>>the system.  Is there any way to reduce the number of ports scanned by >>>>this function in windows XP? 
>>>>
>>>>Thanks again for your time,
>>>>
>>>>Doug
>>>>
>>>>
>>>> >>>> >>>> >>>>--------------070808020900080005070500-- >>>> >>>> >>>> >>> >>> >>> >>-- >>Jim Redman >>(505) 662 5156 x85 >>http://www.ergotech.com >>_______________________________________________ >>Rxtx mailing list >>Rxtx at qbang.org >>http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > >cheers >YiQi Huang >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/61d4d4c9/attachment-0001.html From impakt01 at optusnet.com.au Wed May 31 17:02:54 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 09:02:54 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Message-ID: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Hi all, I downloaded 2.1.7-pre16 and managed to build it and get it going. I made the changes as suggested by Peter Smith in an old post, by adding his code to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. Still not working, it opens the port at 9600 according to portmon.exe . Has anyone managed to get this going at a custom rate? Here is the post I'm referring to: http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 Thanks, Daren ________________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Daren Sent: Wednesday, 31 May 2006 10:56 PM To: rxtx at qbang.org Subject: [Rxtx] (no subject) Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren From tjarvi at qbang.org Wed May 31 21:44:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 May 2006 21:44:01 -0600 (MDT) Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> References: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Message-ID: On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org From impakt01 at optusnet.com.au Wed May 31 22:06:04 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 14:06:04 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: Message-ID: <200606010406.k51464X2010447@mail03.syd.optusnet.com.au> Trent, I have managed to successfully open the port at this speed using Realterm (available on sourceforge). From memory this uses DLPortIO. Using portmon.exe with realterm, even there it says that the port has opened at 1953. I changed termios.c:560 to dcb->BaudRate = 1953 ; and it still opens the port at 9600. Daren -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Thursday, 1 June 2006 1:44 PM To: RXTX Developers and Users Subject: Re: [Rxtx] custom baud rate win32 On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From smontgomery at mediaspansoftware.com Mon May 1 09:52:28 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 11:52:28 -0400 Subject: [Rxtx] RXTX, Java COMM and Windows Server 2003 on x64 experiences? Message-ID: Just wondering if anybody here has had to deploy RXTX or the javax.comm on Windows Server 2003 machines running on x64 (i.e. Xeon EM64T) and would like to relate how things went. From Sun's site, the Supported System Configurations pages give the options for that system: Java 5.0: - 32-bit Java 5.0 running on the OS in the 32-bit mode - 64-bit Java 5.0 running on the OS in the 64-bit native mode Java 1.4.2: - no options listed for EM64T processors, but potentially the standard 32-bit Java 1.4.2 could run on the OS in 32-bit mode? I guess the two main points of failure would be 1) the JVM itself and 2) the jni components. Make that three: there's gotta be hardware vendor driver support for the OS in the various modes, too. Guess I better go look at Keyspan's website... Thanks in advance for any info anyone might be able to provide. From smontgomery at mediaspansoftware.com Mon May 1 10:18:33 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 12:18:33 -0400 Subject: [Rxtx] Mailing list archive out of date? Message-ID: The mailing list archive at: http://mailman.qbang.org/pipermail/rxtx/ only shows emails through the end of March. Is there a new archive somewhere else? Didn't see anything mentioned on the wiki. From p.cain at phasefale.com.au Mon May 1 22:33:09 2006 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 02 May 2006 14:33:09 +1000 Subject: [Rxtx] RXTX and the Linux kernel. Message-ID: <4456E105.5080106@phasefale.com.au> Hi, First off the problem I am having isn't caused by RXTX itself but I'm hoping someone out there may have some knowledge that may help me. Background: I have an application monitoring a control system through a standard PC serial port which I talk to with rxtx-2.0.5. The application runs on RedHat7.3 kernel version 2.4.18 using Java 1.4. This configuration has been in use for several years and has proved to be stable. But it has become necessary for me to upgrade the OS but I'm running into problems with the serial communications. Its not that the comms don't work on the new OS (its never that simple) the comms work for a variable period of time (sometimes several hours) and then just stop, nothing on the data lines and control lines all indicate that data could flow. The new OS is Ubuntu 5.10 running kernel version 2.6.12. I have installed the OS and software on a PC and had it perform ok, then install the new OS and same software on the very same hardware and experienced the problems of them comms stopping. In the new OS I'm using Java5 to run the app but since I have experience the problem I reverted back to Java1.4 which didn't fix the problem. I've moved the app to a different system RedHat FC3 running 2.6.14 had experienced the problem. Not wanting to go through all the thing I have tried but I have established that it seems to be the 2.6 versions of the kernel that seem to be the problem and not an individual distribution of Linux. I should point out that I am using the same jar and library files for each java and OS combination. So I'm just wondering if anyone has had or heard of problems similar to these ? Or perhaps might know of what changed in the Linux serial driver (something I'm having a hard time establishing). I'm starting to run low on ideas of what to try so any help would be much appreciated. -- Peter Cain Senior Programmer Phasefale Pty Ltd From tjarvi at qbang.org Wed May 3 07:31:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 May 2006 07:31:00 -0600 (MDT) Subject: [Rxtx] Re: Concering ircomm and RXTX In-Reply-To: References: Message-ID: On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From legolas.w at gmail.com Wed May 3 08:46:23 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 19:16:23 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <4458C23F.2000003@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From legolas.w at gmail.com Wed May 3 13:10:57 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 23:40:57 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <44590041.80706@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From Lars.Hennig at wow-portal.com Thu May 4 00:39:15 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Thu, 4 May 2006 08:39:15 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: Message-ID: Hi, I could not find any solution. I therefore decided to to my own native implementation. Allthough it only supports the functions I need, it works pretty well now for me. I think the main problem there is the use of a wrong Windows API function and not setting an timeout. Regards, Lars Hennig W?rth Online World GmbH Tel. (0049)7181-258183 Mob. (0049)160-3522889 Fax. (0049)7940-153299 Lars.Hennig at wow-portal.com Gesendet von: rxtx-bounces at qbang.org 09.04.2006 10:42 Bitte antworten zu RXTX Developers and Users An d.herwald at dsh-elektronik.de, RXTX Developers and Users Kopie Thema Re: [Rxtx] USB Serialport - disconnection problems WV Proj./Teilpr.: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/7b39f374/attachment-0002.html From Pawan.Kharbanda at dot.state.co.us Thu May 4 11:00:58 2006 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Thu, 4 May 2006 11:00:58 -0600 Subject: [Rxtx] Dangling Lock Files Message-ID: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Hi, I have been using RXTX API's for the Serial Communication for quite some time now and for some of the devices we are opening and closing the connection every 2 minutes. This works great for few days and then suddenly I start seeing some "Port in Use Exception" and I see that the Lock files are still in the /var/lock folder after manually removing the lock files it works good for few hours and I see the same problem again. Can somebody explain me the scenarios why I am seeing the dangling Lock files? I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise Servers. Thanks Pawan Kharbanda -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/ba0e9261/attachment-0002.html From tjarvi at qbang.org Thu May 4 14:10:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:10:30 -0600 (MDT) Subject: [Rxtx] Dangling Lock Files In-Reply-To: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> References: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Message-ID: On Thu, 4 May 2006, Kharbanda, Pawan wrote: > Hi, > I have been using RXTX API's for the Serial Communication for quite > some time now and for some of the devices we are opening and closing the > connection every 2 minutes. This works great for few days and then > suddenly I start seeing some "Port in Use Exception" and I see that the > Lock files are still in the /var/lock folder after manually removing the > lock files it works good for few hours and I see the same problem again. > Can somebody explain me the scenarios why I am seeing the dangling Lock > files? > > I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise > Servers. Hi Pawan The next time it happens, look in the lockfile. There will be a pid. ps aux |grep 'pid' I think you will see that the application is still running for some reason. RXTX does a kill -0 on the pid to see if its alive. If not, it will remove the lockfile. So I suspect the previous program did not exit as you expected. -- Trent Jarvi tjarvi at qbang.org From Scott.Hughes at dalsemi.com Thu May 4 14:23:11 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 4 May 2006 15:23:11 -0500 Subject: [Rxtx] Wiki instructions... Message-ID: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire demo apps, when I stumbled across this tip on the wiki to add yourself to the uucp group: It may be simpler to just run usermod -G uucp jarvi Taken from: http://rxtx.qbang.org/wiki/index.php/Installation This does not work as advertised. I should have read the man page for usermod before I tried that out. If there are any groups which are not listed after the -G switch, the user is removed from those groups. On Ubuntu, this is bad... I removed myself from the Admin group, which removed my sudo priviledges. Ubuntu has no root account, so I've disabled the only account which could fix it. Anyone know of a good workaround? Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor From tjarvi at qbang.org Thu May 4 14:32:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:32:09 -0600 (MDT) Subject: [Rxtx] Wiki instructions... In-Reply-To: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> Message-ID: On Thu, 4 May 2006, Scott Hughes wrote: > I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire > demo apps, when I stumbled across this tip on the wiki to add yourself to > the uucp group: > > It may be simpler to just run > > usermod -G uucp jarvi > > Taken from: > http://rxtx.qbang.org/wiki/index.php/Installation > > This does not work as advertised. I should have read the man page for > usermod before I tried that out. If there are any groups which are not > listed after the -G switch, the user is removed from those groups. On > Ubuntu, this is bad... I removed myself from the Admin group, which removed > my sudo priviledges. Ubuntu has no root account, so I've disabled the only > account which could fix it. > > Anyone know of a good workaround? > Yikes This will get your permissions back: in grub/lilo/.. pass the following option to the kernel init=/bin/sh You are now root. when it boots, mount -o remount,rw / add yourself to the groups, reboot to get normal init going. Thats about all I can think of without sudo/root. -- Trent Jarvi tjarvi at qbang.org From Gettings at earth.utah.edu Thu May 4 14:41:22 2006 From: Gettings at earth.utah.edu (Paul Gettings) Date: Thu, 4 May 2006 14:41:22 -0600 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <20060504204122.GA6534@earth.utah.edu> When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get messages on stdout from the JVM: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 As the only change was the version of RXTX (from 2.1.6), I am unsure why the messages suddenly appeared. Anyone know how to get rid of them? Thanks. -- 101 USES FOR A DEAD MICROPROCESSOR (23) Dead cat brush From mmester at sps.edu Mon May 1 21:22:28 2006 From: mmester at sps.edu (Michael Mester) Date: Mon, 1 May 2006 23:22:28 -0400 Subject: [Rxtx] Windows PortInUseException Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> I'm trying to get simple serial communication going with RxTx under Windows XP. I can enumerate the ports fine, but I always run into problems when I try to open one. I get a PortInUseException, but the owner application is "Unknown" and the port is never open. I've tried this on several different systems and all of them give the same behavior. The only thing I can thiunk of that might be causing the problem is that fact that I had to put the serial .dll file in system32 instead of the reccommended folder, because it didn't work in the folder the documentation gives. The library loads fine, though, so I'm not sure whether that makes sense, and I don't know how to fix it anyway. Any help is greatly appreciated. Below is the output of the program, right up to the PortInUseException and the NullPointerException it causes (because the serial port object is not instantiated). C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI Starting GPSTalkerGUI... Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 gnu.io.PortInUseException: Unknown Application Exception in thread "main" java.lang.NullPointerException at GPSTalkerGUI.(GPSTalkerGUI.java:102) at GPSTalkerGUI.main(GPSTalkerGUI.java:161) Again, thank you very much for any help you can give. From lshellman at qwest.net Wed May 3 01:38:34 2006 From: lshellman at qwest.net (Lucious Shellman) Date: Wed, 03 May 2006 01:38:34 -0600 Subject: [Rxtx] Help needed: Project using parallel port Message-ID: <1146641914.8337.14.camel@localhost.localdomain> I was looking for a way to access the parallel port on a PC using Java. Searching the Internet, I came across this site (rxtx.org). What I am trying to do is detect logic levels from a TTL logic IC on the parallel port. I am not trying to do classic parallel port communication. I just want to detect whether a line(s) is (are) high or low. I am using Windows 98. Can rxtx be used to do this? If yes, is there a tutorial for using rxtx posted on the Internet that someone can direct me to. If you need more information, feel free to e-mail me. Unfortunately for me, I need the information ASAP. Thanks. lshellman at qwest.net From webmaster at egyhelp.com Wed May 3 18:43:39 2006 From: webmaster at egyhelp.com (Mohamed Samy) Date: Thu, 4 May 2006 02:43:39 +0200 Subject: [Rxtx] RE: Concering ircomm and RXTX In-Reply-To: Message-ID: <20060503184362.SM01044@Geek> Hey, I issue the command "modprobe ircomm-tty" yet no ttyircomm appears, while the ircomm appear by "modprobe ircomm" so forgive me but I am bit lost. Even searching google for the keyword "ttyircomm" only returns 3 matches. So any way I can start the ttyircomm???? Thanks a lot. -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Wednesday, May 03, 2006 3:31 PM To: Mohamed Samy; rxtx at qbang.org Cc: taj at www.linux.org.uk Subject: Re: Concering ircomm and RXTX On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 4 15:49:49 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 15:49:49 -0600 (MDT) Subject: [Rxtx] Windows PortInUseException In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> Message-ID: On Mon, 1 May 2006, Michael Mester wrote: > > I'm trying to get simple serial communication going with RxTx under > Windows XP. I can enumerate the ports fine, but I always run into > problems when I try to open one. I get a PortInUseException, but the > owner application is "Unknown" and the port is never open. I've tried > this on several different systems and all of them give the same > behavior. The only thing I can thiunk of that might be causing the > problem is that fact that I had to put the serial .dll file in system32 > instead of the reccommended folder, because it didn't work in the folder > the documentation gives. The library loads fine, though, so I'm not sure > whether that makes sense, and I don't know how to fix it anyway. Any > help is greatly appreciated. Below is the output of the program, right > up to the PortInUseException and the NullPointerException it causes > (because the serial port object is not instantiated). > > C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI > Starting GPSTalkerGUI... > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > gnu.io.PortInUseException: Unknown Application > Exception in thread "main" java.lang.NullPointerException > at GPSTalkerGUI.(GPSTalkerGUI.java:102) > at GPSTalkerGUI.main(GPSTalkerGUI.java:161) > Perhaps you are trying to open the port twice in your code? rxtx does open the ports, do a timed out read and then close the ports during enumeration. I think the port is being opened fine. The Unknown Application is always reported. On linux, there is some code that finds the actual application but on windows, its always unknown. If the port enumeration is returning the ports you expect, rxtx has opened the port and closed it with success. The port should open. There is also example code in the contrib directory that comes with rxtx source that has examples you can modify to work. -- Trent Jarvi tjarvi at qbang.org From Christian.Klemke at t-online.de Thu May 4 23:37:23 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Fri, 5 May 2006 07:37:23 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu> Message-ID: <004f01c67005$fc72fee0$016a10ac@NB600> Hi Paul, I was wondering about the same question some days ago and took a look at the source files. Unfortunately, I found that you can only get rid of that messages by altering and recompiling the Java code. There is a final static boolean variable called "devel" in the file "RXTXCommDriver.java" which is set to "true". This constellation causes the output after the native libraries have been loaded. No mechanism exists to suppress them otherwise :-(. Trent, does that mean that 2.1.7 is still officially a "development" version ? When will this value be changed to "false" by default ? With 2.1.8 ? It would be nice to provide a means to suppress such messages besides that static flag (maybe by setting a property called "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The output can indeed by annoying, especially when used with console applications, where the message potentially appears "in the middle" of your own output. Another possibility would be not to use System.out directly, but instead some PrintStream field which is initially set to System.out but can programatically be changed. That would allow for any kind of redirection or suppression by implementing appropriate user-defined PrintStream subclasses and making RXTX use that stream. What do you think ? Best regards, Christian ----- Original Message ----- From: "Paul Gettings" To: Sent: Thursday, May 04, 2006 10:41 PM Subject: [Rxtx] RXTX causing stdout messages > When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get > messages on stdout from the JVM: > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > As the only change was the version of RXTX (from 2.1.6), I am unsure > why the messages suddenly appeared. Anyone know how to get rid of > them? > > Thanks. > > -- > 101 USES FOR A DEAD MICROPROCESSOR > (23) Dead cat brush > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri May 5 06:09:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 06:09:46 -0600 (MDT) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <004f01c67005$fc72fee0$016a10ac@NB600> References: <20060504204122.GA6534@earth.utah.edu> <004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: On Fri, 5 May 2006, Christian Klemke wrote: > Hi Paul, > > I was wondering about the same question some days ago and took a look at the > source files. Unfortunately, I found that you can only get rid of that > messages by altering and recompiling the Java code. There is a final static > boolean variable called "devel" in the file "RXTXCommDriver.java" which is > set to "true". This constellation causes the output after the native > libraries have been loaded. No mechanism exists to suppress them otherwise > :-(. > > Trent, does that mean that 2.1.7 is still officially a "development" version > ? When will this value be changed to "false" by default ? With 2.1.8 ? It > would be nice to provide a means to suppress such messages besides that > static flag (maybe by setting a property called > "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The > output can indeed by annoying, especially when used with console > applications, where the message potentially appears "in the middle" of your > own output. Another possibility would be not to use System.out directly, but > instead some PrintStream field which is initially set to System.out but can > programatically be changed. That would allow for any kind of redirection or > suppression by implementing appropriate user-defined PrintStream subclasses > and making RXTX use that stream. What do you think ? > A patch for using properties would be accepted I'm sure. The reason the default is to display the message is not related to the development state of rxtx anymore. The problem is that people first using rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. The message prevents a great deal of email thats easily explained by the message. I question if we should support rxtx 2.0 at all anymore. If you post a patch in bugzilla, we'll put it into CVS this weekend. we'll be going through and doing such things anyhow. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri May 5 13:23:56 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 13:23:56 -0600 (MDT) Subject: [Rxtx] How to read from RxTx parallel port in Win XP In-Reply-To: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> References: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> Message-ID: On Thu, 27 Apr 2006, Worsley, Bob (Development Engineer) wrote: > I'm sorry if this is a dumb question, but I didn't find the answer in > the archives. > > I'm using the RxTx binaries for Windows on a reasonably current notebook > PC running Windows XP. I can send stuff to a printer on the parallel > port (LPT1), but I can't get anything back. > > I wrote a class that has the methods listed below. I write some data to > the printer with the "write" method and then try to read a response > using the "read" method, but I never get any data. I'd greatly > appreciate any help you can give! > > Bob Worsley > bobwoyid2 at yahoo.com > > > > > private ParallelPort parallelPort = null; > private RXTXCommDriver parallelPortDriver = null; > > > public boolean initialize() throws IOException { > if (parallelPort != null) { > return false; // Already initialized > } > > // Create the parallel port; > parallelPortDriver = new RXTXCommDriver(); > parallelPort = > (ParallelPort)parallelPortDriver.getCommPort(address, > CommPortIdentifier.PORT_PARALLEL); > > // Set the parallel port parameters. > try { > parallelPort.enableReceiveTimeout(READ_TIMEOUT); > parallelPort.disableReceiveFraming(); > parallelPort.disableReceiveThreshold(); > //parallelPort.setMode(mode); !!!!errors > } catch (UnsupportedCommOperationException e) { > throw (new IOException("Parallel port with address '" + > address > + "' cannot be configured as specified")); > } > > return true; > } > > > > public void write(final byte[] bytes) throws IOException { > initialize(); > while (busyReading) { > Thread.yield(); > } > busyWriting = true; > if (bytes.length < 1) { > return; > } > OutputStream outputStream = parallelPort.getOutputStream(); > outputStream.write(bytes); > outputStream.flush(); > outputStream.close(); > Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); > busyWriting = false; > } > > > public byte[] read() throws IOException { > > // Read up to MAX_BYTES bytes. > initialize(); > while (busyWriting) { > Thread.yield(); > } > busyReading = true; > byte[] buff = new byte[MAX_BYTES_READ]; > InputStream inputStream = parallelPort.getInputStream(); > // This read blocks until input data is available > int bytesRead = inputStream.read(buff); > inputStream.close(); > // If no data read, create empty array > if (bytesRead == -1) { > bytesRead = 0; > } > byte[] deviceBytes = new byte[bytesRead]; > System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); > if (bytesRead > 0) { > Debug.p("PPIOP.read - got data: '" + new > String(deviceBytes) + "'"); > } > busyReading = false; > return deviceBytes; > } > Hi Bob I've only used rxtx to test a hello world page printing but there are others that have used it. PPIOP? hmm what is this? :) The rxtx parallel support is behind the serial support but should be OK. As you note, the setting of modes is not supported. rxtx uses what is provided when the port is open. Are your asserting the pin for the printer being online? I suspect what often happens is people try to just use the data pins but the C API rxtx uses wants the printer to be online. There should be some posts relating to this in the rxtx mail-list archive. Some APIs are probably reading and writing from the port address (also suggested in your code as something you are looking at). RXTX currently uses a higher level C/C++ API for port access. This can still work if the API thinks the 'printer' is there. -- Trent Jarvi tjarvi at qbang.org From agrodellic at gmail.com Sat May 6 08:39:40 2006 From: agrodellic at gmail.com (Leigh Stewart) Date: Sat, 6 May 2006 10:39:40 -0400 Subject: [Rxtx] sun commapi 3 Message-ID: I think I read here: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html that rxtx-2.0 is basically fracked for now? Does anyone know of a workaround? ie can i somehow get an older version of sun's comm api and use that (not easy to find)? i mean 2.0 must be working for someone...how is it being tested. 2.1 isnt working for me....im getting nasty native exceptions etc, which is why im so set on 2.0... any ideas? From tjarvi at qbang.org Sun May 7 15:40:27 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 7 May 2006 15:40:27 -0600 (MDT) Subject: [Rxtx] sun commapi 3 In-Reply-To: References: Message-ID: On Sat, 6 May 2006, Leigh Stewart wrote: > > 2.1 isnt working for me....im getting nasty native exceptions etc, > which is why im so set on 2.0... any ideas? > Hi Leigh What native exceptions are you seeing? Which OS? The native code is almost identical between rxtx 2.0 and 2.1. Only the names have been changed to protect the inocent. :) ie: javax_comm_... vs gnu_io_... So the odds are very likely that even if you do find commapi 2.0 and get it installed, you will run into the same error. It would be better to just find and fix the problem. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Mon May 8 10:47:20 2006 From: mail at willicon.de (WILLICon) Date: Mon, 08 May 2006 18:47:20 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 Message-ID: <445F7618.3070303@willicon.de> Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/ef37e8ec/attachment-0002.html From tjarvi at qbang.org Mon May 8 16:14:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 May 2006 16:14:51 -0600 (MDT) Subject: [Rxtx] Screenshot of Application using RXTX (fwd) Message-ID: Just though someone may end up searching for 0x0D and 0x0A. Here are the details from his system. SuSE Linux 10.0 (x86_64) Kernel 2.6.13-15.8 j2se 1.4.2_11 (i586) Sun: comm3.0_u1 rxtx: rxtx-2.1-7 ---------- Forwarded message ---------- Date: Sat, 6 May 2006 20:01:46 +0200 From: Michael Poppitz To: taj at www.linux.org.uk Subject: Screenshot of Application using RXTX Hi Trent, the rxtx package works like a charm. Sun's package seemed to replace all 0x0D with 0x0A in received data on my Linux box, which is really annoying when transfering binary data. But rxtx came and saved the day - and turned out to be a lot more convenient as it does not require a configuration file. I use it for connecting to a home made logic analyzer. (http://www.sump.org/projects/analyzer/) Thanks for your great job, Michael -------------- next part -------------- A non-text attachment was scrubbed... Name: la_client.png Type: image/png Size: 16592 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/45494fbb/la_client-0002.png From tjarvi at qbang.org Tue May 9 14:56:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 May 2006 14:56:05 -0600 (MDT) Subject: [Rxtx] RXTX javax.comm: which one to install? In-Reply-To: <20060509161742.43547.qmail@web53814.mail.yahoo.com> References: <20060509161742.43547.qmail@web53814.mail.yahoo.com> Message-ID: On Tue, 9 May 2006, Adenilson Cavalcanti wrote: > Dear Trent Jarvi > > I'm trying to write a small Java app running in linux that interfaces with a device connected to serial port. > > I do have some questions about RXTX and javax.comm state of affairs, since I'm new to Java programming (used to program in plain old C writting to devices using termios and open/write/read syscalls, but this is another story). > > I ask you the favor to clarify this issues (if possible...): > > a) Sun offers to download a file (comm3.0_u1_PUTAUNIXVERSION.zip) which does contain .so files. Does it work out of box? > > b) Case negative, its there that we should use 'librxtx*.so' provided by your site? > > c) Sun's comm3 API version does work with which version of rxtx? > > I already searched google and read documentation available in rxtx site ("Java Comm Serial API How-to") but still have this issues unsolved. Any help will be appreciated. > > Best regards > > Adenilson Hi Adenilson, RXTX does not currently support javax.comm in Sun's CommAPI 3.0. I would recommend using package gnu.io provided by rxtx 2.1. -- Trent Jarvi tjarvi at qbang.org From chris.develder at intec.ugent.be Wed May 10 08:45:40 2006 From: chris.develder at intec.ugent.be (Chris Develder) Date: Wed, 10 May 2006 16:45:40 +0200 Subject: [Rxtx] rxtx troubles on ARM Message-ID: <4461FC94.6040909@intec.ugent.be> Hi all, Sorry to bother you, but I don't seem to get RXTX working on an ARM processor (xscale ixp 425, big endian). I managed to crosscompile the rxtx libs and moved it over to the ARM. Using jamvm (which is the only open source java VM we got working on the ARM), I get the following error result when running SimpleRead from Sun's javax.comm examples (commapi\examples\Simple\SimpleRead) -- see bottom of mail for complete output: "java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver" However, output shows that the RXTXCommDriver code is accessible (cf. debug and devel output of lib versions). So it doesn't seem to be a missing lib/jar issue. The error happens before RXTXCommDriver.initialize() is called, since the first line there is System.out.println("RXTXCommDriver:initialize()"); Any ideas? Cheers, Chris ---------------------------- [root at xxx(ttyp1) /work/cdvelder/xscale/test]# jamvm -Djava.library.path=/work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/jre/lib/arm -classpath /work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/lib/ext/RXTXcomm.jar:./comm.jar:. SimpleRead RXTXCommDriver {} Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTXCommDriver: Jar version = RXTX-2.1-7 native lib Version = RXTX-2.1-7 java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver gnu/io/RXTXCommDriver at javax.comm.CommPortIdentifier.loadDriver (CommPortIdentifier.java:239) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:109) at SimpleRead.main (Unknown Source) java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive (Native Method) at com.sun.comm.Portmapping.registerCommPorts (Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase (Portmapping.java:100) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:138) at SimpleRead.main (Unknown Source) From joachim at buechse.de Fri May 12 00:44:48 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 08:44:48 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) Message-ID: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Good day, I guess that only a selected few (hi Trent) will be able to answer this question, but the answer might be interesting for anyone trying to debug or understand the code. Apparently the MonitorThread is started and stopped in RXTXPort.addEventListener and RXTXPort.removeEventListener. This would indicate that (originally?) the MonitorThread is only required when there is an EventListener. However the MonitorThread is also started in the RXTXPort constructor, which could mean that RXTX won't work at all if it isn't there. It seems to me, that if anyone would add an event listener and later on remove it, he could potentially wreak the port. Because the second action would kill the MonitorThread. For the moment I am only trying to understand the role of and idea behind the MonitorThread. But of course there is a deeper reason thor my question: If the MonitorThread needs to exist anyway, it could be the thread that cleans up the port (ie calls nativeClose) - this would eliminate (a further) problem I am seeing with some USB drivers on Mac OSX. (Close blocks (after releasing the tty, but still) in the USB driver if the device is "not responding"). Greetings, Joachim From tjarvi at qbang.org Fri May 12 07:10:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 12 May 2006 07:10:59 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Fri, 12 May 2006, Joachim Buechse wrote: > Good day, > > I guess that only a selected few (hi Trent) will be able to answer > this question, but the answer might be interesting for anyone trying > to debug or understand the code. > > Apparently the MonitorThread is started and stopped in > RXTXPort.addEventListener and RXTXPort.removeEventListener. This > would indicate that (originally?) the MonitorThread is only required > when there is an EventListener. However the MonitorThread is also > started in the RXTXPort constructor, which could mean that RXTX won't > work at all if it isn't there. > > It seems to me, that if anyone would add an event listener and later > on remove it, he could potentially wreak the port. Because the second > action would kill the MonitorThread. > > > For the moment I am only trying to understand the role of and idea > behind the MonitorThread. But of course there is a deeper reason thor > my question: > > If the MonitorThread needs to exist anyway, it could be the thread > that cleans up the port (ie calls nativeClose) - this would eliminate > (a further) problem I am seeing with some USB drivers on Mac OSX. > (Close blocks (after releasing the tty, but still) in the USB driver > if the device is "not responding"). > Hi Jaochim Before commapi, rxtx did not support events. You could read, write and change port settings. The MonitorThread was added as an afterthought to support commapi events. So the way things are now his historical spaghetti not a well devised plan. It is my opinion that the MonitorThread should exist as long as the port is open. The odd starting of the thread in the constructor and addEventListener was just to get past the obvious problem of people using the port without adding listeners. -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Fri May 12 07:59:50 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 15:59:50 +0200 Subject: [Rxtx] MonitorThread -> ChangeRequest In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: <2B1E508C-8CEE-4AB7-914D-E7BA25C871A2@buechse.de> In this case I suggest removing the starting/stopping of MonitorThread in addEventListener / removeEventListener. This should not affect existing projects. On 12.05.2006, at 15:10, Trent Jarvi wrote: > It is my opinion that the MonitorThread should exist as long as the > port > is open. The odd starting of the thread in the constructor and > addEventListener was just to get past the obvious problem of people > using > the port without adding listeners. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Fri May 12 11:43:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 19:43:21 +0200 Subject: [Rxtx] Spring Cleaning - some suggestions Message-ID: The current implementation of RXTX contains quite a lot of code that will break if it is used from several threads (especially on a multi processor machine). I think it would be nice to clean this up. I suggest the following changes (which keep the current semantics and should not influence existing projects in a negative way): - InterruptedException will never be ignored or reset - read methods will be protected with a Monitor - write methods will be protected with a (separate) Monitor - close() sets the read and write monitors into a "closed" state which will lead to IOExceptions for any following call to RXTXPort.read/write. - close() will wait a finite amount of time (maybe 500ms) for the release of the read and write monitors after that, it will trigger the closing of the file descriptor to abort any pending read or write. - close() will not call close(file_desc). Instead it will "interrupt" (ie set a flag and then, pthread_kill(ABRT)) the MonitorThread, the MonitorThread will call close(file_desc). - the monitors are properly released in a finally block the try of which starts directly after obtaining the monitor. - finally will not call close(file_desc) it will only "interrupt" the MonitorThread (see above) - the native-code (esp read) does not use SA_RESTART but checks Thread.interrupted() when it receives a SIGNAL (ie system call returns with EINTR or other signalling method). The read/write monitors will be allocated from a factory whose mode can be set to fast/normal/advanced. In fast-mode it will create "non thread safe, non synchronized" pseudo-monitors. In default mode, the monitors will store the owning thread. In "advanced" mode setting the monitors into closed state will "interrupt()" threads which are blocked in a native read/write. {Reasoning close behaviour: Calling close on a file descriptor in Windows unblocks any read() or write() on the same file descriptor with an error. On Solaris < 2.7 and MacOS X however the close() will/ can block - until the read or write have finished:-(( Even the JDK people have trouble with this. I dont know how Linux reacts in this case. The best practice for BSD/Solaris is to send a signal to the thread which will usually unblock the read/write with an EINTR - this however is not guarenteed as it also depends on the device driver. So the only resolution that will certainly not block the thread calling RXTXPort.close() (which will often enough be the AWT event dispatcher or the VM finalizer thread) is to call close(fd) from another thread.} {Reasoning read behaviour: It is rather uncommon to receive a signal while reading or writing - it will happen, but checking Thread.interrupted() when it happens will not degrade performance. The checking of Thread.interrupted() can be handled by returning to Java and potententially reentering into the native code if the thread was not interrupted or by calling back into the VM from the native code. On top of this, many functions like read(byte[]) or read(byte [], int, int) are allowed to return less than the requested amount of data. Only int read() is a bit more tricky. } [Trent: From the code I can tell, that you experimented quite a bit with signals. Do you know if the Java Thread.interrupt() triggers a unix signal on Linux/Solaris? If so, which one?? References: - http://java.sun.com/docs/hotspot/VMOptions.html - http://www.hp.com/products1/unix/java/infolibrary/prog_guide/ signals.html ] On OS X (hotspot client jdk-1.4.2) I did not see any signal propagated to the SELECT of the event_loop/MonitorThread (ie no EINTR) when I call monThread.interrupt(). This is a pitty, but thats the way it is. I simply assume this is true for most system calls. How to handle this? Of course it would be possible to install/ deinstall a specific signal handler before/after every native read and to natively send an ABRT signal if RXTXPort.close is called. A more elegant solution might be to have an additional "signaling" socket which is always included in the SELECT. Or the simplest solution: cap the timeout of the select to 500 ms (the loop around it exists already) after every timeout check the Thread.interrupted() flag. From a performance perspective this should be completely invisible... On the other hand, all write() calls need to be preceeded by a SELECT as well, to avoid running into a blocking write. Best regards, Joachim From lyon at docjava.com Sat May 13 05:54:52 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 13 May 2006 07:54:52 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Dmitry suggests that we acquire an implementation of a serial port reference, use it, then release it (i.e., check it back in). Joachim says that making serial ports thread friendly might be a good idea. This is a good idea. The design pattern that is close to this idea is the "Object Pool Design Pattern". # Object Pool Manage the reuse of objects for a type of object that is expensive to create or only a limited number of a kind of object can be created. It has been described at: http://www.developer.com/java/ent/article.php/626171 and in Marks' book, Patterns in Java, Volume 1. However, the Object Pool is intended to pool objects so that each object is just like every other object. The intent of the Parametric Singleton is to enable others to access the same resource at the same time (as long as the same parameters were used in construction). It sounds like we need a NEW Design Pattern (Oh no, Doug is doing it again!). Yes friends, you got me on a role (roll) :) If you like design patterns, you can thank me later. If you don't like design patterns, blame Dmitry, it was his idea ;) And Dave, thanks for the feedback on Singleton abuse. It has led me to change the way I think about application contexts, which we will see, below. We need (drum roll please): The Parametric Object Pool Design Pattern (POP) By Douglas A. Lyon ABSTRACT The goal of the Parametric Singleton design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values, in a given context. In comparison, the goal of the POP design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values and that only one reference to the class is checked out at a time, in a given context. A context is a namespace for holding identifiers during execution. In Java, A context can be changed in any of several ways. For example, creation of a new class loader, the deserialization of an old POP or the creation of a new process all create a new namespace. The POP Design Pattern combines the Parametric Singleton Design Pattern with the check out mechanism of the Object Pool Design Pattern. This enables unique creation of instances of a class. These instances are cached in a table. When a clients asks for an instance with these parameters, the cache is checked. If the instance is not in the cache it is created. If the instance is available, the clients checks out the instance. A reference is left to the clients that checked out the instance. The POP has the role of creating objects uniquely, from parameters. It also has the role of keeping track of which clients has checked out a given object. This is just like a library keeping track of who borrowed a book. If a resource is left unavailable in a system, a deadlock can occur. Deadlock debugging is facilitated by mapping a resource to the clients that have checked it out. We apply our POP Design Pattern to the retrieval of serial ports. The goal of our system is to make sure that serial ports are checked out to only one client at a time, and that they be checked back in when the client is done. The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. Users are discouraged from calling this the Parametric Object Oriented Pool (POOP). Introduction The intent of the POP Design Pattern is to ensure that a class has only one instance for a given set of parameter values. It also provides a point of access that is global to a given context. The POP uses the Singleton Design Pattern to ensure that there is only one POP, in the given context. The POP DP is responsible for checking out a reference to a given instance, and keeping track of that instance. The instance is responsible for sharing that instance. POP requires that users of the DP implement an interface that enables a recall facility. Thus, if there is a contention for a consumed resource, the deadlock can be resolved in an orderly fashion. Motivation A system cannot tolerate multiple instances of some classes with identical parameters used by different instances at the same time. For example, you cannot have two instances use the same serial port, at the same time. You cannot have two instances that are trying to listen to the same socket connection. You cannot have two instances writing to the same file structure at the same time. Further, once a serial port is checked out by a client, it is assigned to the client. This is like the spin-lock service provided by the operating system, only in the application layer. Naturally, deadlock will occur if a resource is not released, therefore the client of the resource is tracked. Recalling a resource is required for the POP DP by virtue of the implementation of an interface. The policy on how to break a deadlock (by honoring the recall) is application specific. As the operating system is often thought of as the arbiter of consumed resources (i.e., tape drives, serial ports, etc.) we frequently leave it to an operating system implementation to resolve these contention issues. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on naming conventions (which are not well standardized). The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. The POP Design Pattern can take on the role of the peer method mapper that homogenizes the API for different operating environments. That is, it can wrapper the different locking mechanisms used in different operating systems. POP that is responsible for keeping track of the instances created and the client that has checked them out. The POP Design Pattern is implemented using the Singleton Design Pattern. In Java, the POP implementation is declared final, so that it cannot be subclassed. The class also has a private constructor, so that other classes cannot instance it. The new design pattern is called the POP design pattern and it provides a way to check out and create instances with given parameters. Applicability Use the POP Design Pattern when: 1. There must be exactly one instance of a class with the given parameters in a given context. 2. The instances must be accessible to clients from a well-known access point. 3. The instances are reusable. 4. Only one client can check out an instance at a time. Structure Insert UML diagram here. Participants The POP Clients that need instances 1. The POP defines an instance upon request from a client, if, and only if, the instance does not already exist. 2. The POP returns the instance to the client. 3. The POP is responsible for creating unique instances from given parameters. 4. The POP is responsible to recalling instances from clients. Collaborations Clients obtain a reference to a POP instance only through the singleton design pattern. If the POP instance is left in an improper state (e.g., the serial port was left open) it is NOT the role of the POP to close the IO port. However, the POP can be requested to get the instance released. Nor is it the role of the POP Design Pattern to open the port. That role is delegate to some other part of the system. Further, it is the role of the POP Design Pattern to check out resources. However, it is still possible to have, multiple threads that have multiple references to the same resource at the same time. Checkout and resource requests are MUTEX locked (i.e., synchronized). Consequences The POP Design Pattern has several benefits: 1. Controlled access to parametrically defined instances. Since the POP encapsulates its instances, there is some limited control over how and when clients access it. 2. Reduced name space. The POP pattern avoids global variables that store instances created from the same parameter. Implementation Here are implementation issues to consider when using the POP pattern: 1. Unique mapping of parameters. The POP pattern requires that there be a mean to isomorphically map the parameter space into the instance space and back again. 2. Ensure unique instances. The POP pattern makes unique instances from parameters, and it does so only once. 3. Cache instances for fast retrieval. The POP must be able to look up instances, given some set of parameters, and do so from some data structure. That is, there must be enough space to hold references to all the instances the program will need. Also, a mechanism is needed to look up and retrieve the instances quickly enough to satisfy the clients. Sample Code To be written....any volunteers? Thanks! - Doug >I don't think I get it > >On Mar 22, 2006, at 9:36 AM, David Garnier wrote: >>Using the singleton pattern in this case is >>just convenient for the programmer. Problems >>arises >>pretty quickly, especially if you attempt to unit-test your classes. > > >so you're saying that something isn't so good >because you can not test it in the convenient >way? >if that's true, I'm totally disagree >change your test, debug whatever, but if >software is efficient at runtime, works fine and >only problem is some unit test >(which is some kind of framework for testing) >then dump that unit test , dump that unit >framework and make something appropriate to the >software >you're testing > >so if Douglas want to use singletons, what's the problem? >and what do you mean by abusing of singleton usage? > >of course singleton doesn't prevent concurrent >access to the resource across the processes >unless >you're using some OS facility to prevent it, besides >singleton as it was introduced is relevant only >and only inside of the same process >otherwise it's not singleton it's something else >(let's say network singleton: so you have remote >invocation facility >and some factory method that return object created by that facility) > >I don't have any problem with using any kind of singletons. > Parametric Singleton idea (if I understand it >right) could be easily implemented in the >following way: >use a map >populate map with instances of some class and key is your parameter >(you can use lazy population too) > >if somebody ask the key check the value if it's null so resource is taken >if somebody returns the resource put it back to the map > >public synchronized static Object getSomeResource(Object parameter); >public synchronized static void returnResource(Object parameter); > >getSomeResource (inside of the same process) could return null in 2 cases >1. if somebody (from other thread for example) already took that resource >2. if OS API said that resource corresponded to >that parameter (serial port with parameter = 1 >(port #)) >is locked and unavailable; >I'm not sure that in case of serial ports we >even need those Parametric Singletons >(unless lock checking is a very expensive operation) >just ask the OS about availability of that >resource and if it's available give it away >and then OS will lock it and therefore in next >time somebody ask it just answer that resource >is locked >and return null > >for example system has 2 serial ports available >so I ask getResource("tty"); >or I ask getResource("Bluetooth-Modem"); > >and if OS is ok you can give tty or Bluetooth-Modem or both > >no need for any additional pattern I think > >back to the problem >mac os x doesn't recognize locking via files, so >it handles locking via some API >an instance of the singleton in each process >should recognize that resource is locked >(by using that API) that's all >we don't have to make things more complicate >then they are just because there is some nice >design pattern or nice unit test framework or whatever >keep things simple, make them work fast, don't introduce middle layers >unless you have really good reason to do so > >of course I could be entirely wrong, so sorry about that in advance > >thanks > > >Dmitry Markman > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx >Good day, > >I guess that only a selected few (hi Trent) will be able to answer? >this question, but the answer might be interesting for anyone trying? >to debug or understand the code. > >Apparently the MonitorThread is started and stopped in? >RXTXPort.addEventListener and RXTXPort.removeEventListener. This? >would indicate that (originally?) the MonitorThread is only required? >when there is an EventListener. However the MonitorThread is also? >started in the RXTXPort constructor, which could mean that RXTX won't? >work at all if it isn't there. > >It seems to me, that if anyone would add an event listener and later? >on remove it, he could potentially wreak the port. Because the second? >action would kill the MonitorThread. > > >For the moment I am only trying to understand the role of and idea? >behind the MonitorThread. But of course there is a deeper reason thor? >my question: > >If the MonitorThread needs to exist anyway, it could be the thread? >that cleans up the port (ie calls nativeClose) - this would eliminate? >(a further) problem I am seeing with some USB drivers on Mac OSX.? >(Close blocks (after releasing the tty, but still) in the USB driver? >if the device is "not responding"). > >Greetings, >Joachim > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Sat May 13 10:07:37 2006 From: joachim at buechse.de (Joachim Buechse) Date: Sat, 13 May 2006 18:07:37 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Douglas, Looking at the current code, leaves me with the feeling, that there is a lot to do. Defining an API that wraps javax.comm to provide what you describe is certainly possible, but I wonder how much benefit it will actually provide. Personally I think the API defined by javax.comm "request/lock" a port with: cp= new CommunicationPort(identifier) "release" a port with: cp.close(); works quite nice for 99% of the applications. In my experience, the most efficient and elegant implementation is to wrap a port/socket/.. into a business object which declares the remote operations that are possible. Ie "uploadFile", "waitForPrompt", "getSerialNumber", "sendContact", "executeCommand", etc Those methods are then either synchronized or guarded by a monitor. I do not see how your design pattern applied to the port resource would help implementing this. [details start, skip if you agree to the above] When I talked about "thread-safe" I didn't mean several independent "sessions" accessing the port concurrently. I think this is a very rare usage. I believe the most common use case for serial ports today is the control of an external device from a PC running a GUI based application. To implement a clean Swing/AWT-GUI one needs to pass any action that can block to a "worker" thread (else the GUI blocks, the application appears dead). While it is possible to use own prespawned thread that will accept Runnables which operate on the port, this is not very elegant. It is more common to spawn a new thread for every action triggered by the user. Additionally the ABORT of a running operation is often implemented via a port.close() delegated to a different thread. - During the lifetime of a port, it will usually be accessed from several different threads. Instance variables need to be set/read in synchronized regions to guarantee a correct operation based on the Java memory model. - Synchronizing the access is usually handled on the application level (synchronizing the reads/writes is usually useless from the applications view because it is not a transaction mechanism). [details end] I am very open to learn about other scenarios where your proposed design pattern applied to the port resource is beneficial to the application implementor. Best regards, Joachim On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > Dmitry suggests that we acquire an implementation of > a serial port reference, use it, then release it (i.e., check it > back in). > > Joachim says that making serial ports thread friendly might be a > good idea. > > This is a good idea. The design pattern that is close to this idea > is the "Object Pool Design Pattern". > # Object Pool From jredman at ergotech.com Sun May 14 14:28:24 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 14:28:24 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers Message-ID: <446792E8.4000506@ergotech.com> Does anyone know of any work to make RXTX work with Ethernet (telent) Terminal Servers? If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? We've used RXTX with upwards of 100 virtual COM ports on Windows and it works well. Linux is more problematic. It would be good to have an OS independent solution to accesses remote Ethernet serial ports. Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From legolas.w at gmail.com Sun May 14 14:26:34 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:56:34 +0430 Subject: [Rxtx] does any one have a working sample of RXTX and LPT port Message-ID: <4467927A.4000008@gmail.com> Hi Thank you for reading my post does any one has a working sample for RXTX and LPT port ? Thanks From legolas.w at gmail.com Sun May 14 14:27:29 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:57:29 +0430 Subject: [Rxtx] does RXTX support Trigerr on parallel port? Message-ID: <446792B1.4040905@gmail.com> Hi does RXTX support trigger on LPT port ? if so , how i can use it ? Thanks From tjarvi at qbang.org Sun May 14 17:40:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 17:40:59 -0600 (MDT) Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: <446792E8.4000506@ergotech.com> References: <446792E8.4000506@ergotech.com> Message-ID: On Sun, 14 May 2006, Jim Redman wrote: > Does anyone know of any work to make RXTX work with Ethernet (telent) > Terminal Servers? > > If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 > Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? > Hi Jim It appears the author of NVTCom has decided to release the library into the public domain. Integration with rxtx is possible but it would be best to contact the author and find out what his intent is. I would suggest contacting the author with a proposal of what you would like to do and take it from there. We could 'take' public domain software but its better to show respect to the authors and respect their wishes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:10:23 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:10:23 -0600 (MDT) Subject: [Rxtx] does any one have a working sample of RXTX and LPT port In-Reply-To: <4467927A.4000008@gmail.com> References: <4467927A.4000008@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > Thank you for reading my post > does any one has a working sample for RXTX and LPT port ? > Thanks Hi Legolas LPT port support in rxtx is spotty. That means some people have sent in patches for what they do and it works well for them. The original code was not very good. It may have been 3 hours work :/ To get started, Sun has some demo programs with their commapi. With rxtx 2.1 you can change their code from using javax.com to gnu.io and it -should- work. But if it does not you can post here and on bugzilla. There has been more interest lately off the list and maybe there will be enough community resources to get what you need going. If you do get a sample program together, we would gladly put it in the contrib directory so the next person can get things going faster. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:12:12 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:12:12 -0600 (MDT) Subject: [Rxtx] does RXTX support Trigerr on parallel port? In-Reply-To: <446792B1.4040905@gmail.com> References: <446792B1.4040905@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > does RXTX support trigger on LPT port ? > if so , how i can use it ? > Hi Legolas As mentioned in the previous post, rxtx parallel support is not very mature. But if you can point to something that describes the trigger feature, we can probably make sure its there and give a quick code example. -- Trent Jarvi tjarvi at qbang.org From jredman at ergotech.com Sun May 14 22:22:48 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 22:22:48 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: References: <446792E8.4000506@ergotech.com> Message-ID: <44680218.4080008@ergotech.com> Trent, Trent Jarvi wrote: > On Sun, 14 May 2006, Jim Redman wrote: > >> Does anyone know of any work to make RXTX work with Ethernet (telent) >> Terminal Servers? >> >> If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 >> Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? >> > > Hi Jim > > It appears the author of NVTCom has decided to release the library into > the public domain. Integration with rxtx is possible but it would be best > to contact the author and find out what his intent is. > > I would suggest contacting the author with a proposal of what you would > like to do and take it from there. We could 'take' public domain software > but its better to show respect to the authors and respect their wishes. > I sent Marco(?), the author of the library, a note before asking the list - I'll let you know the response. If anyone is already working on it, or has an interest and more time and energy than me, I'd hate to duplicate the efforts. If no one is, and no one objects, maybe I'll see what I can do. Jim > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From Christian.Klemke at t-online.de Mon May 15 02:23:06 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Mon, 15 May 2006 10:23:06 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu><004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: <008a01c677f8$cae18590$02fea8c0@NB600> Hi Trent, Hi Paul, I finally found some time to create a simple patch to enable the optional suppression of version output to the console. It is based on a new system property called "gnu.io.rxtx.NoVersionOutput" which can by set to "true" if necessary. I had some problems accessing CVS, therefore I downloaded the rxtx-2.1-7r2 source archive from ftp.qbang.org (which is linked on the rxtx.org download page) and worked with that release. Please find my proposed patch in the attachment ! Regards, Christian ----- Original Message ----- From: "Trent Jarvi" To: "RXTX Developers and Users" Cc: ""Paul Gettings"" Sent: Friday, May 05, 2006 2:09 PM Subject: Re: [Rxtx] RXTX causing stdout messages > On Fri, 5 May 2006, Christian Klemke wrote: > >> Hi Paul, >> >> I was wondering about the same question some days ago and took a look at >> the >> source files. Unfortunately, I found that you can only get rid of that >> messages by altering and recompiling the Java code. There is a final >> static >> boolean variable called "devel" in the file "RXTXCommDriver.java" which >> is >> set to "true". This constellation causes the output after the native >> libraries have been loaded. No mechanism exists to suppress them >> otherwise >> :-(. >> >> Trent, does that mean that 2.1.7 is still officially a "development" >> version >> ? When will this value be changed to "false" by default ? With 2.1.8 ? It >> would be nice to provide a means to suppress such messages besides that >> static flag (maybe by setting a property called >> "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The >> output can indeed by annoying, especially when used with console >> applications, where the message potentially appears "in the middle" of >> your >> own output. Another possibility would be not to use System.out directly, >> but >> instead some PrintStream field which is initially set to System.out but >> can >> programatically be changed. That would allow for any kind of redirection >> or >> suppression by implementing appropriate user-defined PrintStream >> subclasses >> and making RXTX use that stream. What do you think ? >> > > A patch for using properties would be accepted I'm sure. > > The reason the default is to display the message is not related to the > development state of rxtx anymore. The problem is that people first using > rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. > The message prevents a great deal of email thats easily explained by the > message. > > I question if we should support rxtx 2.0 at all anymore. > > If you post a patch in bugzilla, we'll put it into CVS this weekend. > we'll be going through and doing such things anyhow. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_version_output_patch.diff Type: application/octet-stream Size: 991 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060515/3173c2b6/rxtx_version_output_patch-0002.obj From lyon at docjava.com Mon May 15 06:06:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 May 2006 08:06:21 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Joachim makes several good points. Let me see if I can address some of them below: >Hello Douglas, > >Looking at the current code, leaves me with the feeling, that there? >is a lot to do. Yes! >Defining an API that wraps javax.comm to provide what? >you describe is certainly possible, but I wonder how much benefit it? >will actually provide. > >Personally I think the API defined by javax.comm > >"request/lock" a port with: > cp= new CommunicationPort(identifier) >"release" a port with: > cp.close(); > >works quite nice for 99% of the applications. I don't know what percentage of applications turn off locking, the way that I do in my version of the RXTX lib. I do know that this is not safe practice. I also know that it was motivated by the multi-platform nature of my code and that this was the only way I could make things work, at the time. Java does not appear to have a cross-platform standard for locking resources on various platforms. Each OS appears to have its own standard. The question of who breaks deadlocks and how this is done remains open, as this is not an easy question to resolve. Let me continue, below: > >In my experience, the most efficient and elegant implementation is to? >wrap a port/socket/.. into a business object which declares the? >remote operations that are possible. Ie "uploadFile",? >"waitForPrompt", "getSerialNumber", "sendContact", "executeCommand",? >etc Those methods are then either synchronized or guarded by a? >monitor. I do not see how your design pattern applied to the port? >resource would help implementing this. I have no problem with high-level wrappers that are application specific. That is a very good idea, but orthogonal with respect to the issue of deadlocks. More below: > >[details start, skip if you agree to the above] >When I talked about "thread-safe" I didn't mean several independent? >"sessions" accessing the port concurrently. I think this is a very? >rare usage. That is probably why turning locking off works so well! On the other hand, it is not safe and I shouldn't do it. >I believe the most common use case for serial ports today? >is the control of an external device from a PC running a GUI based? >application. To implement a clean Swing/AWT-GUI one needs to pass any? >action that can block to a "worker" thread (else the GUI blocks, the? >application appears dead). While it is possible to use own prespawned? >thread that will accept Runnables which operate on the port, this is? >not very elegant. It is more common to spawn a new thread for every? >action triggered by the user. Additionally the ABORT of a running? >operation is often implemented via a port.close() delegated to a? >different thread. Here lies the heart of serial port concern. An application opens a serial port and then dies. The application is restarted and finds the port locked. How do we clear the lock? Must the application's user reside in the UUCP group? Must installers of the serial port add users to the UUCP group? Should locking be handled at a high-level of abstraction in an operating system independent way? Should the implementation of the locking mechanism be translated into an API that is dependent on the OS convention? Suppose that we restrict the discussion to serial ports. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on inconsistent naming conventions. Hence my feeling that we need to mirror what is done in other API's; we need a locking toolkit that references peer methods, IMHO. >From the Java programming point of view, the locking API is portable across different platforms, but has, as its implementation, a native peer method that uses the conventions of the underlying OS. This enables portable resource locking (in theory!). Consider, for example: org.apache.commons.transaction.locking with: Interface LockManager at: http://jakarta.apache.org/commons/transaction/apidocs/org/apache/commons/transaction/locking/LockManager.html Or, more recently: java.util.concurrent.locks Interface Lock based on Doug Lea's code: http://kickjava.com/src/EDU/oswego/cs/dl/util/concurrent/ReadWriteLock.java.htm Should we incorporate a clean, portable design into serial port use, one that is consistent with current locking APIs? Basically, a comm port is a resource and resources are typically controlled by managers. Thus, I suggest that we make use of a CommPortManager to help control and centralize serial port usage. The question of how this is done remains open, IMHO, but using core API's like: java.util.concurrent.locks might not be amiss. High-level methods (getAllPorts, getAllSerialPorts, getAllParallelPorts, etc...) might be welcome additions. Basic questions like, "what if a port is in use?" remain open, hence my proposal for the new design pattern. Isn't it the CommPortManager's role to break the deadlock? Cheers! - Doug > >- During the lifetime of a port, it will usually be accessed from? >several different threads. Instance variables need to be set/read in? >synchronized regions to guarantee a correct operation based on the? >Java memory model. >- Synchronizing the access is usually handled on the application? >level (synchronizing the reads/writes is usually useless from the? >applications view because it is not a transaction mechanism). >[details end] > >I am very open to learn about other scenarios where your proposed? >design pattern applied to the port resource is beneficial to the? >application implementor. > >Best regards, >Joachim > >On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > >> Dmitry suggests that we acquire an implementation of >> a serial port reference, use it, then release it (i.e., check it? >> back in). >> > > Joachim says that making serial ports thread friendly might be a? >> good idea. >> >> This is a good idea. The design pattern that is close to this idea >> is the "Object Pool Design Pattern". >> # Object Pool > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Mon May 15 06:58:19 2006 From: joachim at buechse.de (Joachim Buechse) Date: Mon, 15 May 2006 14:58:19 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Doug, I agree fully, that locking of the system resource should be abstracted from the user (programmer). Currently this is already the case, but I agree it might be nice to extract the code into a separate class, which uses platform dependent providers to do its job. What I described in my email was not targeted at allocating the system resource, but at handling an already allocated system resource inside the framework. I agree that it may be possible to combine the two - however, I would suggest to do this in phase2. I can contribute a work over of RXTXPort.java which implements clean internal locking and proper close behavior (which I would call phase 1). I could do this this week. However I strongly believe that there is little sense in trying to do this as a series of patches. It will be closer to a rewrite than to a patch. I have already provided a number of suggested patches via Bugzilla, but this is quite inconvenient (for me). My working copy diverges more and more from the master and hence it gets more and more annoying to provide self contained patches. Best regards, Joachim From tjarvi at qbang.org Mon May 15 08:27:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 May 2006 08:27:51 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Mon, 15 May 2006, Joachim Buechse wrote: > Hello Doug, > > I agree fully, that locking of the system resource should be > abstracted from the user (programmer). Currently this is already the > case, but I agree it might be nice to extract the code into a > separate class, which uses platform dependent providers to do its job. > > What I described in my email was not targeted at allocating the > system resource, but at handling an already allocated system resource > inside the framework. I agree that it may be possible to combine the > two - however, I would suggest to do this in phase2. > > I can contribute a work over of RXTXPort.java which implements clean > internal locking and proper close behavior (which I would call phase > 1). I could do this this week. > > However I strongly believe that there is little sense in trying to do > this as a series of patches. It will be closer to a rewrite than to a > patch. I have already provided a number of suggested patches via > Bugzilla, but this is quite inconvenient (for me). My working copy > diverges more and more from the master and hence it gets more and > more annoying to provide self contained patches. > For methodical testing purposes (which does go on) the incremental patches are better. I'm lagging behind in bugzilla but thats soon to change (this week). It has just been rather chaotic up until now. I moved, purchased a house, and jumped into the fire of a feature freeze timeframe at a new job. btw, we see the Solaris close issues on 2.8 also. 9 and 10 are fine. I'll work towards making those test results public and allow others to run new rxtx code through them. We had the OK at one point but setting up the environment is involved. It isn't just a collection of java classes. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Tue May 16 02:01:47 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:01:47 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] Message-ID: <446986EB.209@willicon.de> Hi, any ideas for my problem? Hans -------- Original-Nachricht -------- Betreff: [Rxtx] Problem under Mac OSX 10.3.9 Datum: Mon, 08 May 2006 18:47:20 +0200 Von: WILLICon Antwort an: RXTX Developers and Users An: RXTX Developers and Users Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/b0741c2b/attachment-0002.html From joachim at buechse.de Tue May 16 02:15:08 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 10:15:08 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: Hello Hans, I am using RXTX on OS X for my own project. I do not see the problem you describe. I had some troubles installing it because the current version uses lock files which is non-standard on OS X. I have created a patched version which I currently use. This version does not need to modify user groups and hence does not need an installer. I just pop it in the application directory. If you send me a link where I can download your OSX installer, I will have a quick look. Regards, Joachim On 16.05.2006, at 10:01, WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we > have some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + > spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + > spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always > the value "false". > I can only get the status, while I open the port and catch the > exception. > > Any ideas? > > Hans > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail at willicon.de Tue May 16 02:26:53 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:26:53 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: References: <446986EB.209@willicon.de> Message-ID: <44698CCD.7050709@willicon.de> Joachim, tanks for the answer. I'll send You a mail. Hans Joachim Buechse schrieb: > Hello Hans, > > I am using RXTX on OS X for my own project. I do not see the problem > you describe. > > I had some troubles installing it because the current version uses > lock files which is non-standard on OS X. I have created a patched > version which I currently use. This version does not need to modify > user groups and hence does not need an installer. I just pop it in > the application directory. If you send me a link where I can download > your OSX installer, I will have a quick look. > > Regards, > Joachim > > On 16.05.2006, at 10:01, WILLICon wrote: > > >> Hi, >> >> any ideas for my problem? >> >> Hans >> >> -------- Original-Nachricht -------- >> Betreff: [Rxtx] Problem under Mac OSX 10.3.9 >> Datum: Mon, 08 May 2006 18:47:20 +0200 >> Von: WILLICon >> Antwort an: RXTX Developers and Users >> An: RXTX Developers and Users >> >> >> Hi, >> >> I use for RXTX for communicate with CyclingComputers. >> >> It works good under Win32, Sloaris and Linux but with Mac OSX we >> have some problems. >> >> My users install the Mac OSX serial lib from the actual binary. >> >> After starting the program, they get this error message: >> >> java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while >> loading gnu.io.RXTXCommDriver >> >> Remember, this error comes only under Mac OSX. >> >> That is the code for the error: >> >> Enumeration portList = CommPortIdentifier.getPortIdentifiers(); >> spInUse = getBundleStr("serialPortInUse"); >> spFree = getBundleStr("serialPortFree"); >> while (portList.hasMoreElements()) { >> CommPortIdentifier portId = (CommPortIdentifier) >> portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (osName != null && osName.startsWith("mac")) { >> if (!portId.getName().startsWith("dev/cu.")) { >> continue; >> } >> } >> if (portId.isCurrentlyOwned()) { >> serialPortNames.add(portId.getName() + " - " + >> spInUse); >> } >> else { >> serialPortNames.add(portId.getName() + " - " + >> spFree); >> } >> } >> } >> if (serialPortNames.size() == 0) { >> serialPortNames.add(getBundleStr("serialPortNotFound")); >> } >> >> BTW: The methode isCurrentlyOwned() is not working. I get always >> the value "false". >> I can only get the status, while I open the port and catch the >> exception. >> >> Any ideas? >> >> Hans >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/948333be/attachment-0002.html From jredman at ergotech.com Tue May 16 07:35:52 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 16 May 2006 07:35:52 -0600 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: <4469D538.6070408@ergotech.com> Hans, I have no direct insight, but would note that what you have is a "NoClassDefFoundError" not a "ClassNotFoundException". So the class javax/comm/CommDriver is found, but one of its dependencies is missing. NoClassDefFoundError are a bigger problem to resolve because you get no indication of the real problem. Jim WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we have > some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > * spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always the > value "false". > I can only get the status, while I open the port and catch the exception. > > Any ideas? > > Hans > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.de Tue May 16 08:01:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 16:01:21 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 In-Reply-To: <4469AFC3.6000002@willicon.de> References: <44698EBC.8000008@willicon.de> <8C5680C4-E2BA-42FF-B221-36E1124FA6A4@buechse.de> <4469AFC3.6000002@willicon.de> Message-ID: <9825A602-D6ED-4C28-BF33-9A7C984FACD5@buechse.de> Hallo Hans, you include RXTX 2.17 in your "bikeXexperience.jar" (2.17 uses Interfaces from gnu.io.* not javax.comm.*). Now inspect your error log closely: The class gnu.io.RXTXCommDriver tries to load javax.comm.CommDriver: this is only the case for RXTX 2.07. I assume, that the user has installed Version 2.07 into one of the java.ext.dirs . The VM always tries to load classes from the "system" path first. The current Mac installer distributed with RXTX in fact installs RXTXcomm.jar and librxtxSerial.jnilib into /Library/Java/Extensions. (I wrote some time ago that I consider this as a bad idea because of potential version conflicts-> thanks for delivering the example). For 2.07 it does so without installing the javax.comm classes it seems. I would recommend that you instruct your users to install version 2.17 only. Until RXTX is changed to use TIOCEXCL instead of lock files, you can hardly avoid the installer, as the user needs to be added to a special group and a lockfile directory needs be created. More precisely you are waiting for: http://bugzilla.qbang.org/show_bug.cgi?id=50 [RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL)] Regards, Joachim -------------- next part -------------- A non-text attachment was scrubbed... Name: log.tiff Type: image/tiff Size: 38394 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/e3e52128/log-0002.tiff -------------- next part -------------- > > Ich verwende RXTX 2.17. Das orginal RXTXcomm.jar ist in > CyclingDataManager.jar enthalten. > From tjarvi at qbang.org Wed May 17 23:18:15 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 May 2006 23:18:15 -0600 (MDT) Subject: [Rxtx] update Message-ID: So we have several patches and these have stacked up. I'd like to thank everyone for being patient. Tests for the most intrusive patches look good so far. I still have to get some bits together on my end but it looks like we can catch everything up in CVS this week. I'll try to post a normal list of what went in by whom with links Saturday. But I'm not seeing anything that raises flags yet. I also think I'll be able to submit a patch for nonstandard baud rates. I have to confirm w32 but I think its going to be a one line fix. I don't know if its bugzilla or people tinkering with patch files before submitting but patches are not applying cleanly. So the patches have to be done by hand. This may make things difficult for people hoping to add other patches on top. I'm trying to make that go well but ... -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Thu May 18 02:23:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 May 2006 10:23:47 +0200 Subject: [Rxtx] update In-Reply-To: References: Message-ID: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Hello Trent, in fact I tinkered with the patches (never used this mechanism before, usually I "communicate" via cvs) ... so sorry for any trouble you had applying them. Basicly I edited the patches to make them self contained. Having the tests run with different speeds on different platforms, may well be an effect of caching. I have seen quite interesting propagation delays for the closing flag on my PowerPC system, which makes me doubt, that the propagation of output_buffer_empty_flag works as it should. Maybe the communication mechanism between the two threads should be replaced by something like pthread_cond_*. Could you describe which problems you see on Solaris/SPARC? I'd be interested to see if they exist on OS X (PowerPC) as well... As you seem to work on the stuff at the moment I would like to suggest the following additions (it looks more than it is, I posted some context to make clear where to apply the change). See the comments in braces for what was changed Greetings, Joachim (1) The end of the drain loop could be: --- report("drain_loop: received EINTR in tcdrain\n"); --- (added "in tcdrain" to make debug output clearer) (2) The start of the drain loop should be: --- for(i=0;;i++) { report_verbose("drain_loop: looping\n"); #if defined(__sun__) /* FIXME: No time to test on all OS's for production */ if( eis->eventloop_interrupted ) { goto end; } if (usleep(5000)) { report("drain_loop: received EINTR"); } #else if (usleep(1000000)) { report("drain_loop: received EINTR"); } #endif /* __sun__ */ --- (added a check for "eis->eventloop_interrupted" before the sleep) (3) The end of interrupt_event_loop could (and maybe should) be: --- #if !defined(TIOCSERGETLSR) && !defined(WIN32) /* make sure that the drainloop unblocks from tcdrain */ pthread_kill(index->drain_tid, SIGABRT); /* TODO use wait/join/SIGCHLD/?? instead of sleep? */ usleep(50 * 1000); /* Under normal conditions, SIGABRT will unblock tcdrain. However a non-responding USB device combined with an unclean driver may still block. This is very ugly because it may block the call to close indefinetly. */ if (index->closing != 1) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); index->closing = 1; } #endif report("interruptEventLoop: interrupted\n"); --- (added some comments and pthread_cancel for resisting drain thread) On 18.05.2006, at 07:18, Trent Jarvi wrote: > > So we have several patches and these have stacked up. I'd like to > thank > everyone for being patient. > > Tests for the most intrusive patches look good so far. I still > have to > get some bits together on my end but it looks like we can catch > everything > up in CVS this week. > > I'll try to post a normal list of what went in by whom with links > Saturday. But I'm not seeing anything that raises flags yet. I also > think I'll be able to submit a patch for nonstandard baud rates. > I have > to confirm w32 but I think its going to be a one line fix. > > I don't know if its bugzilla or people tinkering with patch files > before > submitting but patches are not applying cleanly. So the patches > have to > be done by hand. This may make things difficult for people hoping > to add > other patches on top. I'm trying to make that go well but ... > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu May 18 22:28:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 18 May 2006 22:28:00 -0600 (MDT) Subject: [Rxtx] update In-Reply-To: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> References: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Message-ID: On Thu, 18 May 2006, Joachim Buechse wrote: > Hello Trent, > > in fact I tinkered with the patches (never used this mechanism > before, usually I "communicate" via cvs) ... so sorry for any trouble > you had applying them. Basicly I edited the patches to make them self > contained. I think we are close to moving towards that. > > Having the tests run with different speeds on different platforms, > may well be an effect of caching. I have seen quite interesting > propagation delays for the closing flag on my PowerPC system, which > makes me doubt, that the propagation of output_buffer_empty_flag > works as it should. Maybe the communication mechanism between the two > threads should be replaced by something like pthread_cond_*. Could > you describe which problems you see on Solaris/SPARC? I'd be > interested to see if they exist on OS X (PowerPC) as well... This is interesting. I have seen problems with output buffer empty in applications that require it. I'm trying to get a bug list and or test results open for everyone to see but that may take time. But missed output buffer events ... yep. With Sparc, we have seen a few things. One was a kernel race condition that went away when we reimaged and updated 2.8. RXTX was hanging on close, top showed no cpu use but there was 2 second delays just typing on console. The other is our tests now take ~4 times longer on Solaris. Someone is looking at timing just open, close, read, write, ... to see if they can find where the slowdown is. This happened after solaris 2.8. I'll try to share more when/if there is something interesting. This may well not be solvable in userland. > > As you seem to work on the stuff at the moment I would like to > suggest the following additions (it looks more than it is, I posted > some context to make clear where to apply the change). See the > comments in braces for what was changed I'll take a look. This could all come together Saturday but I also have an event to attend that day. I may not wrap this up until Sunday. -- Trent Jarvi tjarvi at qbang.org From andrewlord at internode.on.net Sun May 21 20:10:02 2006 From: andrewlord at internode.on.net (Andrew Lord) Date: Mon, 22 May 2006 11:40:02 +0930 Subject: [Rxtx] Kernel include files do not match kernel Message-ID: <200605221140.03271.andrewlord@internode.on.net> Hi, I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel 2.6.12-18 with the command: ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include However I get the message: ## checking java.version 1.5.0_06 ## checking os.version 2.6.12-18mdk ## ## WARNING: Kernel include files do not match the current kernel ## ## configure: creating ./config.status etc. Is there a problem with the way I'm specifying the 'include' directory ? If not, how else can I specify the correct directory for the include files please ? Cheers, Andrew From tjarvi at qbang.org Sun May 21 20:31:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 May 2006 20:31:31 -0600 (MDT) Subject: [Rxtx] Kernel include files do not match kernel In-Reply-To: <200605221140.03271.andrewlord@internode.on.net> References: <200605221140.03271.andrewlord@internode.on.net> Message-ID: On Mon, 22 May 2006, Andrew Lord wrote: > Hi, > > I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel > 2.6.12-18 with the command: > > ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk > CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include > > However I get the message: > > ## checking java.version 1.5.0_06 > ## checking os.version 2.6.12-18mdk > ## > ## WARNING: Kernel include files do not match the current kernel > ## > ## configure: creating ./config.status > etc. > > Is there a problem with the way I'm specifying the 'include' directory ? If > not, how else can I specify the correct directory for the include files > please ? > Hi Andrew I'm fairly sure your --with-kernel option does nothing. The CPPFLAGS should do what you want. Maybe put an #error message in /usr/src/linux.../incude/linux/version.h But I don't recall a recent problem with version missmatches. It should work. Distros will even ship include files that don't match versions exactly. In theory it should never matter for users. I used to compile new kernels by hand and really didnt have a distro. I didnt have a seperate package of kernel headers for users (myself). When changing a gateway from linux 1.2.12 to 2.1.77, I would worry about such messages. So if you are doing something that weird, the message may be of use to you. If you just see the message on a distro you installed, it is more than likely harmless. -- Trent Jarvi tjarvi at qbang.org From mrogers at spro.net Mon May 22 14:45:39 2006 From: mrogers at spro.net (Mike Rogers) Date: Mon, 22 May 2006 14:45:39 -0600 Subject: [Rxtx] Sun's CommAPI -- think May? Message-ID: <447222F3.9040302@spro.net> Hi, Any word from Sun about progress towards fixing the Java CommAPI v3 "incompatibilities" so RXTX 2.0 can operate within the framework's namespace (javax.comm)? I recall mention of a May time frame. Thanks, Mike From paul.klissner at sun.com Mon May 22 15:09:27 2006 From: paul.klissner at sun.com (Paul Klissner) Date: Mon, 22 May 2006 14:09:27 -0700 Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <447222F3.9040302@spro.net> References: <447222F3.9040302@spro.net> Message-ID: <44722887.8080308@sun.com> Mike Rogers wrote: > Hi, > > Any word from Sun about progress towards fixing the Java CommAPI v3 > "incompatibilities" so RXTX 2.0 can operate within the framework's > namespace (javax.comm)? I recall mention of a May time frame. > > Thanks, > > Mike > We've had a lot of work come in. This hasn't been the only priority. I'm running behind the plan in addressing this, but will be looking at it again soon. Rather than state a new, I'll just say it is in progress, and not off the table. I'll get this fixed as soon as I can. Good timing for asking as we just started discussing javax.comm plans today, and I'll have some cycles to work on it soon. Paul From yhua537 at cse.unsw.edu.au Mon May 22 16:03:05 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Tue, 23 May 2006 08:03:05 +1000 (EST) Subject: [Rxtx] install rxtx in XP Message-ID: Hi Guys, I am new to serial port programming, and have no experience on programming java in xp, but my project require me to builld a communication link between xp and a UART device. Most of the information in the web site seems for linux only. including the commands such as export and chmod. How do I install rxtx in xp? cheers YiQi Huang From mark at mdsh.com Tue May 23 01:24:20 2006 From: mark at mdsh.com (Mark Himsley) Date: Tue, 23 May 2006 08:24:20 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off , it includes DLLs for Windows and the JAR for Java. Follow the Windows instructions in the INSTALL. ie RXTXcomm.jar goes in \jre\lib\ext (under java) rxtxSerial.dll goes in \jre\bin So, assuming a fairly standard Java install, copy RXTXcomm.jar into C:\Program Files\Java\jre1.5.0_06\lib\ext and copy rxtxSerial.dll into C:\Program Files\Java\jre1.5.0_06\bin Yes, it really is that simple. On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > I am new to serial port programming, and have no experience on > programming java in xp, but my project require me to builld a > communication link between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang -- Mark Himsley From joachim at buechse.de Tue May 23 02:51:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 23 May 2006 10:51:47 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) Unless it is absolutely required you should NOT install RXTX in your global Java Runtime Environment. This will for sure create versioning conflicts - if not now, than in the future, if not on your system than at your clients. Instead put the dll in your application directory and include the RXTXcomm.jar in your classpath. This is much safer and not a bit more complicated. Regards, Joachim On 23.05.2006, at 09:24, Mark Himsley wrote: > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR > for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > >> I am new to serial port programming, and have no experience on >> programming java in xp, but my project require me to builld a >> communication link between xp and a UART device. >> >> Most of the information in the web site seems for linux only. >> including >> the commands such as export and chmod. How do I install rxtx in xp? >> >> cheers >> YiQi Huang > > > > -- > Mark Himsley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tod at todbot.com Tue May 23 03:12:22 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 02:12:22 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I totally agree: do not contaminate the Java installation. I put all the RXTX files in a directory and then change my java invocation to be: % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* Alternatively, use Launch4J to create a double-clickable application and keep the RXTX libraries in the directory of the application. -=tod On May 23, 2006, at 1:51 AM, Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > >> Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off >> , it includes DLLs for Windows and the JAR >> for Java. >> >> Follow the Windows instructions in the INSTALL. >> >> ie >> >> RXTXcomm.jar goes in \jre\lib\ext (under java) >> rxtxSerial.dll goes in \jre\bin >> >> So, assuming a fairly standard Java install, copy RXTXcomm.jar into >> C:\Program Files\Java\jre1.5.0_06\lib\ext >> and copy rxtxSerial.dll into >> C:\Program Files\Java\jre1.5.0_06\bin >> >> Yes, it really is that simple. >> >> >> >> On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: >> >>> I am new to serial port programming, and have no experience on >>> programming java in xp, but my project require me to builld a >>> communication link between xp and a UART device. >>> >>> Most of the information in the web site seems for linux only. >>> including >>> the commands such as export and chmod. How do I install rxtx in xp? >>> >>> cheers >>> YiQi Huang >> >> >> >> -- >> Mark Himsley >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From smontgomery at mediaspansoftware.com Tue May 23 08:46:53 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Tue, 23 May 2006 10:46:53 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: Message-ID: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Joachim and Tod mentioned how to keep the files RXTX requires on Windows XP out of the Java installations - thanks gentlemen! Are there similar suggestions for an RXTX install on OS X? The current "canonical" OS X installation instructions "contaminate the Java installation", to use Tod's words. Our app will run fine under 1.4.2 and 5.0 on OS X, and a lot of users will have both. We've already been burned by the recent switch from 1.4.2 to 5.0 as the platform default. Any suggestions welcomed. From tod at todbot.com Tue May 23 13:27:55 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 12:27:55 -0700 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <9BA0F670-A862-42E7-BB2C-130D775ABDF9@todbot.com> Hi Sean, It depends on how you build and deploy your code. If you're using shell scripts, you can do something like this: #!/bin/sh # pick one JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/ Commands/java #JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/ Commands/java $JAVA -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* That both picks which VM to use and uses the RXTX in the directory called 'rxtxlib'. If you want your shell script to be clever, you could test for the existence of the different 'java' executables and go from there (maybe even use different jar files). I am almost positive all OS X systems with Java 1.5 are guaranteed to also have Java 1.4.2. If you're using Jar Builder or XCode, you can specify which JVM to use and add the extra args in the Info.plist file. The paths specified in the 'java' invocation then are based off of the $JAVAROOT variable that the JavaApplicationStub sets for you. For my app, I've have been compiling two sets of jars, one compiled with 1.4.2 and one with 1.5, but they both run under 1.5. So I have a similar shell script that chooses a different 'javac' depending on the need. -=tod On May 23, 2006, at 7:46 AM, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From yhua537 at cse.unsw.edu.au Tue May 23 11:09:37 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 03:09:37 +1000 (EST) Subject: [Rxtx] install rxtx in XP (Mark Himsley, Joachim Buechse, Tod E. Kurt> In-Reply-To: References: Message-ID: > Message: 8 > Date: Tue, 23 May 2006 08:03:05 +1000 (EST) > From: YiQi Huang > Subject: [Rxtx] install rxtx in XP > To: rxtx at qbang.org > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > Hi Guys, > > I am new to serial port programming, and have no experience on programming > java in xp, but my project require me to builld a communication link > between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang > > > ------------------------------ > > Message: 9 > Date: Tue, 23 May 2006 08:24:20 +0100 > From: Mark Himsley > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=us-ascii; format=flowed > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > ------------------------------ > > Message: 10 > Date: Tue, 23 May 2006 10:51:47 +0200 > From: Joachim Buechse > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > > ------------------------------ > > Message: 11 > Date: Tue, 23 May 2006 02:12:22 -0700 > From: "Tod E. Kurt" > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I totally agree: do not contaminate the Java installation. > > I put all the RXTX files in a directory and then change my java > invocation to be: > > % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* > > Alternatively, use Launch4J to create a double-clickable application > and keep the RXTX libraries in the directory of the application. > > -=tod > > Hi, Thanks guys, I don't know if this is the correct way to reply your mecessage, if wrong, please point out. Thank you for Mark to give the detail instructions and Joachim to point out the cons ot installing in the java directory, and specially thanks for Tod to give the instrection in detail. Sorry to ask another stupid question: I have followed Tod's instruction. Now I think i am ready to start hacking. But where is the RXTX API documentation? Is it the same as using normal java comm API? btw, where could i find some examples to start with? Thanks very much cheers YiQi Huang From tjarvi at qbang.org Tue May 23 16:09:32 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 May 2006 16:09:32 -0600 (MDT) Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <44722887.8080308@sun.com> References: <447222F3.9040302@spro.net> <44722887.8080308@sun.com> Message-ID: > Good timing for asking as we just started discussing javax.comm plans > today, and I'll have some cycles to work on it soon. Hi Paul I assume you mean Sun is discussing plans concerning its own internal actions and there is no community involvment at this point. -- Trent Jarvi tjarvi at qbang.org From yhua537 at cse.unsw.edu.au Tue May 23 22:50:01 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 14:50:01 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } From mmester at sps.edu Tue May 23 22:58:21 2006 From: mmester at sps.edu (Michael Mester) Date: Wed, 24 May 2006 00:58:21 -0400 Subject: [Rxtx] install rxtx in XP References: Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below -----Original Message----- From: rxtx-bounces at qbang.org on behalf of YiQi Huang Sent: Wed 5/24/2006 12:50 AM To: RXTX Developers and Users Subject: Re: [Rxtx] install rxtx in XP Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3950 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060523/b36d0c63/attachment-0002.bin From yhua537 at cse.unsw.edu.au Tue May 23 23:05:50 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 15:05:50 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: Yes, Michael you are right, it should be semicolons, But it still can't find the correct library. On Wed, 24 May 2006, Michael Mester wrote: > I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below > > > -----Original Message----- > From: rxtx-bounces at qbang.org on behalf of YiQi Huang > Sent: Wed 5/24/2006 12:50 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] install rxtx in XP > > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > cheers YiQi Huang From tod at todbot.com Wed May 24 00:01:57 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 23:01:57 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Yes, sorry, classpath entries are semicolon-separated on Windows and colon-separated on everything else. Your example code below is importing the wrong set of classes. It should not "import javax.comm.*", instead it should "import gnu.io.*". When I make that change, your example program compiles. The "javax.comm" package is the one released by Sun, the "gnu.io" package is the RXTX one. You might've seen some discussion that the two will be merged or become compatible, but that hasn't happened yet. -=tod On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > > Yes, Michael you are right, it should be semicolons, But it still > can't > find the correct library. > > On Wed, 24 May 2006, Michael Mester wrote: > >> I believe the entries in the classpath need to be seperated with >> semicolons, not a colon as you have in your command below >> >> >> -----Original Message----- >> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >> Sent: Wed 5/24/2006 12:50 AM >> To: RXTX Developers and Users >> Subject: Re: [Rxtx] install rxtx in XP >> >> Hi, >> >> Sorry guys.I follow Tod's instruction, and here is what i did: >> >> put >> RXTXcomm.jar, >> rxtxParallel.dll, >> rxtxSerial.dll >> in >> C:\RXTX_files >> >> and I got a SimpleRead class attached below, compile it with : >> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >> it still saying "cannot find symbol". >> >> Is there anything I did wrong? Do I need the comm.jar from Sun? >> >> Thanks & regards >> YiQi Huang >> >> >> //////////////////////////////////////////////////////// >> // SimpleRead.java >> //////////////////////////////////////////////////////// >> >> import java.io.*; >> import java.util.*; >> import javax.comm.*; >> >> public class SimpleRead >> implements Runnable, SerialPortEventListener { >> static CommPortIdentifier portId; >> static Enumeration portList; >> InputStream inputStream; >> SerialPort serialPort; >> Thread readThread; >> public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == >> CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals("COM1")) { >> //if (portId.getName().equals("/dev/term/a")) { >> SimpleRead reader = new SimpleRead(); >> } >> } >> } >> } >> public SimpleRead() { >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", >> 2000); >> } catch (PortInUseException e) {} >> try { >> inputStream = serialPort.getInputStream(); >> } catch (IOException e) {} >> try { >> serialPort.addEventListener(this); >> } catch (TooManyListenersException e) {} >> serialPort.notifyOnDataAvailable(true); >> try { >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } catch (UnsupportedCommOperationException e) {} >> readThread = new Thread(this); >> readThread.start(); >> } >> public void run() { >> try { >> Thread.sleep(20000); >> } catch (InterruptedException e) {} >> } >> public void serialEvent(SerialPortEvent event) { >> switch(event.getEventType()) { >> case SerialPortEvent.BI: >> case SerialPortEvent.OE: >> case SerialPortEvent.FE: >> case SerialPortEvent.PE: >> case SerialPortEvent.CD: >> case SerialPortEvent.CTS: >> case SerialPortEvent.DSR: >> case SerialPortEvent.RI: >> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >> break; >> case SerialPortEvent.DATA_AVAILABLE: >> byte[] readBuffer = new byte[20]; >> try { >> while (inputStream.available() > 0) { >> int numBytes = inputStream.read(readBuffer); >> } >> System.out.print(new String(readBuffer)); >> } catch (IOException e) {} >> break; >> } >> } >> } >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > cheers > YiQi Huang > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From joachim at buechse.de Wed May 24 00:10:06 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:10:06 +0200 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Hi Sean, my preferred way of dealing with RXTX on OS X is to include the RXTX classes into my application jar and to put the RXTX lib in the same directory as this jar. To make it even more comfortable, you can include the lib in the jar and have some startup code extract it and write it to a temporary file from which you load it with System.load(). Unfortunately the current version of RXTX for OS X requires tinkering with user groups as it is based on lockfiles - and hence it needs the RXTX OS X installer or you need to duplicated this functionality in your own installer. I have created my own native version which is not based on lockfiles but tty locking (the standard way to do it on OSX). I hope that these patches will be integrated soon into the distribution. Regards, Joachim On 23.05.2006, at 16:46, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Wed May 24 00:16:12 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:16:12 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <7017ECFC-B13E-4806-B321-9FFCAC5830F0@buechse.de> I assume you downloaded rxtx-217 (not 207). Instead of importing javax.comm.* you must import gnu.io.* The classes have the same name, but they are not in the same package. On 24.05.2006, at 06:50, YiQi Huang wrote: > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From yhua537 at cse.unsw.edu.au Wed May 24 00:17:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 16:17:45 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Message-ID: Thanks Tod again, i kept reading "gnu.io.*" as "gun.io.*" last few hours after i read some commons from web. Thanks very much Tod. thanks YiQi Huang On Tue, 23 May 2006, Tod E. Kurt wrote: > Yes, sorry, classpath entries are semicolon-separated on Windows and > colon-separated on everything else. > > Your example code below is importing the wrong set of classes. It > should not "import javax.comm.*", instead it should "import > gnu.io.*". When I make that change, your example program compiles. > The "javax.comm" package is the one released by Sun, the "gnu.io" > package is the RXTX one. You might've seen some discussion that the > two will be merged or become compatible, but that hasn't happened yet. > > -=tod > > > On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > >> >> Yes, Michael you are right, it should be semicolons, But it still >> can't >> find the correct library. >> >> On Wed, 24 May 2006, Michael Mester wrote: >> >>> I believe the entries in the classpath need to be seperated with >>> semicolons, not a colon as you have in your command below >>> >>> >>> -----Original Message----- >>> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >>> Sent: Wed 5/24/2006 12:50 AM >>> To: RXTX Developers and Users >>> Subject: Re: [Rxtx] install rxtx in XP >>> >>> Hi, >>> >>> Sorry guys.I follow Tod's instruction, and here is what i did: >>> >>> put >>> RXTXcomm.jar, >>> rxtxParallel.dll, >>> rxtxSerial.dll >>> in >>> C:\RXTX_files >>> >>> and I got a SimpleRead class attached below, compile it with : >>> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >>> it still saying "cannot find symbol". >>> >>> Is there anything I did wrong? Do I need the comm.jar from Sun? >>> >>> Thanks & regards >>> YiQi Huang >>> >>> >>> //////////////////////////////////////////////////////// >>> // SimpleRead.java >>> //////////////////////////////////////////////////////// >>> >>> import java.io.*; >>> import java.util.*; >>> import javax.comm.*; >>> >>> public class SimpleRead >>> implements Runnable, SerialPortEventListener { >>> static CommPortIdentifier portId; >>> static Enumeration portList; >>> InputStream inputStream; >>> SerialPort serialPort; >>> Thread readThread; >>> public static void main(String[] args) { >>> portList = CommPortIdentifier.getPortIdentifiers(); >>> while (portList.hasMoreElements()) { >>> portId = (CommPortIdentifier) portList.nextElement(); >>> if (portId.getPortType() == >>> CommPortIdentifier.PORT_SERIAL) { >>> if (portId.getName().equals("COM1")) { >>> //if (portId.getName().equals("/dev/term/a")) { >>> SimpleRead reader = new SimpleRead(); >>> } >>> } >>> } >>> } >>> public SimpleRead() { >>> try { >>> serialPort = (SerialPort) portId.open("SimpleReadApp", >>> 2000); >>> } catch (PortInUseException e) {} >>> try { >>> inputStream = serialPort.getInputStream(); >>> } catch (IOException e) {} >>> try { >>> serialPort.addEventListener(this); >>> } catch (TooManyListenersException e) {} >>> serialPort.notifyOnDataAvailable(true); >>> try { >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, >>> SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> } catch (UnsupportedCommOperationException e) {} >>> readThread = new Thread(this); >>> readThread.start(); >>> } >>> public void run() { >>> try { >>> Thread.sleep(20000); >>> } catch (InterruptedException e) {} >>> } >>> public void serialEvent(SerialPortEvent event) { >>> switch(event.getEventType()) { >>> case SerialPortEvent.BI: >>> case SerialPortEvent.OE: >>> case SerialPortEvent.FE: >>> case SerialPortEvent.PE: >>> case SerialPortEvent.CD: >>> case SerialPortEvent.CTS: >>> case SerialPortEvent.DSR: >>> case SerialPortEvent.RI: >>> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >>> break; >>> case SerialPortEvent.DATA_AVAILABLE: >>> byte[] readBuffer = new byte[20]; >>> try { >>> while (inputStream.available() > 0) { >>> int numBytes = inputStream.read(readBuffer); >>> } >>> System.out.print(new String(readBuffer)); >>> } catch (IOException e) {} >>> break; >>> } >>> } >>> } >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> >> cheers >> YiQi Huang >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From smontgomery at mediaspansoftware.com Wed May 24 10:24:13 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 12:24:13 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: Tod & Joachim, Thanks for the info, that's very helpful. I'll give that a whirl when I move to rxtx 2.1. I'm still using the older 2.0.7 version for now (don't ask), which probably requires the Sun comm.jar, javax.comm.properties and librxtxSerial.jnilib to be in very specific places in each jvm's file hierarchy. From tjarvi at qbang.org Wed May 24 11:59:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 11:59:16 -0600 (MDT) Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: On Wed, 24 May 2006, Sean Montgomery wrote: > Tod & Joachim, > > Thanks for the info, that's very helpful. I'll give that a whirl > when I move to rxtx 2.1. I'm still using the older 2.0.7 version for > now (don't ask), which probably requires the Sun comm.jar, > javax.comm.properties and librxtxSerial.jnilib to be in very specific > places in each jvm's file hierarchy. > You will need comm.jar from Sun then. It must be Sun's version 2.* or older for Linux or Solaris. I assume they have this in download archives. The default offering from Sun is version 3.0. This version currently does not support rxtx. The older version will probably be fine for your needs. -- Trent Jarvi tjarvi at qbang.org From smontgomery at mediaspansoftware.com Wed May 24 12:19:06 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 14:19:06 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: <3939EFB8-11E1-4E3E-A684-5B3C525577CD@mediaspansoftware.com> Yup, that's right, thanks Trent. I've been using these files for quite a while now. Thanks for bringing it up. I almost didn't mention using 2.0.7 because I didn't want to give any new members of the list the wrong idea! :-) On May 24, 2006, at 1:59 PM, Trent Jarvi wrote: > On Wed, 24 May 2006, Sean Montgomery wrote: > >> Tod & Joachim, >> >> Thanks for the info, that's very helpful. I'll give that a whirl >> when I move to rxtx 2.1. I'm still using the older 2.0.7 version for >> now (don't ask), which probably requires the Sun comm.jar, >> javax.comm.properties and librxtxSerial.jnilib to be in very specific >> places in each jvm's file hierarchy. >> > > You will need comm.jar from Sun then. It must be Sun's version 2.* or > older for Linux or Solaris. I assume they have this in download > archives. > > The default offering from Sun is version 3.0. This version > currently does > not support rxtx. > > The older version will probably be fine for your needs. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mark at mdsh.com Wed May 24 15:55:46 2006 From: mark at mdsh.com (Mark Himsley) Date: Wed, 24 May 2006 22:55:46 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <37B0FC4B1F3237321F093ABE@MacMini.local> On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) That's no problem. BUT, do note that the instructions I elaborated on are in the INSTALL file within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone please update the INSTALL file? > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > > , it includes DLLs for Windows and the JAR > > for Java. > > > > Follow the Windows instructions in the INSTALL. > > > > ie > > > > RXTXcomm.jar goes in \jre\lib\ext (under java) > > rxtxSerial.dll goes in \jre\bin > > > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > > C:\Program Files\Java\jre1.5.0_06\lib\ext > > and copy rxtxSerial.dll into > > C:\Program Files\Java\jre1.5.0_06\bin > > > > Yes, it really is that simple. > > > > > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > > > >> I am new to serial port programming, and have no experience on > >> programming java in xp, but my project require me to builld a > >> communication link between xp and a UART device. > >> > >> Most of the information in the web site seems for linux only. > >> including > >> the commands such as export and chmod. How do I install rxtx in xp? > >> > >> cheers > >> YiQi Huang > > > > > > > > -- > > Mark Himsley > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Mark Himsley From tjarvi at qbang.org Wed May 24 16:41:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 16:41:46 -0600 (MDT) Subject: [Rxtx] install rxtx in XP In-Reply-To: <37B0FC4B1F3237321F093ABE@MacMini.local> References: <37B0FC4B1F3237321F093ABE@MacMini.local> Message-ID: On Wed, 24 May 2006, Mark Himsley wrote: > > > On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > >> I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > That's no problem. > > BUT, do note that the instructions I elaborated on are in the INSTALL file > within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone > please update the INSTALL file? > > The INSTALL file may be updated by anyone at anytime. http://rxtx.qbang.org/wiki/index.php/Installation We are moving it to the wiki so end users may put the type of answers they would like to see in. Sometimes it's best if developers don't give what appears to be cryptic answers. You can even put in that jre/lib/ext is not the right place but you don't understand the classpath solution mentioned on the mail-list and then we know what to add. -- Trent Jarvi tjarvi at qbang.org From stramit at gmail.com Wed May 24 21:45:31 2006 From: stramit at gmail.com (Tim Cooper) Date: Thu, 25 May 2006 13:45:31 +1000 Subject: [Rxtx] Accessing Virtual Com Port Message-ID: Hi, I have to develop an application that talks to a virtual com port (in this case com3) which translates any messages sent across a USB cable to a micro. Using C++ I can talk to this com port and I know that it is configured, present, and working. For the application that I am trying to write I want to use RXTX for the communication. My problem is that the configured virtual port (in windows) is not showing up when I do an enumeration over the available ports. The output I get is (com 3 is not present) : Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 PORT FOUND: COM1 PORT FOUND: LPT1 Is there anything that I need to do to make com3 available to RXTX and my application? Timothy Cooper -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060524/c5591648/attachment-0002.html From antonio.luis at iscte.pt Thu May 25 01:39:13 2006 From: antonio.luis at iscte.pt (=?ISO-8859-1?Q?Ant=F3nio_Lopes?=) Date: Thu, 25 May 2006 08:39:13 +0100 Subject: [Rxtx] RXTX on Pocket PC Message-ID: <44755F21.8060103@iscte.pt> Hello everyone, I've been using RXTX to communicate with serial ports in Windows and it's been quite successful. However, I'm now considering porting my application from Windows to Pocket PC but I can't seem to find the RXTX binaries (*.jar and *.dll) to use in Pocket PC. I've been "digging" on the mailing list's archives and also on the web and I can't find these anywhere. Can anyone in this mailing list give me some pointers on this? Where can I find the necessary files and basic installation instructions? Thanks very much for your help. I very much appreciate any help that you can provide me. Regards, -- Ant?nio Lopes @contact: antonio.luis at iscte.pt @work: ADETTI - ISCTE @web: http://antonio.lopes.googlepages.com/home From doug at dupreeinc.com Fri May 26 15:45:50 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Fri, 26 May 2006 14:45:50 -0700 Subject: [Rxtx] rxtx slow startup Message-ID: <4477770E.9010400@dupreeinc.com> Hello, I hope there are people still reading this mailing list. The archive appeared to not have anything new after 4/2005. I was using the commapi from sun for a project where a java application reads data from test equipment connected to the serial port. I had to upgrade the ftdi vcp driver on my pc and the old sun commapi no longer works with hardware flow control. as an experiment I replaced the javax.com with gnu.io in the SerialDemo.java project that was included with the commapi. This compiled fine using JBuilder 2006 and JRE 1.5.0_05. RXTX also works with the latest ftdi drivers so life is wonderful again... almost... When using the commapi jar the SerialDemo program starts in about 1 second on my system. Using the RXTX jar it takes over 56 seconds to start. Has anyone else seen this problem? Is there a workaround to get the startup performance close to the old commapi? The last thing printed to the console before this delay is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks for your time! Doug From yhua537 at cse.unsw.edu.au Sat May 27 05:46:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 21:46:45 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <4477770E.9010400@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> Message-ID: hi Doug The archive hasn't been update for a long time, But people certainly still reading the list. I don't have enough experience to help on your problem, but without any detail about what your problem doing during that 56 seconds, it is hard to target the your question, I think. cheers YiQi On Fri, 26 May 2006, Doug Thistlethwaite wrote: > Hello, > > I hope there are people still reading this mailing list. The archive > appeared to not have anything new after 4/2005. > > I was using the commapi from sun for a project where a java application > reads data from test equipment connected to the serial port. I had to > upgrade the ftdi vcp driver on my pc and the old sun commapi no longer > works with hardware flow control. as an experiment I replaced the > javax.com with gnu.io in the SerialDemo.java project that was included > with the commapi. This compiled fine using JBuilder 2006 and JRE > 1.5.0_05. RXTX also works with the latest ftdi drivers so life is > wonderful again... almost... > > When using the commapi jar the SerialDemo program starts in about 1 > second on my system. Using the RXTX jar it takes over 56 seconds to > start. Has anyone else seen this problem? Is there a workaround to get > the startup performance close to the old commapi? > > The last thing printed to the console before this delay is: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Thanks for your time! > > Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------- Just a student, Still a student ------------------------------- From yhua537 at cse.unsw.edu.au Sat May 27 06:04:26 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 22:04:26 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: Sorry, I don't think you could understand what I mean .I mean this: Without any detail about what your program is doing during that 56 seconds, it is hard for anyone to target the problem. On Sat, 27 May 2006, YiQi Huang wrote: > hi Doug > > The archive hasn't been update for a long time, But people certainly still > reading the list. > > I don't have enough experience to help on your problem, but without any > detail about what your problem doing during that 56 seconds, it is hard to > target the your question, I think. > > cheers > YiQi > > On Fri, 26 May 2006, Doug Thistlethwaite wrote: > >> Hello, >> >> I hope there are people still reading this mailing list. The archive >> appeared to not have anything new after 4/2005. >> >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From jredman at ergotech.com Sat May 27 08:32:02 2006 From: jredman at ergotech.com (Jim Redman) Date: Sat, 27 May 2006 08:32:02 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: <447862E2.4080506@ergotech.com> Doug, Since you mentioned it, we have a system that is also seems slow. From memory (I don't have one of the slow systems around), I'm not sure that it's consistent, it seems that sometimes it may take longer than others. Since it's part of the bootup it hasn't raised a flag and I haven't researched it. The same code runs much faster on other systems, so now you've got me wondering what's different. The slow system boots DSL (http://www.damnsmalllinux.org/) from a compact flash. FC4 is on my desktop where I haven't noticed a slow down. I think that the rxtx code is the same in both cases with lock files disabled. The slow system has a bunch of serial ports defined, including 4 USB serial ports that do not exist - they are not plugged in. Any clues in there? Jim > On Fri, 26 May 2006, Doug Thistlethwaite wrote: >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Sat May 27 10:41:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 May 2006 10:41:54 -0600 (MDT) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447862E2.4080506@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: On Sat, 27 May 2006, Jim Redman wrote: > Doug, > > Since you mentioned it, we have a system that is also seems slow. From > memory (I don't have one of the slow systems around), I'm not sure that > it's consistent, it seems that sometimes it may take longer than others. > Since it's part of the bootup it hasn't raised a flag and I haven't > researched it. > > The same code runs much faster on other systems, so now you've got me > wondering what's different. > > The slow system boots DSL (http://www.damnsmalllinux.org/) from a > compact flash. FC4 is on my desktop where I haven't noticed a slow > down. I think that the rxtx code is the same in both cases with lock > files disabled. > > The slow system has a bunch of serial ports defined, including 4 USB > serial ports that do not exist - they are not plugged in. > > Any clues in there? > rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. When it does this, it will try to open each port and do a timed out read. most systems will not have entries in device if the port is not there. But some minimal systems will just put all the device files there in case hardware is added. The list of devices scanned used to be ~10-20 times longer than it is today. That was getting very slow. I suspect moving the device files not used to a backup directory would increase the enumeration. I'll look into why the mail-list archive is not updating. The last update was about when I thought I 'fixed' the cron jobs. I probably didn't actually fix it but rather moved the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon May 29 19:46:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 May 2006 19:46:47 -0600 (MDT) Subject: [Rxtx] Mail-List Archives are updating. Message-ID: It was pointed out earlier that the archive is dated. This was a missing crontab entry. The list is currently archived by the week on the web page. It is updated once a day. So every 7 days it starts a new link and updates it daily. I've been limited in what I could do while my cable modem was disconnected this last week. rxtx.org is something I do on my own time. The patches and credits will be comming next. Many of these can be seen in bugzilla right now. -- Trent Jarvi tjarvi at qbang.org From doug at dupreeinc.com Tue May 30 11:18:41 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 10:18:41 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: <447C7E71.4080204@dupreeinc.com> Trent, YiQi, and Jim: Thanks to all for the replies and information! I am just back from a long weekend and I am now trying to figure out what I was doing! :) As for more information. First off, this example is being run under windows XP. I am developing test equipment that communicates with a java application via a serial port. I have been using the commapi for several years and have not had a problem. Recently, I have started a design modification that will replace the RS232 connection with a USB port. I am using the ftdi module for prototyping and I discovered that their virtual com port driver was not compatible with the commapi that Sun released. It turns out that it has problems with hardware flow control ( it works on incoming but not outgoing communications). The way I figured this out was by experimenting with the SerialDemo that was included with the Sum commapi. One nice thing about this example is it has the ability to set incoming and outgoing flow control independently. After I installed RXTX into my JBuilder 2006 IDE, I just replaced all all instances of javax.comm with gnu.io and it compiled and runs without a hitch (except for the slow startup). I Paused the JBuilder IDE during this long pause and the last few entries in the stack trace are: testRead() : -1, gnu.io.RXTXCommDriver registerValidPorts() : 255, gnu.io.RXTXCommDriver registerScannedPorts() : 777, gnu.io.RXTXCommDriver This was all initiated by the following call in the programs init routine: Enumeration en = CommPortIdentifier.getPortIdentifiers(); After looking at this, My guess is that Trent is correct in that the delay is in scanning for ports. I guess one solution would be to not scan for ports, though it would be nice to detect what is available on the system. Is there any way to reduce the number of ports scanned by this function in windows XP? Thanks again for your time, Doug Trent Jarvi wrote: >On Sat, 27 May 2006, Jim Redman wrote: > > > >>Doug, >> >>Since you mentioned it, we have a system that is also seems slow. From >>memory (I don't have one of the slow systems around), I'm not sure that >>it's consistent, it seems that sometimes it may take longer than others. >>Since it's part of the bootup it hasn't raised a flag and I haven't >>researched it. >> >>The same code runs much faster on other systems, so now you've got me >>wondering what's different. >> >>The slow system boots DSL (http://www.damnsmalllinux.org/) from a >>compact flash. FC4 is on my desktop where I haven't noticed a slow >>down. I think that the rxtx code is the same in both cases with lock >>files disabled. >> >>The slow system has a bunch of serial ports defined, including 4 USB >>serial ports that do not exist - they are not plugged in. >> >>Any clues in there? >> >> >> > >rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. > >When it does this, it will try to open each port and do a timed out read. >most systems will not have entries in device if the port is not there. >But some minimal systems will just put all the device files there in case >hardware is added. > >The list of devices scanned used to be ~10-20 times longer than it is >today. That was getting very slow. > >I suspect moving the device files not used to a backup directory would >increase the enumeration. > >I'll look into why the mail-list archive is not updating. The last update >was about when I thought I 'fixed' the cron jobs. I probably didn't >actually fix it but rather moved the problem. > >-- >Trent Jarvi >tjarvi at qbang.org > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/86796453/attachment-0002.html From doug at dupreeinc.com Tue May 30 14:36:09 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 13:36:09 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447C7E71.4080204@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com> Message-ID: <447CACB9.1000801@dupreeinc.com> Hello all, I also notice this pause (not as long however) when I call: CommPortIdentifier.getPortIdentifier(PortName); I would think that if I supply the name of the port, it would not have to go through the same discovery process. If you have any ideas of how to get rid of this startup delay, I would really appreciate it. Thanks, Doug Doug Thistlethwaite wrote: > Trent, YiQi, and Jim: > > Thanks to all for the replies and information! I am just back from a > long weekend and I am now trying to figure out what I was doing! :) > > As for more information. First off, this example is being run under > windows XP. I am developing test equipment that communicates with a > java application via a serial port. I have been using the commapi for > several years and have not had a problem. Recently, I have started a > design modification that will replace the RS232 connection with a USB > port. I am using the ftdi module for prototyping and I discovered > that their virtual com port driver was not compatible with the commapi > that Sun released. It turns out that it has problems with hardware > flow control ( it works on incoming but not outgoing communications). > The way I figured this out was by experimenting with the SerialDemo > that was included with the Sum commapi. One nice thing about this > example is it has the ability to set incoming and outgoing flow > control independently. > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup). > > I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are: > > testRead() : -1, gnu.io.RXTXCommDriver > registerValidPorts() : 255, gnu.io.RXTXCommDriver > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > This was all initiated by the following call in the programs init routine: > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > After looking at this, My guess is that Trent is correct in that the > delay is in scanning for ports. I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system. Is there any way to reduce the number of ports scanned by > this function in windows XP? > > Thanks again for your time, > > Doug > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/edaa5c3c/attachment-0002.html From lynn at swcp.com Tue May 30 15:07:18 2006 From: lynn at swcp.com (lynn@swcp.com) Date: Tue, 30 May 2006 21:07:18 -0000 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CACB9.1000801@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: *IF* the name of the port is supplied, we might want to use the preferences mechanism (java.util.prefs) where we could have previously saved the info for the port. We could do a quick check to see that things have not changed before using it. If things have changed (or never been defined) we would do a full port scan and save detected ports in the preferences. This way if the hardware is not changed, you only pay the time penalty one time. just an idea... Lynn Doug Thistlethwaite said: > This is a multi-part message in MIME format. > --------------070808020900080005070500 > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > Content-Transfer-Encoding: 7bit > > Hello all, > > I also notice this pause (not as long however) when I call: > > CommPortIdentifier.getPortIdentifier(PortName); > > I would think that if I supply the name of the port, it would not have > to go through the same discovery process. If you have any ideas of how > to get rid of this startup delay, I would really appreciate it. > > Thanks, > > Doug > > Doug Thistlethwaite wrote: > > > Trent, YiQi, and Jim: > > > > Thanks to all for the replies and information! I am just back from a > > long weekend and I am now trying to figure out what I was doing! :) > > > > As for more information. First off, this example is being run under > > windows XP. I am developing test equipment that communicates with a > > java application via a serial port. I have been using the commapi for > > several years and have not had a problem. Recently, I have started a > > design modification that will replace the RS232 connection with a USB > > port. I am using the ftdi module for prototyping and I discovered > > that their virtual com port driver was not compatible with the commapi > > that Sun released. It turns out that it has problems with hardware > > flow control ( it works on incoming but not outgoing communications). > > The way I figured this out was by experimenting with the SerialDemo > > that was included with the Sum commapi. One nice thing about this > > example is it has the ability to set incoming and outgoing flow > > control independently. > > > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > > all instances of javax.comm with gnu.io and it compiled and runs > > without a hitch (except for the slow startup). > > > > I Paused the JBuilder IDE during this long pause and the last few > > entries in the stack trace are: > > > > testRead() : -1, gnu.io.RXTXCommDriver > > registerValidPorts() : 255, gnu.io.RXTXCommDriver > > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > > > This was all initiated by the following call in the programs init routine: > > > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > > > After looking at this, My guess is that Trent is correct in that the > > delay is in scanning for ports. I guess one solution would be to not > > scan for ports, though it would be nice to detect what is available on > > the system. Is there any way to reduce the number of ports scanned by > > this function in windows XP? > > > > Thanks again for your time, > > > > Doug > > > > --------------070808020900080005070500 > Content-Type: text/html; charset=ISO-8859-1 > Content-Transfer-Encoding: 7bit > > > > > > > > > Hello all,
>
> I also notice this pause (not as long however) when I call:
>
>          CommPortIdentifier.getPortIdentifier(PortName);
>
> I would think that if I supply the name of the port, it would not have > to go through the same discovery process.  If you have any ideas of how > to get rid of this startup delay, I would really appreciate it.
>
> Thanks,
>
> Doug
>
> Doug Thistlethwaite wrote: >
> > Trent, YiQi, and Jim:
>
> Thanks to all for the replies and information!  I am just back from a > long weekend and I am now trying to figure out what I was doing! :)
>
> As for more information.  First off, this example is being run under > windows XP.  I am developing test equipment that communicates with a > java application via a serial port.  I have been using the commapi for > several years and have not had a problem.  Recently, I have started a > design modification that will replace the RS232 connection with a USB > port.  I am using the ftdi module for prototyping and I discovered that > their virtual com port driver was not compatible with the commapi that > Sun released.  It turns out that it has problems with hardware flow > control ( it works on incoming but not outgoing communications).  The > way I figured this out was by experimenting with the SerialDemo that > was included with the Sum commapi.  One nice thing about this example > is it has the ability to set incoming and outgoing flow control > independently.
>
> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup).
>
> I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are:
>
> testRead() : -1, gnu.io.RXTXCommDriver
> registerValidPorts() : 255, gnu.io.RXTXCommDriver
> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>
> This was all initiated by the following call in the programs init > routine:
>
> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>
> After looking at this,  My guess is that Trent is correct in that the > delay is in scanning for ports.  I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system.  Is there any way to reduce the number of ports scanned by > this function in windows XP? 
>
> Thanks again for your time,
>
> Doug
>
>
> > > > --------------070808020900080005070500-- > -- From jredman at ergotech.com Tue May 30 15:42:35 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 30 May 2006 15:42:35 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: <447CBC4B.2080206@ergotech.com> Lynn, If I understand your idea correctly, I don't think that this would work well for, say, USB ports since these can be easily added/removed by the end user. Jim lynn at swcp.com wrote: > *IF* the name of the port is supplied, we might want to use the preferences > mechanism (java.util.prefs) where we could have previously saved the info for > the port. We could do a quick check to see that things have not changed > before using it. If things have changed (or never been defined) we would do a > full port scan and save detected ports in the preferences. > > This way if the hardware is not changed, you only pay the time penalty one time. > > just an idea... > Lynn > > > Doug Thistlethwaite said: > >> This is a multi-part message in MIME format. >> --------------070808020900080005070500 >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >> Content-Transfer-Encoding: 7bit >> >> Hello all, >> >> I also notice this pause (not as long however) when I call: >> >> CommPortIdentifier.getPortIdentifier(PortName); >> >> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process. If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it. >> >> Thanks, >> >> Doug >> >> Doug Thistlethwaite wrote: >> >>> Trent, YiQi, and Jim: >>> >>> Thanks to all for the replies and information! I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :) >>> >>> As for more information. First off, this example is being run under >>> windows XP. I am developing test equipment that communicates with a >>> java application via a serial port. I have been using the commapi for >>> several years and have not had a problem. Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port. I am using the ftdi module for prototyping and I discovered >>> that their virtual com port driver was not compatible with the commapi >>> that Sun released. It turns out that it has problems with hardware >>> flow control ( it works on incoming but not outgoing communications). >>> The way I figured this out was by experimenting with the SerialDemo >>> that was included with the Sum commapi. One nice thing about this >>> example is it has the ability to set incoming and outgoing flow >>> control independently. >>> >>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup). >>> >>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are: >>> >>> testRead() : -1, gnu.io.RXTXCommDriver >>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>> >>> This was all initiated by the following call in the programs init routine: >>> >>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>> >>> After looking at this, My guess is that Trent is correct in that the >>> delay is in scanning for ports. I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system. Is there any way to reduce the number of ports scanned by >>> this function in windows XP? >>> >>> Thanks again for your time, >>> >>> Doug >>> >> --------------070808020900080005070500 >> Content-Type: text/html; charset=ISO-8859-1 >> Content-Transfer-Encoding: 7bit >> >> >> >> >> >> >> >> >> Hello all,
>>
>> I also notice this pause (not as long however) when I call:
>>
>>         >  CommPortIdentifier.getPortIdentifier(PortName);
>>
>> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process.  If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it.
>>
>> Thanks,
>>
>> Doug
>>
>> Doug Thistlethwaite wrote: >>
>> >> Trent, YiQi, and Jim:
>>
>> Thanks to all for the replies and information!  I am just back from a >> long weekend and I am now trying to figure out what I was doing! :)
>>
>> As for more information.  First off, this example is being run under >> windows XP.  I am developing test equipment that communicates with a >> java application via a serial port.  I have been using the commapi for >> several years and have not had a problem.  Recently, I have started a >> design modification that will replace the RS232 connection with a USB >> port.  I am using the ftdi module for prototyping and I discovered that >> their virtual com port driver was not compatible with the commapi that >> Sun released.  It turns out that it has problems with hardware flow >> control ( it works on incoming but not outgoing communications).  The >> way I figured this out was by experimenting with the SerialDemo that >> was included with the Sum commapi.  One nice thing about this example >> is it has the ability to set incoming and outgoing flow control >> independently.
>>
>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >> all instances of javax.comm with gnu.io and it compiled and runs >> without a hitch (except for the slow startup).
>>
>> I Paused the JBuilder IDE during this long pause and the last few >> entries in the stack trace are:
>>
>> testRead() : -1, gnu.io.RXTXCommDriver
>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>
>> This was all initiated by the following call in the programs init >> routine:
>>
>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>
>> After looking at this,  My guess is that Trent is correct in that the >> delay is in scanning for ports.  I guess one solution would be to not >> scan for ports, though it would be nice to detect what is available on >> the system.  Is there any way to reduce the number of ports scanned by >> this function in windows XP? 
>>
>> Thanks again for your time,
>>
>> Doug
>>
>>
>> >> >> >> --------------070808020900080005070500-- >> > > > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From yhua537 at cse.unsw.edu.au Tue May 30 18:10:23 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 31 May 2006 10:10:23 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CBC4B.2080206@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: Doug, In the SerialDemo, it allow us to save the parameters into a file, and use it when your program start up. Would this help? YiQi On Tue, 30 May 2006, Jim Redman wrote: > Lynn, > > If I understand your idea correctly, I don't think that this would work > well for, say, USB ports since these can be easily added/removed by the > end user. > > Jim > > lynn at swcp.com wrote: >> *IF* the name of the port is supplied, we might want to use the preferences >> mechanism (java.util.prefs) where we could have previously saved the info for >> the port. We could do a quick check to see that things have not changed >> before using it. If things have changed (or never been defined) we would do a >> full port scan and save detected ports in the preferences. >> >> This way if the hardware is not changed, you only pay the time penalty one time. >> >> just an idea... >> Lynn >> >> >> Doug Thistlethwaite said: >> >>> This is a multi-part message in MIME format. >>> --------------070808020900080005070500 >>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>> Content-Transfer-Encoding: 7bit >>> >>> Hello all, >>> >>> I also notice this pause (not as long however) when I call: >>> >>> CommPortIdentifier.getPortIdentifier(PortName); >>> >>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process. If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it. >>> >>> Thanks, >>> >>> Doug >>> >>> Doug Thistlethwaite wrote: >>> >>>> Trent, YiQi, and Jim: >>>> >>>> Thanks to all for the replies and information! I am just back from a >>>> long weekend and I am now trying to figure out what I was doing! :) >>>> >>>> As for more information. First off, this example is being run under >>>> windows XP. I am developing test equipment that communicates with a >>>> java application via a serial port. I have been using the commapi for >>>> several years and have not had a problem. Recently, I have started a >>>> design modification that will replace the RS232 connection with a USB >>>> port. I am using the ftdi module for prototyping and I discovered >>>> that their virtual com port driver was not compatible with the commapi >>>> that Sun released. It turns out that it has problems with hardware >>>> flow control ( it works on incoming but not outgoing communications). >>>> The way I figured this out was by experimenting with the SerialDemo >>>> that was included with the Sum commapi. One nice thing about this >>>> example is it has the ability to set incoming and outgoing flow >>>> control independently. >>>> >>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>> all instances of javax.comm with gnu.io and it compiled and runs >>>> without a hitch (except for the slow startup). >>>> >>>> I Paused the JBuilder IDE during this long pause and the last few >>>> entries in the stack trace are: >>>> >>>> testRead() : -1, gnu.io.RXTXCommDriver >>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>> >>>> This was all initiated by the following call in the programs init routine: >>>> >>>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>> >>>> After looking at this, My guess is that Trent is correct in that the >>>> delay is in scanning for ports. I guess one solution would be to not >>>> scan for ports, though it would be nice to detect what is available on >>>> the system. Is there any way to reduce the number of ports scanned by >>>> this function in windows XP? >>>> >>>> Thanks again for your time, >>>> >>>> Doug >>>> >>> --------------070808020900080005070500 >>> Content-Type: text/html; charset=ISO-8859-1 >>> Content-Transfer-Encoding: 7bit >>> >>> >>> >>> >>> >>> >>> >>> >>> Hello all,
>>>
>>> I also notice this pause (not as long however) when I call:
>>>
>>>         >>  CommPortIdentifier.getPortIdentifier(PortName);
>>>
>>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process.  If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it.
>>>
>>> Thanks,
>>>
>>> Doug
>>>
>>> Doug Thistlethwaite wrote: >>>
>>> >>> Trent, YiQi, and Jim:
>>>
>>> Thanks to all for the replies and information!  I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :)
>>>
>>> As for more information.  First off, this example is being run under >>> windows XP.  I am developing test equipment that communicates with a >>> java application via a serial port.  I have been using the commapi for >>> several years and have not had a problem.  Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port.  I am using the ftdi module for prototyping and I discovered that >>> their virtual com port driver was not compatible with the commapi that >>> Sun released.  It turns out that it has problems with hardware flow >>> control ( it works on incoming but not outgoing communications).  The >>> way I figured this out was by experimenting with the SerialDemo that >>> was included with the Sum commapi.  One nice thing about this example >>> is it has the ability to set incoming and outgoing flow control >>> independently.
>>>
>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup).
>>>
>>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are:
>>>
>>> testRead() : -1, gnu.io.RXTXCommDriver
>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>
>>> This was all initiated by the following call in the programs init >>> routine:
>>>
>>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>
>>> After looking at this,  My guess is that Trent is correct in that the >>> delay is in scanning for ports.  I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system.  Is there any way to reduce the number of ports scanned by >>> this function in windows XP? 
>>>
>>> Thanks again for your time,
>>>
>>> Doug
>>>
>>>
>>> >>> >>> >>> --------------070808020900080005070500-- >>> >> >> >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From halbleib at rechnerbetriebsgruppe.de Wed May 31 02:06:16 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 10:06:16 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp Message-ID: <447D4E78.30302@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, I getting an error while reloading my app in tomcat. At the first start everything runs well, but if i reload mit webapp by tomcat manager i get the following error. java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader Is there a possibility to unload the native library rxtxSerial.dll? thx for all help! regards tom -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 b8FT80HQ1xlbDLnRecDANCc= =heb1 -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 02:52:17 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 10:52:17 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D4E78.30302@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> Message-ID: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Hello Tom, To the best of my knowledge it is impossible to unload native libraries once loaded into the JVM. The exception you see stems from the fact, that Tomcat creates a new classloader when you "reload" the weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar is loaded from the session class loader. Try to add RXTXComm.jar to your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. Regards, Joachim On 31.05.2006, at 10:06, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 > b8FT80HQ1xlbDLnRecDANCc= > =heb1 > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From halbleib at rechnerbetriebsgruppe.de Wed May 31 03:28:35 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 11:28:35 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Message-ID: <447D61C3.1030807@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Joachim, I'm still not getting it. How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml-file? Perhaps web.xml? Regards, Tom Joachim Buechse schrieb: > Hello Tom, > > To the best of my knowledge it is impossible to unload native > libraries once loaded into the JVM. The exception you see stems from > the fact, that Tomcat creates a new classloader when you "reload" the > weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar > is loaded from the session class loader. Try to add RXTXComm.jar to > your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. > > Regards, > Joachim > > On 31.05.2006, at 10:06, Tom Halbleib wrote: > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL tzNy+/0iIUfkYYgt1+UT1ko= =pkpY -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 04:03:42 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 12:03:42 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D61C3.1030807@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> <447D61C3.1030807@rechnerbetriebsgruppe.de> Message-ID: -Xbootclasspath/a: is a start option to the java vm. Google is your friend in finding how to modfiy it and what it means: tomcat modifying bootclasspath Regards, Joachim On 31.05.2006, at 11:28, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Joachim, > > I'm still not getting it. > How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml- > file? > Perhaps web.xml? > > Regards, > Tom > > Joachim Buechse schrieb: >> Hello Tom, >> >> To the best of my knowledge it is impossible to unload native >> libraries once loaded into the JVM. The exception you see stems from >> the fact, that Tomcat creates a new classloader when you "reload" the >> weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar >> is loaded from the session class loader. Try to add RXTXComm.jar to >> your bootlclasspath (-Xbootclasspath/a:) and the problem should go >> away. >> >> Regards, >> Joachim >> >> On 31.05.2006, at 10:06, Tom Halbleib wrote: >> >> Hi all, >> >> I getting an error while reloading my app in tomcat. At the first >> start >> everything runs well, but if i reload mit webapp by tomcat manager >> i get >> the following error. >> >> java.lang.UnsatisfiedLinkError: Native Library >> C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in >> another classloader thrown while loading gnu.io.RXTXCommDriver >> Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: >> Native >> Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already >> loaded >> in another classloader >> >> >> Is there a possibility to unload the native library rxtxSerial.dll? >> >> thx for all help! >> >> regards >> >> tom > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL > tzNy+/0iIUfkYYgt1+UT1ko= > =pkpY > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From impakt01 at optusnet.com.au Wed May 31 06:55:42 2006 From: impakt01 at optusnet.com.au (Daren) Date: Wed, 31 May 2006 22:55:42 +1000 Subject: [Rxtx] (no subject) Message-ID: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/ade7ad37/attachment-0002.html From doug at dupreeinc.com Wed May 31 10:19:19 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 31 May 2006 09:19:19 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: <447DC207.3070702@dupreeinc.com> I am not sure what you are saying. The Save parameters menu option saves the current settings (baud, data bits, etc.). The long pause (~60 seconds) is when the application first starts (before loading the saved parameters). This does bring up a question, though I hate this type of kludge approach to getting this library to work... What exactly is a PortIdentifier? Is it always the same? If I stored the results from "CommPortIdentifier.getPortIdentifier(PortName);" in a file, could I use this the next time the program is executed? In this case I am using a virtual com port driver to connect to the device through a USB port. Doug YiQi Huang wrote: >Doug, > >In the SerialDemo, it allow us to save the parameters into a file, and use >it when your program start up. Would this help? > >YiQi > >On Tue, 30 May 2006, Jim Redman wrote: > > > >>Lynn, >> >>If I understand your idea correctly, I don't think that this would work >>well for, say, USB ports since these can be easily added/removed by the >>end user. >> >>Jim >> >>lynn at swcp.com wrote: >> >> >>>*IF* the name of the port is supplied, we might want to use the preferences >>>mechanism (java.util.prefs) where we could have previously saved the info for >>>the port. We could do a quick check to see that things have not changed >>>before using it. If things have changed (or never been defined) we would do a >>>full port scan and save detected ports in the preferences. >>> >>>This way if the hardware is not changed, you only pay the time penalty one time. >>> >>>just an idea... >>>Lynn >>> >>> >>>Doug Thistlethwaite said: >>> >>> >>> >>>>This is a multi-part message in MIME format. >>>>--------------070808020900080005070500 >>>>Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>>>Content-Transfer-Encoding: 7bit >>>> >>>>Hello all, >>>> >>>>I also notice this pause (not as long however) when I call: >>>> >>>> CommPortIdentifier.getPortIdentifier(PortName); >>>> >>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process. If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it. >>>> >>>>Thanks, >>>> >>>>Doug >>>> >>>>Doug Thistlethwaite wrote: >>>> >>>> >>>> >>>>>Trent, YiQi, and Jim: >>>>> >>>>>Thanks to all for the replies and information! I am just back from a >>>>>long weekend and I am now trying to figure out what I was doing! :) >>>>> >>>>>As for more information. First off, this example is being run under >>>>>windows XP. I am developing test equipment that communicates with a >>>>>java application via a serial port. I have been using the commapi for >>>>>several years and have not had a problem. Recently, I have started a >>>>>design modification that will replace the RS232 connection with a USB >>>>>port. I am using the ftdi module for prototyping and I discovered >>>>>that their virtual com port driver was not compatible with the commapi >>>>>that Sun released. It turns out that it has problems with hardware >>>>>flow control ( it works on incoming but not outgoing communications). >>>>>The way I figured this out was by experimenting with the SerialDemo >>>>>that was included with the Sum commapi. One nice thing about this >>>>>example is it has the ability to set incoming and outgoing flow >>>>>control independently. >>>>> >>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>>without a hitch (except for the slow startup). >>>>> >>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>>entries in the stack trace are: >>>>> >>>>>testRead() : -1, gnu.io.RXTXCommDriver >>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>>> >>>>>This was all initiated by the following call in the programs init routine: >>>>> >>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>>> >>>>>After looking at this, My guess is that Trent is correct in that the >>>>>delay is in scanning for ports. I guess one solution would be to not >>>>>scan for ports, though it would be nice to detect what is available on >>>>>the system. Is there any way to reduce the number of ports scanned by >>>>>this function in windows XP? >>>>> >>>>>Thanks again for your time, >>>>> >>>>>Doug >>>>> >>>>> >>>>> >>>>--------------070808020900080005070500 >>>>Content-Type: text/html; charset=ISO-8859-1 >>>>Content-Transfer-Encoding: 7bit >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>>Hello all,
>>>>
>>>>I also notice this pause (not as long however) when I call:
>>>>
>>>>        >>>> >>>> >>> CommPortIdentifier.getPortIdentifier(PortName);
>>> >>> >>>>
>>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process.  If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it.
>>>>
>>>>Thanks,
>>>>
>>>>Doug
>>>>
>>>>Doug Thistlethwaite wrote: >>>>
>>>> >>>>Trent, YiQi, and Jim:
>>>>
>>>>Thanks to all for the replies and information!  I am just back from a >>>>long weekend and I am now trying to figure out what I was doing! :)
>>>>
>>>>As for more information.  First off, this example is being run under >>>>windows XP.  I am developing test equipment that communicates with a >>>>java application via a serial port.  I have been using the commapi for >>>>several years and have not had a problem.  Recently, I have started a >>>>design modification that will replace the RS232 connection with a USB >>>>port.  I am using the ftdi module for prototyping and I discovered that >>>>their virtual com port driver was not compatible with the commapi that >>>>Sun released.  It turns out that it has problems with hardware flow >>>>control ( it works on incoming but not outgoing communications).  The >>>>way I figured this out was by experimenting with the SerialDemo that >>>>was included with the Sum commapi.  One nice thing about this example >>>>is it has the ability to set incoming and outgoing flow control >>>>independently.
>>>>
>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>without a hitch (except for the slow startup).
>>>>
>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>entries in the stack trace are:
>>>>
>>>>testRead() : -1, gnu.io.RXTXCommDriver
>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>>
>>>>This was all initiated by the following call in the programs init >>>>routine:
>>>>
>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>>
>>>>After looking at this,  My guess is that Trent is correct in that the >>>>delay is in scanning for ports.  I guess one solution would be to not >>>>scan for ports, though it would be nice to detect what is available on >>>>the system.  Is there any way to reduce the number of ports scanned by >>>>this function in windows XP? 
>>>>
>>>>Thanks again for your time,
>>>>
>>>>Doug
>>>>
>>>>
>>>> >>>> >>>> >>>>--------------070808020900080005070500-- >>>> >>>> >>>> >>> >>> >>> >>-- >>Jim Redman >>(505) 662 5156 x85 >>http://www.ergotech.com >>_______________________________________________ >>Rxtx mailing list >>Rxtx at qbang.org >>http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > >cheers >YiQi Huang >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/61d4d4c9/attachment-0002.html From impakt01 at optusnet.com.au Wed May 31 17:02:54 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 09:02:54 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Message-ID: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Hi all, I downloaded 2.1.7-pre16 and managed to build it and get it going. I made the changes as suggested by Peter Smith in an old post, by adding his code to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. Still not working, it opens the port at 9600 according to portmon.exe . Has anyone managed to get this going at a custom rate? Here is the post I'm referring to: http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 Thanks, Daren ________________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Daren Sent: Wednesday, 31 May 2006 10:56 PM To: rxtx at qbang.org Subject: [Rxtx] (no subject) Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren From tjarvi at qbang.org Wed May 31 21:44:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 May 2006 21:44:01 -0600 (MDT) Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> References: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Message-ID: On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org From impakt01 at optusnet.com.au Wed May 31 22:06:04 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 14:06:04 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: Message-ID: <200606010406.k51464X2010447@mail03.syd.optusnet.com.au> Trent, I have managed to successfully open the port at this speed using Realterm (available on sourceforge). From memory this uses DLPortIO. Using portmon.exe with realterm, even there it says that the port has opened at 1953. I changed termios.c:560 to dcb->BaudRate = 1953 ; and it still opens the port at 9600. Daren -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Thursday, 1 June 2006 1:44 PM To: RXTX Developers and Users Subject: Re: [Rxtx] custom baud rate win32 On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From smontgomery at mediaspansoftware.com Mon May 1 09:52:28 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 11:52:28 -0400 Subject: [Rxtx] RXTX, Java COMM and Windows Server 2003 on x64 experiences? Message-ID: Just wondering if anybody here has had to deploy RXTX or the javax.comm on Windows Server 2003 machines running on x64 (i.e. Xeon EM64T) and would like to relate how things went. From Sun's site, the Supported System Configurations pages give the options for that system: Java 5.0: - 32-bit Java 5.0 running on the OS in the 32-bit mode - 64-bit Java 5.0 running on the OS in the 64-bit native mode Java 1.4.2: - no options listed for EM64T processors, but potentially the standard 32-bit Java 1.4.2 could run on the OS in 32-bit mode? I guess the two main points of failure would be 1) the JVM itself and 2) the jni components. Make that three: there's gotta be hardware vendor driver support for the OS in the various modes, too. Guess I better go look at Keyspan's website... Thanks in advance for any info anyone might be able to provide. From smontgomery at mediaspansoftware.com Mon May 1 10:18:33 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 12:18:33 -0400 Subject: [Rxtx] Mailing list archive out of date? Message-ID: The mailing list archive at: http://mailman.qbang.org/pipermail/rxtx/ only shows emails through the end of March. Is there a new archive somewhere else? Didn't see anything mentioned on the wiki. From p.cain at phasefale.com.au Mon May 1 22:33:09 2006 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 02 May 2006 14:33:09 +1000 Subject: [Rxtx] RXTX and the Linux kernel. Message-ID: <4456E105.5080106@phasefale.com.au> Hi, First off the problem I am having isn't caused by RXTX itself but I'm hoping someone out there may have some knowledge that may help me. Background: I have an application monitoring a control system through a standard PC serial port which I talk to with rxtx-2.0.5. The application runs on RedHat7.3 kernel version 2.4.18 using Java 1.4. This configuration has been in use for several years and has proved to be stable. But it has become necessary for me to upgrade the OS but I'm running into problems with the serial communications. Its not that the comms don't work on the new OS (its never that simple) the comms work for a variable period of time (sometimes several hours) and then just stop, nothing on the data lines and control lines all indicate that data could flow. The new OS is Ubuntu 5.10 running kernel version 2.6.12. I have installed the OS and software on a PC and had it perform ok, then install the new OS and same software on the very same hardware and experienced the problems of them comms stopping. In the new OS I'm using Java5 to run the app but since I have experience the problem I reverted back to Java1.4 which didn't fix the problem. I've moved the app to a different system RedHat FC3 running 2.6.14 had experienced the problem. Not wanting to go through all the thing I have tried but I have established that it seems to be the 2.6 versions of the kernel that seem to be the problem and not an individual distribution of Linux. I should point out that I am using the same jar and library files for each java and OS combination. So I'm just wondering if anyone has had or heard of problems similar to these ? Or perhaps might know of what changed in the Linux serial driver (something I'm having a hard time establishing). I'm starting to run low on ideas of what to try so any help would be much appreciated. -- Peter Cain Senior Programmer Phasefale Pty Ltd From tjarvi at qbang.org Wed May 3 07:31:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 May 2006 07:31:00 -0600 (MDT) Subject: [Rxtx] Re: Concering ircomm and RXTX In-Reply-To: References: Message-ID: On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From legolas.w at gmail.com Wed May 3 08:46:23 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 19:16:23 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <4458C23F.2000003@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From legolas.w at gmail.com Wed May 3 13:10:57 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 23:40:57 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <44590041.80706@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From Lars.Hennig at wow-portal.com Thu May 4 00:39:15 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Thu, 4 May 2006 08:39:15 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: Message-ID: Hi, I could not find any solution. I therefore decided to to my own native implementation. Allthough it only supports the functions I need, it works pretty well now for me. I think the main problem there is the use of a wrong Windows API function and not setting an timeout. Regards, Lars Hennig W?rth Online World GmbH Tel. (0049)7181-258183 Mob. (0049)160-3522889 Fax. (0049)7940-153299 Lars.Hennig at wow-portal.com Gesendet von: rxtx-bounces at qbang.org 09.04.2006 10:42 Bitte antworten zu RXTX Developers and Users An d.herwald at dsh-elektronik.de, RXTX Developers and Users Kopie Thema Re: [Rxtx] USB Serialport - disconnection problems WV Proj./Teilpr.: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/7b39f374/attachment-0003.html From Pawan.Kharbanda at dot.state.co.us Thu May 4 11:00:58 2006 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Thu, 4 May 2006 11:00:58 -0600 Subject: [Rxtx] Dangling Lock Files Message-ID: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Hi, I have been using RXTX API's for the Serial Communication for quite some time now and for some of the devices we are opening and closing the connection every 2 minutes. This works great for few days and then suddenly I start seeing some "Port in Use Exception" and I see that the Lock files are still in the /var/lock folder after manually removing the lock files it works good for few hours and I see the same problem again. Can somebody explain me the scenarios why I am seeing the dangling Lock files? I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise Servers. Thanks Pawan Kharbanda -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/ba0e9261/attachment-0003.html From tjarvi at qbang.org Thu May 4 14:10:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:10:30 -0600 (MDT) Subject: [Rxtx] Dangling Lock Files In-Reply-To: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> References: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Message-ID: On Thu, 4 May 2006, Kharbanda, Pawan wrote: > Hi, > I have been using RXTX API's for the Serial Communication for quite > some time now and for some of the devices we are opening and closing the > connection every 2 minutes. This works great for few days and then > suddenly I start seeing some "Port in Use Exception" and I see that the > Lock files are still in the /var/lock folder after manually removing the > lock files it works good for few hours and I see the same problem again. > Can somebody explain me the scenarios why I am seeing the dangling Lock > files? > > I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise > Servers. Hi Pawan The next time it happens, look in the lockfile. There will be a pid. ps aux |grep 'pid' I think you will see that the application is still running for some reason. RXTX does a kill -0 on the pid to see if its alive. If not, it will remove the lockfile. So I suspect the previous program did not exit as you expected. -- Trent Jarvi tjarvi at qbang.org From Scott.Hughes at dalsemi.com Thu May 4 14:23:11 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 4 May 2006 15:23:11 -0500 Subject: [Rxtx] Wiki instructions... Message-ID: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire demo apps, when I stumbled across this tip on the wiki to add yourself to the uucp group: It may be simpler to just run usermod -G uucp jarvi Taken from: http://rxtx.qbang.org/wiki/index.php/Installation This does not work as advertised. I should have read the man page for usermod before I tried that out. If there are any groups which are not listed after the -G switch, the user is removed from those groups. On Ubuntu, this is bad... I removed myself from the Admin group, which removed my sudo priviledges. Ubuntu has no root account, so I've disabled the only account which could fix it. Anyone know of a good workaround? Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor From tjarvi at qbang.org Thu May 4 14:32:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:32:09 -0600 (MDT) Subject: [Rxtx] Wiki instructions... In-Reply-To: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> Message-ID: On Thu, 4 May 2006, Scott Hughes wrote: > I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire > demo apps, when I stumbled across this tip on the wiki to add yourself to > the uucp group: > > It may be simpler to just run > > usermod -G uucp jarvi > > Taken from: > http://rxtx.qbang.org/wiki/index.php/Installation > > This does not work as advertised. I should have read the man page for > usermod before I tried that out. If there are any groups which are not > listed after the -G switch, the user is removed from those groups. On > Ubuntu, this is bad... I removed myself from the Admin group, which removed > my sudo priviledges. Ubuntu has no root account, so I've disabled the only > account which could fix it. > > Anyone know of a good workaround? > Yikes This will get your permissions back: in grub/lilo/.. pass the following option to the kernel init=/bin/sh You are now root. when it boots, mount -o remount,rw / add yourself to the groups, reboot to get normal init going. Thats about all I can think of without sudo/root. -- Trent Jarvi tjarvi at qbang.org From Gettings at earth.utah.edu Thu May 4 14:41:22 2006 From: Gettings at earth.utah.edu (Paul Gettings) Date: Thu, 4 May 2006 14:41:22 -0600 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <20060504204122.GA6534@earth.utah.edu> When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get messages on stdout from the JVM: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 As the only change was the version of RXTX (from 2.1.6), I am unsure why the messages suddenly appeared. Anyone know how to get rid of them? Thanks. -- 101 USES FOR A DEAD MICROPROCESSOR (23) Dead cat brush From mmester at sps.edu Mon May 1 21:22:28 2006 From: mmester at sps.edu (Michael Mester) Date: Mon, 1 May 2006 23:22:28 -0400 Subject: [Rxtx] Windows PortInUseException Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> I'm trying to get simple serial communication going with RxTx under Windows XP. I can enumerate the ports fine, but I always run into problems when I try to open one. I get a PortInUseException, but the owner application is "Unknown" and the port is never open. I've tried this on several different systems and all of them give the same behavior. The only thing I can thiunk of that might be causing the problem is that fact that I had to put the serial .dll file in system32 instead of the reccommended folder, because it didn't work in the folder the documentation gives. The library loads fine, though, so I'm not sure whether that makes sense, and I don't know how to fix it anyway. Any help is greatly appreciated. Below is the output of the program, right up to the PortInUseException and the NullPointerException it causes (because the serial port object is not instantiated). C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI Starting GPSTalkerGUI... Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 gnu.io.PortInUseException: Unknown Application Exception in thread "main" java.lang.NullPointerException at GPSTalkerGUI.(GPSTalkerGUI.java:102) at GPSTalkerGUI.main(GPSTalkerGUI.java:161) Again, thank you very much for any help you can give. From lshellman at qwest.net Wed May 3 01:38:34 2006 From: lshellman at qwest.net (Lucious Shellman) Date: Wed, 03 May 2006 01:38:34 -0600 Subject: [Rxtx] Help needed: Project using parallel port Message-ID: <1146641914.8337.14.camel@localhost.localdomain> I was looking for a way to access the parallel port on a PC using Java. Searching the Internet, I came across this site (rxtx.org). What I am trying to do is detect logic levels from a TTL logic IC on the parallel port. I am not trying to do classic parallel port communication. I just want to detect whether a line(s) is (are) high or low. I am using Windows 98. Can rxtx be used to do this? If yes, is there a tutorial for using rxtx posted on the Internet that someone can direct me to. If you need more information, feel free to e-mail me. Unfortunately for me, I need the information ASAP. Thanks. lshellman at qwest.net From webmaster at egyhelp.com Wed May 3 18:43:39 2006 From: webmaster at egyhelp.com (Mohamed Samy) Date: Thu, 4 May 2006 02:43:39 +0200 Subject: [Rxtx] RE: Concering ircomm and RXTX In-Reply-To: Message-ID: <20060503184362.SM01044@Geek> Hey, I issue the command "modprobe ircomm-tty" yet no ttyircomm appears, while the ircomm appear by "modprobe ircomm" so forgive me but I am bit lost. Even searching google for the keyword "ttyircomm" only returns 3 matches. So any way I can start the ttyircomm???? Thanks a lot. -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Wednesday, May 03, 2006 3:31 PM To: Mohamed Samy; rxtx at qbang.org Cc: taj at www.linux.org.uk Subject: Re: Concering ircomm and RXTX On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 4 15:49:49 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 15:49:49 -0600 (MDT) Subject: [Rxtx] Windows PortInUseException In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> Message-ID: On Mon, 1 May 2006, Michael Mester wrote: > > I'm trying to get simple serial communication going with RxTx under > Windows XP. I can enumerate the ports fine, but I always run into > problems when I try to open one. I get a PortInUseException, but the > owner application is "Unknown" and the port is never open. I've tried > this on several different systems and all of them give the same > behavior. The only thing I can thiunk of that might be causing the > problem is that fact that I had to put the serial .dll file in system32 > instead of the reccommended folder, because it didn't work in the folder > the documentation gives. The library loads fine, though, so I'm not sure > whether that makes sense, and I don't know how to fix it anyway. Any > help is greatly appreciated. Below is the output of the program, right > up to the PortInUseException and the NullPointerException it causes > (because the serial port object is not instantiated). > > C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI > Starting GPSTalkerGUI... > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > gnu.io.PortInUseException: Unknown Application > Exception in thread "main" java.lang.NullPointerException > at GPSTalkerGUI.(GPSTalkerGUI.java:102) > at GPSTalkerGUI.main(GPSTalkerGUI.java:161) > Perhaps you are trying to open the port twice in your code? rxtx does open the ports, do a timed out read and then close the ports during enumeration. I think the port is being opened fine. The Unknown Application is always reported. On linux, there is some code that finds the actual application but on windows, its always unknown. If the port enumeration is returning the ports you expect, rxtx has opened the port and closed it with success. The port should open. There is also example code in the contrib directory that comes with rxtx source that has examples you can modify to work. -- Trent Jarvi tjarvi at qbang.org From Christian.Klemke at t-online.de Thu May 4 23:37:23 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Fri, 5 May 2006 07:37:23 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu> Message-ID: <004f01c67005$fc72fee0$016a10ac@NB600> Hi Paul, I was wondering about the same question some days ago and took a look at the source files. Unfortunately, I found that you can only get rid of that messages by altering and recompiling the Java code. There is a final static boolean variable called "devel" in the file "RXTXCommDriver.java" which is set to "true". This constellation causes the output after the native libraries have been loaded. No mechanism exists to suppress them otherwise :-(. Trent, does that mean that 2.1.7 is still officially a "development" version ? When will this value be changed to "false" by default ? With 2.1.8 ? It would be nice to provide a means to suppress such messages besides that static flag (maybe by setting a property called "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The output can indeed by annoying, especially when used with console applications, where the message potentially appears "in the middle" of your own output. Another possibility would be not to use System.out directly, but instead some PrintStream field which is initially set to System.out but can programatically be changed. That would allow for any kind of redirection or suppression by implementing appropriate user-defined PrintStream subclasses and making RXTX use that stream. What do you think ? Best regards, Christian ----- Original Message ----- From: "Paul Gettings" To: Sent: Thursday, May 04, 2006 10:41 PM Subject: [Rxtx] RXTX causing stdout messages > When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get > messages on stdout from the JVM: > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > As the only change was the version of RXTX (from 2.1.6), I am unsure > why the messages suddenly appeared. Anyone know how to get rid of > them? > > Thanks. > > -- > 101 USES FOR A DEAD MICROPROCESSOR > (23) Dead cat brush > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri May 5 06:09:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 06:09:46 -0600 (MDT) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <004f01c67005$fc72fee0$016a10ac@NB600> References: <20060504204122.GA6534@earth.utah.edu> <004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: On Fri, 5 May 2006, Christian Klemke wrote: > Hi Paul, > > I was wondering about the same question some days ago and took a look at the > source files. Unfortunately, I found that you can only get rid of that > messages by altering and recompiling the Java code. There is a final static > boolean variable called "devel" in the file "RXTXCommDriver.java" which is > set to "true". This constellation causes the output after the native > libraries have been loaded. No mechanism exists to suppress them otherwise > :-(. > > Trent, does that mean that 2.1.7 is still officially a "development" version > ? When will this value be changed to "false" by default ? With 2.1.8 ? It > would be nice to provide a means to suppress such messages besides that > static flag (maybe by setting a property called > "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The > output can indeed by annoying, especially when used with console > applications, where the message potentially appears "in the middle" of your > own output. Another possibility would be not to use System.out directly, but > instead some PrintStream field which is initially set to System.out but can > programatically be changed. That would allow for any kind of redirection or > suppression by implementing appropriate user-defined PrintStream subclasses > and making RXTX use that stream. What do you think ? > A patch for using properties would be accepted I'm sure. The reason the default is to display the message is not related to the development state of rxtx anymore. The problem is that people first using rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. The message prevents a great deal of email thats easily explained by the message. I question if we should support rxtx 2.0 at all anymore. If you post a patch in bugzilla, we'll put it into CVS this weekend. we'll be going through and doing such things anyhow. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri May 5 13:23:56 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 13:23:56 -0600 (MDT) Subject: [Rxtx] How to read from RxTx parallel port in Win XP In-Reply-To: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> References: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> Message-ID: On Thu, 27 Apr 2006, Worsley, Bob (Development Engineer) wrote: > I'm sorry if this is a dumb question, but I didn't find the answer in > the archives. > > I'm using the RxTx binaries for Windows on a reasonably current notebook > PC running Windows XP. I can send stuff to a printer on the parallel > port (LPT1), but I can't get anything back. > > I wrote a class that has the methods listed below. I write some data to > the printer with the "write" method and then try to read a response > using the "read" method, but I never get any data. I'd greatly > appreciate any help you can give! > > Bob Worsley > bobwoyid2 at yahoo.com > > > > > private ParallelPort parallelPort = null; > private RXTXCommDriver parallelPortDriver = null; > > > public boolean initialize() throws IOException { > if (parallelPort != null) { > return false; // Already initialized > } > > // Create the parallel port; > parallelPortDriver = new RXTXCommDriver(); > parallelPort = > (ParallelPort)parallelPortDriver.getCommPort(address, > CommPortIdentifier.PORT_PARALLEL); > > // Set the parallel port parameters. > try { > parallelPort.enableReceiveTimeout(READ_TIMEOUT); > parallelPort.disableReceiveFraming(); > parallelPort.disableReceiveThreshold(); > //parallelPort.setMode(mode); !!!!errors > } catch (UnsupportedCommOperationException e) { > throw (new IOException("Parallel port with address '" + > address > + "' cannot be configured as specified")); > } > > return true; > } > > > > public void write(final byte[] bytes) throws IOException { > initialize(); > while (busyReading) { > Thread.yield(); > } > busyWriting = true; > if (bytes.length < 1) { > return; > } > OutputStream outputStream = parallelPort.getOutputStream(); > outputStream.write(bytes); > outputStream.flush(); > outputStream.close(); > Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); > busyWriting = false; > } > > > public byte[] read() throws IOException { > > // Read up to MAX_BYTES bytes. > initialize(); > while (busyWriting) { > Thread.yield(); > } > busyReading = true; > byte[] buff = new byte[MAX_BYTES_READ]; > InputStream inputStream = parallelPort.getInputStream(); > // This read blocks until input data is available > int bytesRead = inputStream.read(buff); > inputStream.close(); > // If no data read, create empty array > if (bytesRead == -1) { > bytesRead = 0; > } > byte[] deviceBytes = new byte[bytesRead]; > System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); > if (bytesRead > 0) { > Debug.p("PPIOP.read - got data: '" + new > String(deviceBytes) + "'"); > } > busyReading = false; > return deviceBytes; > } > Hi Bob I've only used rxtx to test a hello world page printing but there are others that have used it. PPIOP? hmm what is this? :) The rxtx parallel support is behind the serial support but should be OK. As you note, the setting of modes is not supported. rxtx uses what is provided when the port is open. Are your asserting the pin for the printer being online? I suspect what often happens is people try to just use the data pins but the C API rxtx uses wants the printer to be online. There should be some posts relating to this in the rxtx mail-list archive. Some APIs are probably reading and writing from the port address (also suggested in your code as something you are looking at). RXTX currently uses a higher level C/C++ API for port access. This can still work if the API thinks the 'printer' is there. -- Trent Jarvi tjarvi at qbang.org From agrodellic at gmail.com Sat May 6 08:39:40 2006 From: agrodellic at gmail.com (Leigh Stewart) Date: Sat, 6 May 2006 10:39:40 -0400 Subject: [Rxtx] sun commapi 3 Message-ID: I think I read here: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html that rxtx-2.0 is basically fracked for now? Does anyone know of a workaround? ie can i somehow get an older version of sun's comm api and use that (not easy to find)? i mean 2.0 must be working for someone...how is it being tested. 2.1 isnt working for me....im getting nasty native exceptions etc, which is why im so set on 2.0... any ideas? From tjarvi at qbang.org Sun May 7 15:40:27 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 7 May 2006 15:40:27 -0600 (MDT) Subject: [Rxtx] sun commapi 3 In-Reply-To: References: Message-ID: On Sat, 6 May 2006, Leigh Stewart wrote: > > 2.1 isnt working for me....im getting nasty native exceptions etc, > which is why im so set on 2.0... any ideas? > Hi Leigh What native exceptions are you seeing? Which OS? The native code is almost identical between rxtx 2.0 and 2.1. Only the names have been changed to protect the inocent. :) ie: javax_comm_... vs gnu_io_... So the odds are very likely that even if you do find commapi 2.0 and get it installed, you will run into the same error. It would be better to just find and fix the problem. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Mon May 8 10:47:20 2006 From: mail at willicon.de (WILLICon) Date: Mon, 08 May 2006 18:47:20 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 Message-ID: <445F7618.3070303@willicon.de> Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/ef37e8ec/attachment-0003.html From tjarvi at qbang.org Mon May 8 16:14:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 May 2006 16:14:51 -0600 (MDT) Subject: [Rxtx] Screenshot of Application using RXTX (fwd) Message-ID: Just though someone may end up searching for 0x0D and 0x0A. Here are the details from his system. SuSE Linux 10.0 (x86_64) Kernel 2.6.13-15.8 j2se 1.4.2_11 (i586) Sun: comm3.0_u1 rxtx: rxtx-2.1-7 ---------- Forwarded message ---------- Date: Sat, 6 May 2006 20:01:46 +0200 From: Michael Poppitz To: taj at www.linux.org.uk Subject: Screenshot of Application using RXTX Hi Trent, the rxtx package works like a charm. Sun's package seemed to replace all 0x0D with 0x0A in received data on my Linux box, which is really annoying when transfering binary data. But rxtx came and saved the day - and turned out to be a lot more convenient as it does not require a configuration file. I use it for connecting to a home made logic analyzer. (http://www.sump.org/projects/analyzer/) Thanks for your great job, Michael -------------- next part -------------- A non-text attachment was scrubbed... Name: la_client.png Type: image/png Size: 16592 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/45494fbb/la_client-0003.png From tjarvi at qbang.org Tue May 9 14:56:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 May 2006 14:56:05 -0600 (MDT) Subject: [Rxtx] RXTX javax.comm: which one to install? In-Reply-To: <20060509161742.43547.qmail@web53814.mail.yahoo.com> References: <20060509161742.43547.qmail@web53814.mail.yahoo.com> Message-ID: On Tue, 9 May 2006, Adenilson Cavalcanti wrote: > Dear Trent Jarvi > > I'm trying to write a small Java app running in linux that interfaces with a device connected to serial port. > > I do have some questions about RXTX and javax.comm state of affairs, since I'm new to Java programming (used to program in plain old C writting to devices using termios and open/write/read syscalls, but this is another story). > > I ask you the favor to clarify this issues (if possible...): > > a) Sun offers to download a file (comm3.0_u1_PUTAUNIXVERSION.zip) which does contain .so files. Does it work out of box? > > b) Case negative, its there that we should use 'librxtx*.so' provided by your site? > > c) Sun's comm3 API version does work with which version of rxtx? > > I already searched google and read documentation available in rxtx site ("Java Comm Serial API How-to") but still have this issues unsolved. Any help will be appreciated. > > Best regards > > Adenilson Hi Adenilson, RXTX does not currently support javax.comm in Sun's CommAPI 3.0. I would recommend using package gnu.io provided by rxtx 2.1. -- Trent Jarvi tjarvi at qbang.org From chris.develder at intec.ugent.be Wed May 10 08:45:40 2006 From: chris.develder at intec.ugent.be (Chris Develder) Date: Wed, 10 May 2006 16:45:40 +0200 Subject: [Rxtx] rxtx troubles on ARM Message-ID: <4461FC94.6040909@intec.ugent.be> Hi all, Sorry to bother you, but I don't seem to get RXTX working on an ARM processor (xscale ixp 425, big endian). I managed to crosscompile the rxtx libs and moved it over to the ARM. Using jamvm (which is the only open source java VM we got working on the ARM), I get the following error result when running SimpleRead from Sun's javax.comm examples (commapi\examples\Simple\SimpleRead) -- see bottom of mail for complete output: "java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver" However, output shows that the RXTXCommDriver code is accessible (cf. debug and devel output of lib versions). So it doesn't seem to be a missing lib/jar issue. The error happens before RXTXCommDriver.initialize() is called, since the first line there is System.out.println("RXTXCommDriver:initialize()"); Any ideas? Cheers, Chris ---------------------------- [root at xxx(ttyp1) /work/cdvelder/xscale/test]# jamvm -Djava.library.path=/work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/jre/lib/arm -classpath /work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/lib/ext/RXTXcomm.jar:./comm.jar:. SimpleRead RXTXCommDriver {} Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTXCommDriver: Jar version = RXTX-2.1-7 native lib Version = RXTX-2.1-7 java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver gnu/io/RXTXCommDriver at javax.comm.CommPortIdentifier.loadDriver (CommPortIdentifier.java:239) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:109) at SimpleRead.main (Unknown Source) java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive (Native Method) at com.sun.comm.Portmapping.registerCommPorts (Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase (Portmapping.java:100) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:138) at SimpleRead.main (Unknown Source) From joachim at buechse.de Fri May 12 00:44:48 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 08:44:48 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) Message-ID: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Good day, I guess that only a selected few (hi Trent) will be able to answer this question, but the answer might be interesting for anyone trying to debug or understand the code. Apparently the MonitorThread is started and stopped in RXTXPort.addEventListener and RXTXPort.removeEventListener. This would indicate that (originally?) the MonitorThread is only required when there is an EventListener. However the MonitorThread is also started in the RXTXPort constructor, which could mean that RXTX won't work at all if it isn't there. It seems to me, that if anyone would add an event listener and later on remove it, he could potentially wreak the port. Because the second action would kill the MonitorThread. For the moment I am only trying to understand the role of and idea behind the MonitorThread. But of course there is a deeper reason thor my question: If the MonitorThread needs to exist anyway, it could be the thread that cleans up the port (ie calls nativeClose) - this would eliminate (a further) problem I am seeing with some USB drivers on Mac OSX. (Close blocks (after releasing the tty, but still) in the USB driver if the device is "not responding"). Greetings, Joachim From tjarvi at qbang.org Fri May 12 07:10:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 12 May 2006 07:10:59 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Fri, 12 May 2006, Joachim Buechse wrote: > Good day, > > I guess that only a selected few (hi Trent) will be able to answer > this question, but the answer might be interesting for anyone trying > to debug or understand the code. > > Apparently the MonitorThread is started and stopped in > RXTXPort.addEventListener and RXTXPort.removeEventListener. This > would indicate that (originally?) the MonitorThread is only required > when there is an EventListener. However the MonitorThread is also > started in the RXTXPort constructor, which could mean that RXTX won't > work at all if it isn't there. > > It seems to me, that if anyone would add an event listener and later > on remove it, he could potentially wreak the port. Because the second > action would kill the MonitorThread. > > > For the moment I am only trying to understand the role of and idea > behind the MonitorThread. But of course there is a deeper reason thor > my question: > > If the MonitorThread needs to exist anyway, it could be the thread > that cleans up the port (ie calls nativeClose) - this would eliminate > (a further) problem I am seeing with some USB drivers on Mac OSX. > (Close blocks (after releasing the tty, but still) in the USB driver > if the device is "not responding"). > Hi Jaochim Before commapi, rxtx did not support events. You could read, write and change port settings. The MonitorThread was added as an afterthought to support commapi events. So the way things are now his historical spaghetti not a well devised plan. It is my opinion that the MonitorThread should exist as long as the port is open. The odd starting of the thread in the constructor and addEventListener was just to get past the obvious problem of people using the port without adding listeners. -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Fri May 12 07:59:50 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 15:59:50 +0200 Subject: [Rxtx] MonitorThread -> ChangeRequest In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: <2B1E508C-8CEE-4AB7-914D-E7BA25C871A2@buechse.de> In this case I suggest removing the starting/stopping of MonitorThread in addEventListener / removeEventListener. This should not affect existing projects. On 12.05.2006, at 15:10, Trent Jarvi wrote: > It is my opinion that the MonitorThread should exist as long as the > port > is open. The odd starting of the thread in the constructor and > addEventListener was just to get past the obvious problem of people > using > the port without adding listeners. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Fri May 12 11:43:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 19:43:21 +0200 Subject: [Rxtx] Spring Cleaning - some suggestions Message-ID: The current implementation of RXTX contains quite a lot of code that will break if it is used from several threads (especially on a multi processor machine). I think it would be nice to clean this up. I suggest the following changes (which keep the current semantics and should not influence existing projects in a negative way): - InterruptedException will never be ignored or reset - read methods will be protected with a Monitor - write methods will be protected with a (separate) Monitor - close() sets the read and write monitors into a "closed" state which will lead to IOExceptions for any following call to RXTXPort.read/write. - close() will wait a finite amount of time (maybe 500ms) for the release of the read and write monitors after that, it will trigger the closing of the file descriptor to abort any pending read or write. - close() will not call close(file_desc). Instead it will "interrupt" (ie set a flag and then, pthread_kill(ABRT)) the MonitorThread, the MonitorThread will call close(file_desc). - the monitors are properly released in a finally block the try of which starts directly after obtaining the monitor. - finally will not call close(file_desc) it will only "interrupt" the MonitorThread (see above) - the native-code (esp read) does not use SA_RESTART but checks Thread.interrupted() when it receives a SIGNAL (ie system call returns with EINTR or other signalling method). The read/write monitors will be allocated from a factory whose mode can be set to fast/normal/advanced. In fast-mode it will create "non thread safe, non synchronized" pseudo-monitors. In default mode, the monitors will store the owning thread. In "advanced" mode setting the monitors into closed state will "interrupt()" threads which are blocked in a native read/write. {Reasoning close behaviour: Calling close on a file descriptor in Windows unblocks any read() or write() on the same file descriptor with an error. On Solaris < 2.7 and MacOS X however the close() will/ can block - until the read or write have finished:-(( Even the JDK people have trouble with this. I dont know how Linux reacts in this case. The best practice for BSD/Solaris is to send a signal to the thread which will usually unblock the read/write with an EINTR - this however is not guarenteed as it also depends on the device driver. So the only resolution that will certainly not block the thread calling RXTXPort.close() (which will often enough be the AWT event dispatcher or the VM finalizer thread) is to call close(fd) from another thread.} {Reasoning read behaviour: It is rather uncommon to receive a signal while reading or writing - it will happen, but checking Thread.interrupted() when it happens will not degrade performance. The checking of Thread.interrupted() can be handled by returning to Java and potententially reentering into the native code if the thread was not interrupted or by calling back into the VM from the native code. On top of this, many functions like read(byte[]) or read(byte [], int, int) are allowed to return less than the requested amount of data. Only int read() is a bit more tricky. } [Trent: From the code I can tell, that you experimented quite a bit with signals. Do you know if the Java Thread.interrupt() triggers a unix signal on Linux/Solaris? If so, which one?? References: - http://java.sun.com/docs/hotspot/VMOptions.html - http://www.hp.com/products1/unix/java/infolibrary/prog_guide/ signals.html ] On OS X (hotspot client jdk-1.4.2) I did not see any signal propagated to the SELECT of the event_loop/MonitorThread (ie no EINTR) when I call monThread.interrupt(). This is a pitty, but thats the way it is. I simply assume this is true for most system calls. How to handle this? Of course it would be possible to install/ deinstall a specific signal handler before/after every native read and to natively send an ABRT signal if RXTXPort.close is called. A more elegant solution might be to have an additional "signaling" socket which is always included in the SELECT. Or the simplest solution: cap the timeout of the select to 500 ms (the loop around it exists already) after every timeout check the Thread.interrupted() flag. From a performance perspective this should be completely invisible... On the other hand, all write() calls need to be preceeded by a SELECT as well, to avoid running into a blocking write. Best regards, Joachim From lyon at docjava.com Sat May 13 05:54:52 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 13 May 2006 07:54:52 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Dmitry suggests that we acquire an implementation of a serial port reference, use it, then release it (i.e., check it back in). Joachim says that making serial ports thread friendly might be a good idea. This is a good idea. The design pattern that is close to this idea is the "Object Pool Design Pattern". # Object Pool Manage the reuse of objects for a type of object that is expensive to create or only a limited number of a kind of object can be created. It has been described at: http://www.developer.com/java/ent/article.php/626171 and in Marks' book, Patterns in Java, Volume 1. However, the Object Pool is intended to pool objects so that each object is just like every other object. The intent of the Parametric Singleton is to enable others to access the same resource at the same time (as long as the same parameters were used in construction). It sounds like we need a NEW Design Pattern (Oh no, Doug is doing it again!). Yes friends, you got me on a role (roll) :) If you like design patterns, you can thank me later. If you don't like design patterns, blame Dmitry, it was his idea ;) And Dave, thanks for the feedback on Singleton abuse. It has led me to change the way I think about application contexts, which we will see, below. We need (drum roll please): The Parametric Object Pool Design Pattern (POP) By Douglas A. Lyon ABSTRACT The goal of the Parametric Singleton design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values, in a given context. In comparison, the goal of the POP design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values and that only one reference to the class is checked out at a time, in a given context. A context is a namespace for holding identifiers during execution. In Java, A context can be changed in any of several ways. For example, creation of a new class loader, the deserialization of an old POP or the creation of a new process all create a new namespace. The POP Design Pattern combines the Parametric Singleton Design Pattern with the check out mechanism of the Object Pool Design Pattern. This enables unique creation of instances of a class. These instances are cached in a table. When a clients asks for an instance with these parameters, the cache is checked. If the instance is not in the cache it is created. If the instance is available, the clients checks out the instance. A reference is left to the clients that checked out the instance. The POP has the role of creating objects uniquely, from parameters. It also has the role of keeping track of which clients has checked out a given object. This is just like a library keeping track of who borrowed a book. If a resource is left unavailable in a system, a deadlock can occur. Deadlock debugging is facilitated by mapping a resource to the clients that have checked it out. We apply our POP Design Pattern to the retrieval of serial ports. The goal of our system is to make sure that serial ports are checked out to only one client at a time, and that they be checked back in when the client is done. The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. Users are discouraged from calling this the Parametric Object Oriented Pool (POOP). Introduction The intent of the POP Design Pattern is to ensure that a class has only one instance for a given set of parameter values. It also provides a point of access that is global to a given context. The POP uses the Singleton Design Pattern to ensure that there is only one POP, in the given context. The POP DP is responsible for checking out a reference to a given instance, and keeping track of that instance. The instance is responsible for sharing that instance. POP requires that users of the DP implement an interface that enables a recall facility. Thus, if there is a contention for a consumed resource, the deadlock can be resolved in an orderly fashion. Motivation A system cannot tolerate multiple instances of some classes with identical parameters used by different instances at the same time. For example, you cannot have two instances use the same serial port, at the same time. You cannot have two instances that are trying to listen to the same socket connection. You cannot have two instances writing to the same file structure at the same time. Further, once a serial port is checked out by a client, it is assigned to the client. This is like the spin-lock service provided by the operating system, only in the application layer. Naturally, deadlock will occur if a resource is not released, therefore the client of the resource is tracked. Recalling a resource is required for the POP DP by virtue of the implementation of an interface. The policy on how to break a deadlock (by honoring the recall) is application specific. As the operating system is often thought of as the arbiter of consumed resources (i.e., tape drives, serial ports, etc.) we frequently leave it to an operating system implementation to resolve these contention issues. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on naming conventions (which are not well standardized). The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. The POP Design Pattern can take on the role of the peer method mapper that homogenizes the API for different operating environments. That is, it can wrapper the different locking mechanisms used in different operating systems. POP that is responsible for keeping track of the instances created and the client that has checked them out. The POP Design Pattern is implemented using the Singleton Design Pattern. In Java, the POP implementation is declared final, so that it cannot be subclassed. The class also has a private constructor, so that other classes cannot instance it. The new design pattern is called the POP design pattern and it provides a way to check out and create instances with given parameters. Applicability Use the POP Design Pattern when: 1. There must be exactly one instance of a class with the given parameters in a given context. 2. The instances must be accessible to clients from a well-known access point. 3. The instances are reusable. 4. Only one client can check out an instance at a time. Structure Insert UML diagram here. Participants The POP Clients that need instances 1. The POP defines an instance upon request from a client, if, and only if, the instance does not already exist. 2. The POP returns the instance to the client. 3. The POP is responsible for creating unique instances from given parameters. 4. The POP is responsible to recalling instances from clients. Collaborations Clients obtain a reference to a POP instance only through the singleton design pattern. If the POP instance is left in an improper state (e.g., the serial port was left open) it is NOT the role of the POP to close the IO port. However, the POP can be requested to get the instance released. Nor is it the role of the POP Design Pattern to open the port. That role is delegate to some other part of the system. Further, it is the role of the POP Design Pattern to check out resources. However, it is still possible to have, multiple threads that have multiple references to the same resource at the same time. Checkout and resource requests are MUTEX locked (i.e., synchronized). Consequences The POP Design Pattern has several benefits: 1. Controlled access to parametrically defined instances. Since the POP encapsulates its instances, there is some limited control over how and when clients access it. 2. Reduced name space. The POP pattern avoids global variables that store instances created from the same parameter. Implementation Here are implementation issues to consider when using the POP pattern: 1. Unique mapping of parameters. The POP pattern requires that there be a mean to isomorphically map the parameter space into the instance space and back again. 2. Ensure unique instances. The POP pattern makes unique instances from parameters, and it does so only once. 3. Cache instances for fast retrieval. The POP must be able to look up instances, given some set of parameters, and do so from some data structure. That is, there must be enough space to hold references to all the instances the program will need. Also, a mechanism is needed to look up and retrieve the instances quickly enough to satisfy the clients. Sample Code To be written....any volunteers? Thanks! - Doug >I don't think I get it > >On Mar 22, 2006, at 9:36 AM, David Garnier wrote: >>Using the singleton pattern in this case is >>just convenient for the programmer. Problems >>arises >>pretty quickly, especially if you attempt to unit-test your classes. > > >so you're saying that something isn't so good >because you can not test it in the convenient >way? >if that's true, I'm totally disagree >change your test, debug whatever, but if >software is efficient at runtime, works fine and >only problem is some unit test >(which is some kind of framework for testing) >then dump that unit test , dump that unit >framework and make something appropriate to the >software >you're testing > >so if Douglas want to use singletons, what's the problem? >and what do you mean by abusing of singleton usage? > >of course singleton doesn't prevent concurrent >access to the resource across the processes >unless >you're using some OS facility to prevent it, besides >singleton as it was introduced is relevant only >and only inside of the same process >otherwise it's not singleton it's something else >(let's say network singleton: so you have remote >invocation facility >and some factory method that return object created by that facility) > >I don't have any problem with using any kind of singletons. > Parametric Singleton idea (if I understand it >right) could be easily implemented in the >following way: >use a map >populate map with instances of some class and key is your parameter >(you can use lazy population too) > >if somebody ask the key check the value if it's null so resource is taken >if somebody returns the resource put it back to the map > >public synchronized static Object getSomeResource(Object parameter); >public synchronized static void returnResource(Object parameter); > >getSomeResource (inside of the same process) could return null in 2 cases >1. if somebody (from other thread for example) already took that resource >2. if OS API said that resource corresponded to >that parameter (serial port with parameter = 1 >(port #)) >is locked and unavailable; >I'm not sure that in case of serial ports we >even need those Parametric Singletons >(unless lock checking is a very expensive operation) >just ask the OS about availability of that >resource and if it's available give it away >and then OS will lock it and therefore in next >time somebody ask it just answer that resource >is locked >and return null > >for example system has 2 serial ports available >so I ask getResource("tty"); >or I ask getResource("Bluetooth-Modem"); > >and if OS is ok you can give tty or Bluetooth-Modem or both > >no need for any additional pattern I think > >back to the problem >mac os x doesn't recognize locking via files, so >it handles locking via some API >an instance of the singleton in each process >should recognize that resource is locked >(by using that API) that's all >we don't have to make things more complicate >then they are just because there is some nice >design pattern or nice unit test framework or whatever >keep things simple, make them work fast, don't introduce middle layers >unless you have really good reason to do so > >of course I could be entirely wrong, so sorry about that in advance > >thanks > > >Dmitry Markman > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx >Good day, > >I guess that only a selected few (hi Trent) will be able to answer? >this question, but the answer might be interesting for anyone trying? >to debug or understand the code. > >Apparently the MonitorThread is started and stopped in? >RXTXPort.addEventListener and RXTXPort.removeEventListener. This? >would indicate that (originally?) the MonitorThread is only required? >when there is an EventListener. However the MonitorThread is also? >started in the RXTXPort constructor, which could mean that RXTX won't? >work at all if it isn't there. > >It seems to me, that if anyone would add an event listener and later? >on remove it, he could potentially wreak the port. Because the second? >action would kill the MonitorThread. > > >For the moment I am only trying to understand the role of and idea? >behind the MonitorThread. But of course there is a deeper reason thor? >my question: > >If the MonitorThread needs to exist anyway, it could be the thread? >that cleans up the port (ie calls nativeClose) - this would eliminate? >(a further) problem I am seeing with some USB drivers on Mac OSX.? >(Close blocks (after releasing the tty, but still) in the USB driver? >if the device is "not responding"). > >Greetings, >Joachim > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Sat May 13 10:07:37 2006 From: joachim at buechse.de (Joachim Buechse) Date: Sat, 13 May 2006 18:07:37 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Douglas, Looking at the current code, leaves me with the feeling, that there is a lot to do. Defining an API that wraps javax.comm to provide what you describe is certainly possible, but I wonder how much benefit it will actually provide. Personally I think the API defined by javax.comm "request/lock" a port with: cp= new CommunicationPort(identifier) "release" a port with: cp.close(); works quite nice for 99% of the applications. In my experience, the most efficient and elegant implementation is to wrap a port/socket/.. into a business object which declares the remote operations that are possible. Ie "uploadFile", "waitForPrompt", "getSerialNumber", "sendContact", "executeCommand", etc Those methods are then either synchronized or guarded by a monitor. I do not see how your design pattern applied to the port resource would help implementing this. [details start, skip if you agree to the above] When I talked about "thread-safe" I didn't mean several independent "sessions" accessing the port concurrently. I think this is a very rare usage. I believe the most common use case for serial ports today is the control of an external device from a PC running a GUI based application. To implement a clean Swing/AWT-GUI one needs to pass any action that can block to a "worker" thread (else the GUI blocks, the application appears dead). While it is possible to use own prespawned thread that will accept Runnables which operate on the port, this is not very elegant. It is more common to spawn a new thread for every action triggered by the user. Additionally the ABORT of a running operation is often implemented via a port.close() delegated to a different thread. - During the lifetime of a port, it will usually be accessed from several different threads. Instance variables need to be set/read in synchronized regions to guarantee a correct operation based on the Java memory model. - Synchronizing the access is usually handled on the application level (synchronizing the reads/writes is usually useless from the applications view because it is not a transaction mechanism). [details end] I am very open to learn about other scenarios where your proposed design pattern applied to the port resource is beneficial to the application implementor. Best regards, Joachim On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > Dmitry suggests that we acquire an implementation of > a serial port reference, use it, then release it (i.e., check it > back in). > > Joachim says that making serial ports thread friendly might be a > good idea. > > This is a good idea. The design pattern that is close to this idea > is the "Object Pool Design Pattern". > # Object Pool From jredman at ergotech.com Sun May 14 14:28:24 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 14:28:24 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers Message-ID: <446792E8.4000506@ergotech.com> Does anyone know of any work to make RXTX work with Ethernet (telent) Terminal Servers? If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? We've used RXTX with upwards of 100 virtual COM ports on Windows and it works well. Linux is more problematic. It would be good to have an OS independent solution to accesses remote Ethernet serial ports. Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From legolas.w at gmail.com Sun May 14 14:26:34 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:56:34 +0430 Subject: [Rxtx] does any one have a working sample of RXTX and LPT port Message-ID: <4467927A.4000008@gmail.com> Hi Thank you for reading my post does any one has a working sample for RXTX and LPT port ? Thanks From legolas.w at gmail.com Sun May 14 14:27:29 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:57:29 +0430 Subject: [Rxtx] does RXTX support Trigerr on parallel port? Message-ID: <446792B1.4040905@gmail.com> Hi does RXTX support trigger on LPT port ? if so , how i can use it ? Thanks From tjarvi at qbang.org Sun May 14 17:40:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 17:40:59 -0600 (MDT) Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: <446792E8.4000506@ergotech.com> References: <446792E8.4000506@ergotech.com> Message-ID: On Sun, 14 May 2006, Jim Redman wrote: > Does anyone know of any work to make RXTX work with Ethernet (telent) > Terminal Servers? > > If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 > Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? > Hi Jim It appears the author of NVTCom has decided to release the library into the public domain. Integration with rxtx is possible but it would be best to contact the author and find out what his intent is. I would suggest contacting the author with a proposal of what you would like to do and take it from there. We could 'take' public domain software but its better to show respect to the authors and respect their wishes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:10:23 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:10:23 -0600 (MDT) Subject: [Rxtx] does any one have a working sample of RXTX and LPT port In-Reply-To: <4467927A.4000008@gmail.com> References: <4467927A.4000008@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > Thank you for reading my post > does any one has a working sample for RXTX and LPT port ? > Thanks Hi Legolas LPT port support in rxtx is spotty. That means some people have sent in patches for what they do and it works well for them. The original code was not very good. It may have been 3 hours work :/ To get started, Sun has some demo programs with their commapi. With rxtx 2.1 you can change their code from using javax.com to gnu.io and it -should- work. But if it does not you can post here and on bugzilla. There has been more interest lately off the list and maybe there will be enough community resources to get what you need going. If you do get a sample program together, we would gladly put it in the contrib directory so the next person can get things going faster. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:12:12 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:12:12 -0600 (MDT) Subject: [Rxtx] does RXTX support Trigerr on parallel port? In-Reply-To: <446792B1.4040905@gmail.com> References: <446792B1.4040905@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > does RXTX support trigger on LPT port ? > if so , how i can use it ? > Hi Legolas As mentioned in the previous post, rxtx parallel support is not very mature. But if you can point to something that describes the trigger feature, we can probably make sure its there and give a quick code example. -- Trent Jarvi tjarvi at qbang.org From jredman at ergotech.com Sun May 14 22:22:48 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 22:22:48 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: References: <446792E8.4000506@ergotech.com> Message-ID: <44680218.4080008@ergotech.com> Trent, Trent Jarvi wrote: > On Sun, 14 May 2006, Jim Redman wrote: > >> Does anyone know of any work to make RXTX work with Ethernet (telent) >> Terminal Servers? >> >> If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 >> Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? >> > > Hi Jim > > It appears the author of NVTCom has decided to release the library into > the public domain. Integration with rxtx is possible but it would be best > to contact the author and find out what his intent is. > > I would suggest contacting the author with a proposal of what you would > like to do and take it from there. We could 'take' public domain software > but its better to show respect to the authors and respect their wishes. > I sent Marco(?), the author of the library, a note before asking the list - I'll let you know the response. If anyone is already working on it, or has an interest and more time and energy than me, I'd hate to duplicate the efforts. If no one is, and no one objects, maybe I'll see what I can do. Jim > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From Christian.Klemke at t-online.de Mon May 15 02:23:06 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Mon, 15 May 2006 10:23:06 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu><004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: <008a01c677f8$cae18590$02fea8c0@NB600> Hi Trent, Hi Paul, I finally found some time to create a simple patch to enable the optional suppression of version output to the console. It is based on a new system property called "gnu.io.rxtx.NoVersionOutput" which can by set to "true" if necessary. I had some problems accessing CVS, therefore I downloaded the rxtx-2.1-7r2 source archive from ftp.qbang.org (which is linked on the rxtx.org download page) and worked with that release. Please find my proposed patch in the attachment ! Regards, Christian ----- Original Message ----- From: "Trent Jarvi" To: "RXTX Developers and Users" Cc: ""Paul Gettings"" Sent: Friday, May 05, 2006 2:09 PM Subject: Re: [Rxtx] RXTX causing stdout messages > On Fri, 5 May 2006, Christian Klemke wrote: > >> Hi Paul, >> >> I was wondering about the same question some days ago and took a look at >> the >> source files. Unfortunately, I found that you can only get rid of that >> messages by altering and recompiling the Java code. There is a final >> static >> boolean variable called "devel" in the file "RXTXCommDriver.java" which >> is >> set to "true". This constellation causes the output after the native >> libraries have been loaded. No mechanism exists to suppress them >> otherwise >> :-(. >> >> Trent, does that mean that 2.1.7 is still officially a "development" >> version >> ? When will this value be changed to "false" by default ? With 2.1.8 ? It >> would be nice to provide a means to suppress such messages besides that >> static flag (maybe by setting a property called >> "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The >> output can indeed by annoying, especially when used with console >> applications, where the message potentially appears "in the middle" of >> your >> own output. Another possibility would be not to use System.out directly, >> but >> instead some PrintStream field which is initially set to System.out but >> can >> programatically be changed. That would allow for any kind of redirection >> or >> suppression by implementing appropriate user-defined PrintStream >> subclasses >> and making RXTX use that stream. What do you think ? >> > > A patch for using properties would be accepted I'm sure. > > The reason the default is to display the message is not related to the > development state of rxtx anymore. The problem is that people first using > rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. > The message prevents a great deal of email thats easily explained by the > message. > > I question if we should support rxtx 2.0 at all anymore. > > If you post a patch in bugzilla, we'll put it into CVS this weekend. > we'll be going through and doing such things anyhow. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_version_output_patch.diff Type: application/octet-stream Size: 991 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060515/3173c2b6/rxtx_version_output_patch-0003.obj From lyon at docjava.com Mon May 15 06:06:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 May 2006 08:06:21 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Joachim makes several good points. Let me see if I can address some of them below: >Hello Douglas, > >Looking at the current code, leaves me with the feeling, that there? >is a lot to do. Yes! >Defining an API that wraps javax.comm to provide what? >you describe is certainly possible, but I wonder how much benefit it? >will actually provide. > >Personally I think the API defined by javax.comm > >"request/lock" a port with: > cp= new CommunicationPort(identifier) >"release" a port with: > cp.close(); > >works quite nice for 99% of the applications. I don't know what percentage of applications turn off locking, the way that I do in my version of the RXTX lib. I do know that this is not safe practice. I also know that it was motivated by the multi-platform nature of my code and that this was the only way I could make things work, at the time. Java does not appear to have a cross-platform standard for locking resources on various platforms. Each OS appears to have its own standard. The question of who breaks deadlocks and how this is done remains open, as this is not an easy question to resolve. Let me continue, below: > >In my experience, the most efficient and elegant implementation is to? >wrap a port/socket/.. into a business object which declares the? >remote operations that are possible. Ie "uploadFile",? >"waitForPrompt", "getSerialNumber", "sendContact", "executeCommand",? >etc Those methods are then either synchronized or guarded by a? >monitor. I do not see how your design pattern applied to the port? >resource would help implementing this. I have no problem with high-level wrappers that are application specific. That is a very good idea, but orthogonal with respect to the issue of deadlocks. More below: > >[details start, skip if you agree to the above] >When I talked about "thread-safe" I didn't mean several independent? >"sessions" accessing the port concurrently. I think this is a very? >rare usage. That is probably why turning locking off works so well! On the other hand, it is not safe and I shouldn't do it. >I believe the most common use case for serial ports today? >is the control of an external device from a PC running a GUI based? >application. To implement a clean Swing/AWT-GUI one needs to pass any? >action that can block to a "worker" thread (else the GUI blocks, the? >application appears dead). While it is possible to use own prespawned? >thread that will accept Runnables which operate on the port, this is? >not very elegant. It is more common to spawn a new thread for every? >action triggered by the user. Additionally the ABORT of a running? >operation is often implemented via a port.close() delegated to a? >different thread. Here lies the heart of serial port concern. An application opens a serial port and then dies. The application is restarted and finds the port locked. How do we clear the lock? Must the application's user reside in the UUCP group? Must installers of the serial port add users to the UUCP group? Should locking be handled at a high-level of abstraction in an operating system independent way? Should the implementation of the locking mechanism be translated into an API that is dependent on the OS convention? Suppose that we restrict the discussion to serial ports. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on inconsistent naming conventions. Hence my feeling that we need to mirror what is done in other API's; we need a locking toolkit that references peer methods, IMHO. >From the Java programming point of view, the locking API is portable across different platforms, but has, as its implementation, a native peer method that uses the conventions of the underlying OS. This enables portable resource locking (in theory!). Consider, for example: org.apache.commons.transaction.locking with: Interface LockManager at: http://jakarta.apache.org/commons/transaction/apidocs/org/apache/commons/transaction/locking/LockManager.html Or, more recently: java.util.concurrent.locks Interface Lock based on Doug Lea's code: http://kickjava.com/src/EDU/oswego/cs/dl/util/concurrent/ReadWriteLock.java.htm Should we incorporate a clean, portable design into serial port use, one that is consistent with current locking APIs? Basically, a comm port is a resource and resources are typically controlled by managers. Thus, I suggest that we make use of a CommPortManager to help control and centralize serial port usage. The question of how this is done remains open, IMHO, but using core API's like: java.util.concurrent.locks might not be amiss. High-level methods (getAllPorts, getAllSerialPorts, getAllParallelPorts, etc...) might be welcome additions. Basic questions like, "what if a port is in use?" remain open, hence my proposal for the new design pattern. Isn't it the CommPortManager's role to break the deadlock? Cheers! - Doug > >- During the lifetime of a port, it will usually be accessed from? >several different threads. Instance variables need to be set/read in? >synchronized regions to guarantee a correct operation based on the? >Java memory model. >- Synchronizing the access is usually handled on the application? >level (synchronizing the reads/writes is usually useless from the? >applications view because it is not a transaction mechanism). >[details end] > >I am very open to learn about other scenarios where your proposed? >design pattern applied to the port resource is beneficial to the? >application implementor. > >Best regards, >Joachim > >On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > >> Dmitry suggests that we acquire an implementation of >> a serial port reference, use it, then release it (i.e., check it? >> back in). >> > > Joachim says that making serial ports thread friendly might be a? >> good idea. >> >> This is a good idea. The design pattern that is close to this idea >> is the "Object Pool Design Pattern". >> # Object Pool > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Mon May 15 06:58:19 2006 From: joachim at buechse.de (Joachim Buechse) Date: Mon, 15 May 2006 14:58:19 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Doug, I agree fully, that locking of the system resource should be abstracted from the user (programmer). Currently this is already the case, but I agree it might be nice to extract the code into a separate class, which uses platform dependent providers to do its job. What I described in my email was not targeted at allocating the system resource, but at handling an already allocated system resource inside the framework. I agree that it may be possible to combine the two - however, I would suggest to do this in phase2. I can contribute a work over of RXTXPort.java which implements clean internal locking and proper close behavior (which I would call phase 1). I could do this this week. However I strongly believe that there is little sense in trying to do this as a series of patches. It will be closer to a rewrite than to a patch. I have already provided a number of suggested patches via Bugzilla, but this is quite inconvenient (for me). My working copy diverges more and more from the master and hence it gets more and more annoying to provide self contained patches. Best regards, Joachim From tjarvi at qbang.org Mon May 15 08:27:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 May 2006 08:27:51 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Mon, 15 May 2006, Joachim Buechse wrote: > Hello Doug, > > I agree fully, that locking of the system resource should be > abstracted from the user (programmer). Currently this is already the > case, but I agree it might be nice to extract the code into a > separate class, which uses platform dependent providers to do its job. > > What I described in my email was not targeted at allocating the > system resource, but at handling an already allocated system resource > inside the framework. I agree that it may be possible to combine the > two - however, I would suggest to do this in phase2. > > I can contribute a work over of RXTXPort.java which implements clean > internal locking and proper close behavior (which I would call phase > 1). I could do this this week. > > However I strongly believe that there is little sense in trying to do > this as a series of patches. It will be closer to a rewrite than to a > patch. I have already provided a number of suggested patches via > Bugzilla, but this is quite inconvenient (for me). My working copy > diverges more and more from the master and hence it gets more and > more annoying to provide self contained patches. > For methodical testing purposes (which does go on) the incremental patches are better. I'm lagging behind in bugzilla but thats soon to change (this week). It has just been rather chaotic up until now. I moved, purchased a house, and jumped into the fire of a feature freeze timeframe at a new job. btw, we see the Solaris close issues on 2.8 also. 9 and 10 are fine. I'll work towards making those test results public and allow others to run new rxtx code through them. We had the OK at one point but setting up the environment is involved. It isn't just a collection of java classes. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Tue May 16 02:01:47 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:01:47 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] Message-ID: <446986EB.209@willicon.de> Hi, any ideas for my problem? Hans -------- Original-Nachricht -------- Betreff: [Rxtx] Problem under Mac OSX 10.3.9 Datum: Mon, 08 May 2006 18:47:20 +0200 Von: WILLICon Antwort an: RXTX Developers and Users An: RXTX Developers and Users Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/b0741c2b/attachment-0003.html From joachim at buechse.de Tue May 16 02:15:08 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 10:15:08 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: Hello Hans, I am using RXTX on OS X for my own project. I do not see the problem you describe. I had some troubles installing it because the current version uses lock files which is non-standard on OS X. I have created a patched version which I currently use. This version does not need to modify user groups and hence does not need an installer. I just pop it in the application directory. If you send me a link where I can download your OSX installer, I will have a quick look. Regards, Joachim On 16.05.2006, at 10:01, WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we > have some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + > spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + > spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always > the value "false". > I can only get the status, while I open the port and catch the > exception. > > Any ideas? > > Hans > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail at willicon.de Tue May 16 02:26:53 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:26:53 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: References: <446986EB.209@willicon.de> Message-ID: <44698CCD.7050709@willicon.de> Joachim, tanks for the answer. I'll send You a mail. Hans Joachim Buechse schrieb: > Hello Hans, > > I am using RXTX on OS X for my own project. I do not see the problem > you describe. > > I had some troubles installing it because the current version uses > lock files which is non-standard on OS X. I have created a patched > version which I currently use. This version does not need to modify > user groups and hence does not need an installer. I just pop it in > the application directory. If you send me a link where I can download > your OSX installer, I will have a quick look. > > Regards, > Joachim > > On 16.05.2006, at 10:01, WILLICon wrote: > > >> Hi, >> >> any ideas for my problem? >> >> Hans >> >> -------- Original-Nachricht -------- >> Betreff: [Rxtx] Problem under Mac OSX 10.3.9 >> Datum: Mon, 08 May 2006 18:47:20 +0200 >> Von: WILLICon >> Antwort an: RXTX Developers and Users >> An: RXTX Developers and Users >> >> >> Hi, >> >> I use for RXTX for communicate with CyclingComputers. >> >> It works good under Win32, Sloaris and Linux but with Mac OSX we >> have some problems. >> >> My users install the Mac OSX serial lib from the actual binary. >> >> After starting the program, they get this error message: >> >> java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while >> loading gnu.io.RXTXCommDriver >> >> Remember, this error comes only under Mac OSX. >> >> That is the code for the error: >> >> Enumeration portList = CommPortIdentifier.getPortIdentifiers(); >> spInUse = getBundleStr("serialPortInUse"); >> spFree = getBundleStr("serialPortFree"); >> while (portList.hasMoreElements()) { >> CommPortIdentifier portId = (CommPortIdentifier) >> portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (osName != null && osName.startsWith("mac")) { >> if (!portId.getName().startsWith("dev/cu.")) { >> continue; >> } >> } >> if (portId.isCurrentlyOwned()) { >> serialPortNames.add(portId.getName() + " - " + >> spInUse); >> } >> else { >> serialPortNames.add(portId.getName() + " - " + >> spFree); >> } >> } >> } >> if (serialPortNames.size() == 0) { >> serialPortNames.add(getBundleStr("serialPortNotFound")); >> } >> >> BTW: The methode isCurrentlyOwned() is not working. I get always >> the value "false". >> I can only get the status, while I open the port and catch the >> exception. >> >> Any ideas? >> >> Hans >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/948333be/attachment-0003.html From jredman at ergotech.com Tue May 16 07:35:52 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 16 May 2006 07:35:52 -0600 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: <4469D538.6070408@ergotech.com> Hans, I have no direct insight, but would note that what you have is a "NoClassDefFoundError" not a "ClassNotFoundException". So the class javax/comm/CommDriver is found, but one of its dependencies is missing. NoClassDefFoundError are a bigger problem to resolve because you get no indication of the real problem. Jim WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we have > some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > * spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always the > value "false". > I can only get the status, while I open the port and catch the exception. > > Any ideas? > > Hans > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.de Tue May 16 08:01:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 16:01:21 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 In-Reply-To: <4469AFC3.6000002@willicon.de> References: <44698EBC.8000008@willicon.de> <8C5680C4-E2BA-42FF-B221-36E1124FA6A4@buechse.de> <4469AFC3.6000002@willicon.de> Message-ID: <9825A602-D6ED-4C28-BF33-9A7C984FACD5@buechse.de> Hallo Hans, you include RXTX 2.17 in your "bikeXexperience.jar" (2.17 uses Interfaces from gnu.io.* not javax.comm.*). Now inspect your error log closely: The class gnu.io.RXTXCommDriver tries to load javax.comm.CommDriver: this is only the case for RXTX 2.07. I assume, that the user has installed Version 2.07 into one of the java.ext.dirs . The VM always tries to load classes from the "system" path first. The current Mac installer distributed with RXTX in fact installs RXTXcomm.jar and librxtxSerial.jnilib into /Library/Java/Extensions. (I wrote some time ago that I consider this as a bad idea because of potential version conflicts-> thanks for delivering the example). For 2.07 it does so without installing the javax.comm classes it seems. I would recommend that you instruct your users to install version 2.17 only. Until RXTX is changed to use TIOCEXCL instead of lock files, you can hardly avoid the installer, as the user needs to be added to a special group and a lockfile directory needs be created. More precisely you are waiting for: http://bugzilla.qbang.org/show_bug.cgi?id=50 [RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL)] Regards, Joachim -------------- next part -------------- A non-text attachment was scrubbed... Name: log.tiff Type: image/tiff Size: 38394 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/e3e52128/log-0003.tiff -------------- next part -------------- > > Ich verwende RXTX 2.17. Das orginal RXTXcomm.jar ist in > CyclingDataManager.jar enthalten. > From tjarvi at qbang.org Wed May 17 23:18:15 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 May 2006 23:18:15 -0600 (MDT) Subject: [Rxtx] update Message-ID: So we have several patches and these have stacked up. I'd like to thank everyone for being patient. Tests for the most intrusive patches look good so far. I still have to get some bits together on my end but it looks like we can catch everything up in CVS this week. I'll try to post a normal list of what went in by whom with links Saturday. But I'm not seeing anything that raises flags yet. I also think I'll be able to submit a patch for nonstandard baud rates. I have to confirm w32 but I think its going to be a one line fix. I don't know if its bugzilla or people tinkering with patch files before submitting but patches are not applying cleanly. So the patches have to be done by hand. This may make things difficult for people hoping to add other patches on top. I'm trying to make that go well but ... -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Thu May 18 02:23:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 May 2006 10:23:47 +0200 Subject: [Rxtx] update In-Reply-To: References: Message-ID: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Hello Trent, in fact I tinkered with the patches (never used this mechanism before, usually I "communicate" via cvs) ... so sorry for any trouble you had applying them. Basicly I edited the patches to make them self contained. Having the tests run with different speeds on different platforms, may well be an effect of caching. I have seen quite interesting propagation delays for the closing flag on my PowerPC system, which makes me doubt, that the propagation of output_buffer_empty_flag works as it should. Maybe the communication mechanism between the two threads should be replaced by something like pthread_cond_*. Could you describe which problems you see on Solaris/SPARC? I'd be interested to see if they exist on OS X (PowerPC) as well... As you seem to work on the stuff at the moment I would like to suggest the following additions (it looks more than it is, I posted some context to make clear where to apply the change). See the comments in braces for what was changed Greetings, Joachim (1) The end of the drain loop could be: --- report("drain_loop: received EINTR in tcdrain\n"); --- (added "in tcdrain" to make debug output clearer) (2) The start of the drain loop should be: --- for(i=0;;i++) { report_verbose("drain_loop: looping\n"); #if defined(__sun__) /* FIXME: No time to test on all OS's for production */ if( eis->eventloop_interrupted ) { goto end; } if (usleep(5000)) { report("drain_loop: received EINTR"); } #else if (usleep(1000000)) { report("drain_loop: received EINTR"); } #endif /* __sun__ */ --- (added a check for "eis->eventloop_interrupted" before the sleep) (3) The end of interrupt_event_loop could (and maybe should) be: --- #if !defined(TIOCSERGETLSR) && !defined(WIN32) /* make sure that the drainloop unblocks from tcdrain */ pthread_kill(index->drain_tid, SIGABRT); /* TODO use wait/join/SIGCHLD/?? instead of sleep? */ usleep(50 * 1000); /* Under normal conditions, SIGABRT will unblock tcdrain. However a non-responding USB device combined with an unclean driver may still block. This is very ugly because it may block the call to close indefinetly. */ if (index->closing != 1) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); index->closing = 1; } #endif report("interruptEventLoop: interrupted\n"); --- (added some comments and pthread_cancel for resisting drain thread) On 18.05.2006, at 07:18, Trent Jarvi wrote: > > So we have several patches and these have stacked up. I'd like to > thank > everyone for being patient. > > Tests for the most intrusive patches look good so far. I still > have to > get some bits together on my end but it looks like we can catch > everything > up in CVS this week. > > I'll try to post a normal list of what went in by whom with links > Saturday. But I'm not seeing anything that raises flags yet. I also > think I'll be able to submit a patch for nonstandard baud rates. > I have > to confirm w32 but I think its going to be a one line fix. > > I don't know if its bugzilla or people tinkering with patch files > before > submitting but patches are not applying cleanly. So the patches > have to > be done by hand. This may make things difficult for people hoping > to add > other patches on top. I'm trying to make that go well but ... > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu May 18 22:28:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 18 May 2006 22:28:00 -0600 (MDT) Subject: [Rxtx] update In-Reply-To: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> References: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Message-ID: On Thu, 18 May 2006, Joachim Buechse wrote: > Hello Trent, > > in fact I tinkered with the patches (never used this mechanism > before, usually I "communicate" via cvs) ... so sorry for any trouble > you had applying them. Basicly I edited the patches to make them self > contained. I think we are close to moving towards that. > > Having the tests run with different speeds on different platforms, > may well be an effect of caching. I have seen quite interesting > propagation delays for the closing flag on my PowerPC system, which > makes me doubt, that the propagation of output_buffer_empty_flag > works as it should. Maybe the communication mechanism between the two > threads should be replaced by something like pthread_cond_*. Could > you describe which problems you see on Solaris/SPARC? I'd be > interested to see if they exist on OS X (PowerPC) as well... This is interesting. I have seen problems with output buffer empty in applications that require it. I'm trying to get a bug list and or test results open for everyone to see but that may take time. But missed output buffer events ... yep. With Sparc, we have seen a few things. One was a kernel race condition that went away when we reimaged and updated 2.8. RXTX was hanging on close, top showed no cpu use but there was 2 second delays just typing on console. The other is our tests now take ~4 times longer on Solaris. Someone is looking at timing just open, close, read, write, ... to see if they can find where the slowdown is. This happened after solaris 2.8. I'll try to share more when/if there is something interesting. This may well not be solvable in userland. > > As you seem to work on the stuff at the moment I would like to > suggest the following additions (it looks more than it is, I posted > some context to make clear where to apply the change). See the > comments in braces for what was changed I'll take a look. This could all come together Saturday but I also have an event to attend that day. I may not wrap this up until Sunday. -- Trent Jarvi tjarvi at qbang.org From andrewlord at internode.on.net Sun May 21 20:10:02 2006 From: andrewlord at internode.on.net (Andrew Lord) Date: Mon, 22 May 2006 11:40:02 +0930 Subject: [Rxtx] Kernel include files do not match kernel Message-ID: <200605221140.03271.andrewlord@internode.on.net> Hi, I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel 2.6.12-18 with the command: ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include However I get the message: ## checking java.version 1.5.0_06 ## checking os.version 2.6.12-18mdk ## ## WARNING: Kernel include files do not match the current kernel ## ## configure: creating ./config.status etc. Is there a problem with the way I'm specifying the 'include' directory ? If not, how else can I specify the correct directory for the include files please ? Cheers, Andrew From tjarvi at qbang.org Sun May 21 20:31:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 May 2006 20:31:31 -0600 (MDT) Subject: [Rxtx] Kernel include files do not match kernel In-Reply-To: <200605221140.03271.andrewlord@internode.on.net> References: <200605221140.03271.andrewlord@internode.on.net> Message-ID: On Mon, 22 May 2006, Andrew Lord wrote: > Hi, > > I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel > 2.6.12-18 with the command: > > ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk > CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include > > However I get the message: > > ## checking java.version 1.5.0_06 > ## checking os.version 2.6.12-18mdk > ## > ## WARNING: Kernel include files do not match the current kernel > ## > ## configure: creating ./config.status > etc. > > Is there a problem with the way I'm specifying the 'include' directory ? If > not, how else can I specify the correct directory for the include files > please ? > Hi Andrew I'm fairly sure your --with-kernel option does nothing. The CPPFLAGS should do what you want. Maybe put an #error message in /usr/src/linux.../incude/linux/version.h But I don't recall a recent problem with version missmatches. It should work. Distros will even ship include files that don't match versions exactly. In theory it should never matter for users. I used to compile new kernels by hand and really didnt have a distro. I didnt have a seperate package of kernel headers for users (myself). When changing a gateway from linux 1.2.12 to 2.1.77, I would worry about such messages. So if you are doing something that weird, the message may be of use to you. If you just see the message on a distro you installed, it is more than likely harmless. -- Trent Jarvi tjarvi at qbang.org From mrogers at spro.net Mon May 22 14:45:39 2006 From: mrogers at spro.net (Mike Rogers) Date: Mon, 22 May 2006 14:45:39 -0600 Subject: [Rxtx] Sun's CommAPI -- think May? Message-ID: <447222F3.9040302@spro.net> Hi, Any word from Sun about progress towards fixing the Java CommAPI v3 "incompatibilities" so RXTX 2.0 can operate within the framework's namespace (javax.comm)? I recall mention of a May time frame. Thanks, Mike From paul.klissner at sun.com Mon May 22 15:09:27 2006 From: paul.klissner at sun.com (Paul Klissner) Date: Mon, 22 May 2006 14:09:27 -0700 Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <447222F3.9040302@spro.net> References: <447222F3.9040302@spro.net> Message-ID: <44722887.8080308@sun.com> Mike Rogers wrote: > Hi, > > Any word from Sun about progress towards fixing the Java CommAPI v3 > "incompatibilities" so RXTX 2.0 can operate within the framework's > namespace (javax.comm)? I recall mention of a May time frame. > > Thanks, > > Mike > We've had a lot of work come in. This hasn't been the only priority. I'm running behind the plan in addressing this, but will be looking at it again soon. Rather than state a new, I'll just say it is in progress, and not off the table. I'll get this fixed as soon as I can. Good timing for asking as we just started discussing javax.comm plans today, and I'll have some cycles to work on it soon. Paul From yhua537 at cse.unsw.edu.au Mon May 22 16:03:05 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Tue, 23 May 2006 08:03:05 +1000 (EST) Subject: [Rxtx] install rxtx in XP Message-ID: Hi Guys, I am new to serial port programming, and have no experience on programming java in xp, but my project require me to builld a communication link between xp and a UART device. Most of the information in the web site seems for linux only. including the commands such as export and chmod. How do I install rxtx in xp? cheers YiQi Huang From mark at mdsh.com Tue May 23 01:24:20 2006 From: mark at mdsh.com (Mark Himsley) Date: Tue, 23 May 2006 08:24:20 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off , it includes DLLs for Windows and the JAR for Java. Follow the Windows instructions in the INSTALL. ie RXTXcomm.jar goes in \jre\lib\ext (under java) rxtxSerial.dll goes in \jre\bin So, assuming a fairly standard Java install, copy RXTXcomm.jar into C:\Program Files\Java\jre1.5.0_06\lib\ext and copy rxtxSerial.dll into C:\Program Files\Java\jre1.5.0_06\bin Yes, it really is that simple. On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > I am new to serial port programming, and have no experience on > programming java in xp, but my project require me to builld a > communication link between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang -- Mark Himsley From joachim at buechse.de Tue May 23 02:51:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 23 May 2006 10:51:47 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) Unless it is absolutely required you should NOT install RXTX in your global Java Runtime Environment. This will for sure create versioning conflicts - if not now, than in the future, if not on your system than at your clients. Instead put the dll in your application directory and include the RXTXcomm.jar in your classpath. This is much safer and not a bit more complicated. Regards, Joachim On 23.05.2006, at 09:24, Mark Himsley wrote: > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR > for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > >> I am new to serial port programming, and have no experience on >> programming java in xp, but my project require me to builld a >> communication link between xp and a UART device. >> >> Most of the information in the web site seems for linux only. >> including >> the commands such as export and chmod. How do I install rxtx in xp? >> >> cheers >> YiQi Huang > > > > -- > Mark Himsley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tod at todbot.com Tue May 23 03:12:22 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 02:12:22 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I totally agree: do not contaminate the Java installation. I put all the RXTX files in a directory and then change my java invocation to be: % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* Alternatively, use Launch4J to create a double-clickable application and keep the RXTX libraries in the directory of the application. -=tod On May 23, 2006, at 1:51 AM, Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > >> Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off >> , it includes DLLs for Windows and the JAR >> for Java. >> >> Follow the Windows instructions in the INSTALL. >> >> ie >> >> RXTXcomm.jar goes in \jre\lib\ext (under java) >> rxtxSerial.dll goes in \jre\bin >> >> So, assuming a fairly standard Java install, copy RXTXcomm.jar into >> C:\Program Files\Java\jre1.5.0_06\lib\ext >> and copy rxtxSerial.dll into >> C:\Program Files\Java\jre1.5.0_06\bin >> >> Yes, it really is that simple. >> >> >> >> On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: >> >>> I am new to serial port programming, and have no experience on >>> programming java in xp, but my project require me to builld a >>> communication link between xp and a UART device. >>> >>> Most of the information in the web site seems for linux only. >>> including >>> the commands such as export and chmod. How do I install rxtx in xp? >>> >>> cheers >>> YiQi Huang >> >> >> >> -- >> Mark Himsley >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From smontgomery at mediaspansoftware.com Tue May 23 08:46:53 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Tue, 23 May 2006 10:46:53 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: Message-ID: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Joachim and Tod mentioned how to keep the files RXTX requires on Windows XP out of the Java installations - thanks gentlemen! Are there similar suggestions for an RXTX install on OS X? The current "canonical" OS X installation instructions "contaminate the Java installation", to use Tod's words. Our app will run fine under 1.4.2 and 5.0 on OS X, and a lot of users will have both. We've already been burned by the recent switch from 1.4.2 to 5.0 as the platform default. Any suggestions welcomed. From tod at todbot.com Tue May 23 13:27:55 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 12:27:55 -0700 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <9BA0F670-A862-42E7-BB2C-130D775ABDF9@todbot.com> Hi Sean, It depends on how you build and deploy your code. If you're using shell scripts, you can do something like this: #!/bin/sh # pick one JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/ Commands/java #JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/ Commands/java $JAVA -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* That both picks which VM to use and uses the RXTX in the directory called 'rxtxlib'. If you want your shell script to be clever, you could test for the existence of the different 'java' executables and go from there (maybe even use different jar files). I am almost positive all OS X systems with Java 1.5 are guaranteed to also have Java 1.4.2. If you're using Jar Builder or XCode, you can specify which JVM to use and add the extra args in the Info.plist file. The paths specified in the 'java' invocation then are based off of the $JAVAROOT variable that the JavaApplicationStub sets for you. For my app, I've have been compiling two sets of jars, one compiled with 1.4.2 and one with 1.5, but they both run under 1.5. So I have a similar shell script that chooses a different 'javac' depending on the need. -=tod On May 23, 2006, at 7:46 AM, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From yhua537 at cse.unsw.edu.au Tue May 23 11:09:37 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 03:09:37 +1000 (EST) Subject: [Rxtx] install rxtx in XP (Mark Himsley, Joachim Buechse, Tod E. Kurt> In-Reply-To: References: Message-ID: > Message: 8 > Date: Tue, 23 May 2006 08:03:05 +1000 (EST) > From: YiQi Huang > Subject: [Rxtx] install rxtx in XP > To: rxtx at qbang.org > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > Hi Guys, > > I am new to serial port programming, and have no experience on programming > java in xp, but my project require me to builld a communication link > between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang > > > ------------------------------ > > Message: 9 > Date: Tue, 23 May 2006 08:24:20 +0100 > From: Mark Himsley > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=us-ascii; format=flowed > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > ------------------------------ > > Message: 10 > Date: Tue, 23 May 2006 10:51:47 +0200 > From: Joachim Buechse > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > > ------------------------------ > > Message: 11 > Date: Tue, 23 May 2006 02:12:22 -0700 > From: "Tod E. Kurt" > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I totally agree: do not contaminate the Java installation. > > I put all the RXTX files in a directory and then change my java > invocation to be: > > % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* > > Alternatively, use Launch4J to create a double-clickable application > and keep the RXTX libraries in the directory of the application. > > -=tod > > Hi, Thanks guys, I don't know if this is the correct way to reply your mecessage, if wrong, please point out. Thank you for Mark to give the detail instructions and Joachim to point out the cons ot installing in the java directory, and specially thanks for Tod to give the instrection in detail. Sorry to ask another stupid question: I have followed Tod's instruction. Now I think i am ready to start hacking. But where is the RXTX API documentation? Is it the same as using normal java comm API? btw, where could i find some examples to start with? Thanks very much cheers YiQi Huang From tjarvi at qbang.org Tue May 23 16:09:32 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 May 2006 16:09:32 -0600 (MDT) Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <44722887.8080308@sun.com> References: <447222F3.9040302@spro.net> <44722887.8080308@sun.com> Message-ID: > Good timing for asking as we just started discussing javax.comm plans > today, and I'll have some cycles to work on it soon. Hi Paul I assume you mean Sun is discussing plans concerning its own internal actions and there is no community involvment at this point. -- Trent Jarvi tjarvi at qbang.org From yhua537 at cse.unsw.edu.au Tue May 23 22:50:01 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 14:50:01 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } From mmester at sps.edu Tue May 23 22:58:21 2006 From: mmester at sps.edu (Michael Mester) Date: Wed, 24 May 2006 00:58:21 -0400 Subject: [Rxtx] install rxtx in XP References: Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below -----Original Message----- From: rxtx-bounces at qbang.org on behalf of YiQi Huang Sent: Wed 5/24/2006 12:50 AM To: RXTX Developers and Users Subject: Re: [Rxtx] install rxtx in XP Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3950 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060523/b36d0c63/attachment-0003.bin From yhua537 at cse.unsw.edu.au Tue May 23 23:05:50 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 15:05:50 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: Yes, Michael you are right, it should be semicolons, But it still can't find the correct library. On Wed, 24 May 2006, Michael Mester wrote: > I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below > > > -----Original Message----- > From: rxtx-bounces at qbang.org on behalf of YiQi Huang > Sent: Wed 5/24/2006 12:50 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] install rxtx in XP > > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > cheers YiQi Huang From tod at todbot.com Wed May 24 00:01:57 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 23:01:57 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Yes, sorry, classpath entries are semicolon-separated on Windows and colon-separated on everything else. Your example code below is importing the wrong set of classes. It should not "import javax.comm.*", instead it should "import gnu.io.*". When I make that change, your example program compiles. The "javax.comm" package is the one released by Sun, the "gnu.io" package is the RXTX one. You might've seen some discussion that the two will be merged or become compatible, but that hasn't happened yet. -=tod On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > > Yes, Michael you are right, it should be semicolons, But it still > can't > find the correct library. > > On Wed, 24 May 2006, Michael Mester wrote: > >> I believe the entries in the classpath need to be seperated with >> semicolons, not a colon as you have in your command below >> >> >> -----Original Message----- >> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >> Sent: Wed 5/24/2006 12:50 AM >> To: RXTX Developers and Users >> Subject: Re: [Rxtx] install rxtx in XP >> >> Hi, >> >> Sorry guys.I follow Tod's instruction, and here is what i did: >> >> put >> RXTXcomm.jar, >> rxtxParallel.dll, >> rxtxSerial.dll >> in >> C:\RXTX_files >> >> and I got a SimpleRead class attached below, compile it with : >> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >> it still saying "cannot find symbol". >> >> Is there anything I did wrong? Do I need the comm.jar from Sun? >> >> Thanks & regards >> YiQi Huang >> >> >> //////////////////////////////////////////////////////// >> // SimpleRead.java >> //////////////////////////////////////////////////////// >> >> import java.io.*; >> import java.util.*; >> import javax.comm.*; >> >> public class SimpleRead >> implements Runnable, SerialPortEventListener { >> static CommPortIdentifier portId; >> static Enumeration portList; >> InputStream inputStream; >> SerialPort serialPort; >> Thread readThread; >> public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == >> CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals("COM1")) { >> //if (portId.getName().equals("/dev/term/a")) { >> SimpleRead reader = new SimpleRead(); >> } >> } >> } >> } >> public SimpleRead() { >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", >> 2000); >> } catch (PortInUseException e) {} >> try { >> inputStream = serialPort.getInputStream(); >> } catch (IOException e) {} >> try { >> serialPort.addEventListener(this); >> } catch (TooManyListenersException e) {} >> serialPort.notifyOnDataAvailable(true); >> try { >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } catch (UnsupportedCommOperationException e) {} >> readThread = new Thread(this); >> readThread.start(); >> } >> public void run() { >> try { >> Thread.sleep(20000); >> } catch (InterruptedException e) {} >> } >> public void serialEvent(SerialPortEvent event) { >> switch(event.getEventType()) { >> case SerialPortEvent.BI: >> case SerialPortEvent.OE: >> case SerialPortEvent.FE: >> case SerialPortEvent.PE: >> case SerialPortEvent.CD: >> case SerialPortEvent.CTS: >> case SerialPortEvent.DSR: >> case SerialPortEvent.RI: >> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >> break; >> case SerialPortEvent.DATA_AVAILABLE: >> byte[] readBuffer = new byte[20]; >> try { >> while (inputStream.available() > 0) { >> int numBytes = inputStream.read(readBuffer); >> } >> System.out.print(new String(readBuffer)); >> } catch (IOException e) {} >> break; >> } >> } >> } >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > cheers > YiQi Huang > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From joachim at buechse.de Wed May 24 00:10:06 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:10:06 +0200 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Hi Sean, my preferred way of dealing with RXTX on OS X is to include the RXTX classes into my application jar and to put the RXTX lib in the same directory as this jar. To make it even more comfortable, you can include the lib in the jar and have some startup code extract it and write it to a temporary file from which you load it with System.load(). Unfortunately the current version of RXTX for OS X requires tinkering with user groups as it is based on lockfiles - and hence it needs the RXTX OS X installer or you need to duplicated this functionality in your own installer. I have created my own native version which is not based on lockfiles but tty locking (the standard way to do it on OSX). I hope that these patches will be integrated soon into the distribution. Regards, Joachim On 23.05.2006, at 16:46, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Wed May 24 00:16:12 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:16:12 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <7017ECFC-B13E-4806-B321-9FFCAC5830F0@buechse.de> I assume you downloaded rxtx-217 (not 207). Instead of importing javax.comm.* you must import gnu.io.* The classes have the same name, but they are not in the same package. On 24.05.2006, at 06:50, YiQi Huang wrote: > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From yhua537 at cse.unsw.edu.au Wed May 24 00:17:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 16:17:45 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Message-ID: Thanks Tod again, i kept reading "gnu.io.*" as "gun.io.*" last few hours after i read some commons from web. Thanks very much Tod. thanks YiQi Huang On Tue, 23 May 2006, Tod E. Kurt wrote: > Yes, sorry, classpath entries are semicolon-separated on Windows and > colon-separated on everything else. > > Your example code below is importing the wrong set of classes. It > should not "import javax.comm.*", instead it should "import > gnu.io.*". When I make that change, your example program compiles. > The "javax.comm" package is the one released by Sun, the "gnu.io" > package is the RXTX one. You might've seen some discussion that the > two will be merged or become compatible, but that hasn't happened yet. > > -=tod > > > On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > >> >> Yes, Michael you are right, it should be semicolons, But it still >> can't >> find the correct library. >> >> On Wed, 24 May 2006, Michael Mester wrote: >> >>> I believe the entries in the classpath need to be seperated with >>> semicolons, not a colon as you have in your command below >>> >>> >>> -----Original Message----- >>> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >>> Sent: Wed 5/24/2006 12:50 AM >>> To: RXTX Developers and Users >>> Subject: Re: [Rxtx] install rxtx in XP >>> >>> Hi, >>> >>> Sorry guys.I follow Tod's instruction, and here is what i did: >>> >>> put >>> RXTXcomm.jar, >>> rxtxParallel.dll, >>> rxtxSerial.dll >>> in >>> C:\RXTX_files >>> >>> and I got a SimpleRead class attached below, compile it with : >>> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >>> it still saying "cannot find symbol". >>> >>> Is there anything I did wrong? Do I need the comm.jar from Sun? >>> >>> Thanks & regards >>> YiQi Huang >>> >>> >>> //////////////////////////////////////////////////////// >>> // SimpleRead.java >>> //////////////////////////////////////////////////////// >>> >>> import java.io.*; >>> import java.util.*; >>> import javax.comm.*; >>> >>> public class SimpleRead >>> implements Runnable, SerialPortEventListener { >>> static CommPortIdentifier portId; >>> static Enumeration portList; >>> InputStream inputStream; >>> SerialPort serialPort; >>> Thread readThread; >>> public static void main(String[] args) { >>> portList = CommPortIdentifier.getPortIdentifiers(); >>> while (portList.hasMoreElements()) { >>> portId = (CommPortIdentifier) portList.nextElement(); >>> if (portId.getPortType() == >>> CommPortIdentifier.PORT_SERIAL) { >>> if (portId.getName().equals("COM1")) { >>> //if (portId.getName().equals("/dev/term/a")) { >>> SimpleRead reader = new SimpleRead(); >>> } >>> } >>> } >>> } >>> public SimpleRead() { >>> try { >>> serialPort = (SerialPort) portId.open("SimpleReadApp", >>> 2000); >>> } catch (PortInUseException e) {} >>> try { >>> inputStream = serialPort.getInputStream(); >>> } catch (IOException e) {} >>> try { >>> serialPort.addEventListener(this); >>> } catch (TooManyListenersException e) {} >>> serialPort.notifyOnDataAvailable(true); >>> try { >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, >>> SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> } catch (UnsupportedCommOperationException e) {} >>> readThread = new Thread(this); >>> readThread.start(); >>> } >>> public void run() { >>> try { >>> Thread.sleep(20000); >>> } catch (InterruptedException e) {} >>> } >>> public void serialEvent(SerialPortEvent event) { >>> switch(event.getEventType()) { >>> case SerialPortEvent.BI: >>> case SerialPortEvent.OE: >>> case SerialPortEvent.FE: >>> case SerialPortEvent.PE: >>> case SerialPortEvent.CD: >>> case SerialPortEvent.CTS: >>> case SerialPortEvent.DSR: >>> case SerialPortEvent.RI: >>> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >>> break; >>> case SerialPortEvent.DATA_AVAILABLE: >>> byte[] readBuffer = new byte[20]; >>> try { >>> while (inputStream.available() > 0) { >>> int numBytes = inputStream.read(readBuffer); >>> } >>> System.out.print(new String(readBuffer)); >>> } catch (IOException e) {} >>> break; >>> } >>> } >>> } >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> >> cheers >> YiQi Huang >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From smontgomery at mediaspansoftware.com Wed May 24 10:24:13 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 12:24:13 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: Tod & Joachim, Thanks for the info, that's very helpful. I'll give that a whirl when I move to rxtx 2.1. I'm still using the older 2.0.7 version for now (don't ask), which probably requires the Sun comm.jar, javax.comm.properties and librxtxSerial.jnilib to be in very specific places in each jvm's file hierarchy. From tjarvi at qbang.org Wed May 24 11:59:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 11:59:16 -0600 (MDT) Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: On Wed, 24 May 2006, Sean Montgomery wrote: > Tod & Joachim, > > Thanks for the info, that's very helpful. I'll give that a whirl > when I move to rxtx 2.1. I'm still using the older 2.0.7 version for > now (don't ask), which probably requires the Sun comm.jar, > javax.comm.properties and librxtxSerial.jnilib to be in very specific > places in each jvm's file hierarchy. > You will need comm.jar from Sun then. It must be Sun's version 2.* or older for Linux or Solaris. I assume they have this in download archives. The default offering from Sun is version 3.0. This version currently does not support rxtx. The older version will probably be fine for your needs. -- Trent Jarvi tjarvi at qbang.org From smontgomery at mediaspansoftware.com Wed May 24 12:19:06 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 14:19:06 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: <3939EFB8-11E1-4E3E-A684-5B3C525577CD@mediaspansoftware.com> Yup, that's right, thanks Trent. I've been using these files for quite a while now. Thanks for bringing it up. I almost didn't mention using 2.0.7 because I didn't want to give any new members of the list the wrong idea! :-) On May 24, 2006, at 1:59 PM, Trent Jarvi wrote: > On Wed, 24 May 2006, Sean Montgomery wrote: > >> Tod & Joachim, >> >> Thanks for the info, that's very helpful. I'll give that a whirl >> when I move to rxtx 2.1. I'm still using the older 2.0.7 version for >> now (don't ask), which probably requires the Sun comm.jar, >> javax.comm.properties and librxtxSerial.jnilib to be in very specific >> places in each jvm's file hierarchy. >> > > You will need comm.jar from Sun then. It must be Sun's version 2.* or > older for Linux or Solaris. I assume they have this in download > archives. > > The default offering from Sun is version 3.0. This version > currently does > not support rxtx. > > The older version will probably be fine for your needs. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mark at mdsh.com Wed May 24 15:55:46 2006 From: mark at mdsh.com (Mark Himsley) Date: Wed, 24 May 2006 22:55:46 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <37B0FC4B1F3237321F093ABE@MacMini.local> On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) That's no problem. BUT, do note that the instructions I elaborated on are in the INSTALL file within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone please update the INSTALL file? > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > > , it includes DLLs for Windows and the JAR > > for Java. > > > > Follow the Windows instructions in the INSTALL. > > > > ie > > > > RXTXcomm.jar goes in \jre\lib\ext (under java) > > rxtxSerial.dll goes in \jre\bin > > > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > > C:\Program Files\Java\jre1.5.0_06\lib\ext > > and copy rxtxSerial.dll into > > C:\Program Files\Java\jre1.5.0_06\bin > > > > Yes, it really is that simple. > > > > > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > > > >> I am new to serial port programming, and have no experience on > >> programming java in xp, but my project require me to builld a > >> communication link between xp and a UART device. > >> > >> Most of the information in the web site seems for linux only. > >> including > >> the commands such as export and chmod. How do I install rxtx in xp? > >> > >> cheers > >> YiQi Huang > > > > > > > > -- > > Mark Himsley > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Mark Himsley From tjarvi at qbang.org Wed May 24 16:41:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 16:41:46 -0600 (MDT) Subject: [Rxtx] install rxtx in XP In-Reply-To: <37B0FC4B1F3237321F093ABE@MacMini.local> References: <37B0FC4B1F3237321F093ABE@MacMini.local> Message-ID: On Wed, 24 May 2006, Mark Himsley wrote: > > > On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > >> I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > That's no problem. > > BUT, do note that the instructions I elaborated on are in the INSTALL file > within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone > please update the INSTALL file? > > The INSTALL file may be updated by anyone at anytime. http://rxtx.qbang.org/wiki/index.php/Installation We are moving it to the wiki so end users may put the type of answers they would like to see in. Sometimes it's best if developers don't give what appears to be cryptic answers. You can even put in that jre/lib/ext is not the right place but you don't understand the classpath solution mentioned on the mail-list and then we know what to add. -- Trent Jarvi tjarvi at qbang.org From stramit at gmail.com Wed May 24 21:45:31 2006 From: stramit at gmail.com (Tim Cooper) Date: Thu, 25 May 2006 13:45:31 +1000 Subject: [Rxtx] Accessing Virtual Com Port Message-ID: Hi, I have to develop an application that talks to a virtual com port (in this case com3) which translates any messages sent across a USB cable to a micro. Using C++ I can talk to this com port and I know that it is configured, present, and working. For the application that I am trying to write I want to use RXTX for the communication. My problem is that the configured virtual port (in windows) is not showing up when I do an enumeration over the available ports. The output I get is (com 3 is not present) : Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 PORT FOUND: COM1 PORT FOUND: LPT1 Is there anything that I need to do to make com3 available to RXTX and my application? Timothy Cooper -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060524/c5591648/attachment-0003.html From antonio.luis at iscte.pt Thu May 25 01:39:13 2006 From: antonio.luis at iscte.pt (=?ISO-8859-1?Q?Ant=F3nio_Lopes?=) Date: Thu, 25 May 2006 08:39:13 +0100 Subject: [Rxtx] RXTX on Pocket PC Message-ID: <44755F21.8060103@iscte.pt> Hello everyone, I've been using RXTX to communicate with serial ports in Windows and it's been quite successful. However, I'm now considering porting my application from Windows to Pocket PC but I can't seem to find the RXTX binaries (*.jar and *.dll) to use in Pocket PC. I've been "digging" on the mailing list's archives and also on the web and I can't find these anywhere. Can anyone in this mailing list give me some pointers on this? Where can I find the necessary files and basic installation instructions? Thanks very much for your help. I very much appreciate any help that you can provide me. Regards, -- Ant?nio Lopes @contact: antonio.luis at iscte.pt @work: ADETTI - ISCTE @web: http://antonio.lopes.googlepages.com/home From doug at dupreeinc.com Fri May 26 15:45:50 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Fri, 26 May 2006 14:45:50 -0700 Subject: [Rxtx] rxtx slow startup Message-ID: <4477770E.9010400@dupreeinc.com> Hello, I hope there are people still reading this mailing list. The archive appeared to not have anything new after 4/2005. I was using the commapi from sun for a project where a java application reads data from test equipment connected to the serial port. I had to upgrade the ftdi vcp driver on my pc and the old sun commapi no longer works with hardware flow control. as an experiment I replaced the javax.com with gnu.io in the SerialDemo.java project that was included with the commapi. This compiled fine using JBuilder 2006 and JRE 1.5.0_05. RXTX also works with the latest ftdi drivers so life is wonderful again... almost... When using the commapi jar the SerialDemo program starts in about 1 second on my system. Using the RXTX jar it takes over 56 seconds to start. Has anyone else seen this problem? Is there a workaround to get the startup performance close to the old commapi? The last thing printed to the console before this delay is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks for your time! Doug From yhua537 at cse.unsw.edu.au Sat May 27 05:46:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 21:46:45 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <4477770E.9010400@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> Message-ID: hi Doug The archive hasn't been update for a long time, But people certainly still reading the list. I don't have enough experience to help on your problem, but without any detail about what your problem doing during that 56 seconds, it is hard to target the your question, I think. cheers YiQi On Fri, 26 May 2006, Doug Thistlethwaite wrote: > Hello, > > I hope there are people still reading this mailing list. The archive > appeared to not have anything new after 4/2005. > > I was using the commapi from sun for a project where a java application > reads data from test equipment connected to the serial port. I had to > upgrade the ftdi vcp driver on my pc and the old sun commapi no longer > works with hardware flow control. as an experiment I replaced the > javax.com with gnu.io in the SerialDemo.java project that was included > with the commapi. This compiled fine using JBuilder 2006 and JRE > 1.5.0_05. RXTX also works with the latest ftdi drivers so life is > wonderful again... almost... > > When using the commapi jar the SerialDemo program starts in about 1 > second on my system. Using the RXTX jar it takes over 56 seconds to > start. Has anyone else seen this problem? Is there a workaround to get > the startup performance close to the old commapi? > > The last thing printed to the console before this delay is: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Thanks for your time! > > Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------- Just a student, Still a student ------------------------------- From yhua537 at cse.unsw.edu.au Sat May 27 06:04:26 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 22:04:26 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: Sorry, I don't think you could understand what I mean .I mean this: Without any detail about what your program is doing during that 56 seconds, it is hard for anyone to target the problem. On Sat, 27 May 2006, YiQi Huang wrote: > hi Doug > > The archive hasn't been update for a long time, But people certainly still > reading the list. > > I don't have enough experience to help on your problem, but without any > detail about what your problem doing during that 56 seconds, it is hard to > target the your question, I think. > > cheers > YiQi > > On Fri, 26 May 2006, Doug Thistlethwaite wrote: > >> Hello, >> >> I hope there are people still reading this mailing list. The archive >> appeared to not have anything new after 4/2005. >> >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From jredman at ergotech.com Sat May 27 08:32:02 2006 From: jredman at ergotech.com (Jim Redman) Date: Sat, 27 May 2006 08:32:02 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: <447862E2.4080506@ergotech.com> Doug, Since you mentioned it, we have a system that is also seems slow. From memory (I don't have one of the slow systems around), I'm not sure that it's consistent, it seems that sometimes it may take longer than others. Since it's part of the bootup it hasn't raised a flag and I haven't researched it. The same code runs much faster on other systems, so now you've got me wondering what's different. The slow system boots DSL (http://www.damnsmalllinux.org/) from a compact flash. FC4 is on my desktop where I haven't noticed a slow down. I think that the rxtx code is the same in both cases with lock files disabled. The slow system has a bunch of serial ports defined, including 4 USB serial ports that do not exist - they are not plugged in. Any clues in there? Jim > On Fri, 26 May 2006, Doug Thistlethwaite wrote: >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Sat May 27 10:41:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 May 2006 10:41:54 -0600 (MDT) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447862E2.4080506@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: On Sat, 27 May 2006, Jim Redman wrote: > Doug, > > Since you mentioned it, we have a system that is also seems slow. From > memory (I don't have one of the slow systems around), I'm not sure that > it's consistent, it seems that sometimes it may take longer than others. > Since it's part of the bootup it hasn't raised a flag and I haven't > researched it. > > The same code runs much faster on other systems, so now you've got me > wondering what's different. > > The slow system boots DSL (http://www.damnsmalllinux.org/) from a > compact flash. FC4 is on my desktop where I haven't noticed a slow > down. I think that the rxtx code is the same in both cases with lock > files disabled. > > The slow system has a bunch of serial ports defined, including 4 USB > serial ports that do not exist - they are not plugged in. > > Any clues in there? > rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. When it does this, it will try to open each port and do a timed out read. most systems will not have entries in device if the port is not there. But some minimal systems will just put all the device files there in case hardware is added. The list of devices scanned used to be ~10-20 times longer than it is today. That was getting very slow. I suspect moving the device files not used to a backup directory would increase the enumeration. I'll look into why the mail-list archive is not updating. The last update was about when I thought I 'fixed' the cron jobs. I probably didn't actually fix it but rather moved the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon May 29 19:46:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 May 2006 19:46:47 -0600 (MDT) Subject: [Rxtx] Mail-List Archives are updating. Message-ID: It was pointed out earlier that the archive is dated. This was a missing crontab entry. The list is currently archived by the week on the web page. It is updated once a day. So every 7 days it starts a new link and updates it daily. I've been limited in what I could do while my cable modem was disconnected this last week. rxtx.org is something I do on my own time. The patches and credits will be comming next. Many of these can be seen in bugzilla right now. -- Trent Jarvi tjarvi at qbang.org From doug at dupreeinc.com Tue May 30 11:18:41 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 10:18:41 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: <447C7E71.4080204@dupreeinc.com> Trent, YiQi, and Jim: Thanks to all for the replies and information! I am just back from a long weekend and I am now trying to figure out what I was doing! :) As for more information. First off, this example is being run under windows XP. I am developing test equipment that communicates with a java application via a serial port. I have been using the commapi for several years and have not had a problem. Recently, I have started a design modification that will replace the RS232 connection with a USB port. I am using the ftdi module for prototyping and I discovered that their virtual com port driver was not compatible with the commapi that Sun released. It turns out that it has problems with hardware flow control ( it works on incoming but not outgoing communications). The way I figured this out was by experimenting with the SerialDemo that was included with the Sum commapi. One nice thing about this example is it has the ability to set incoming and outgoing flow control independently. After I installed RXTX into my JBuilder 2006 IDE, I just replaced all all instances of javax.comm with gnu.io and it compiled and runs without a hitch (except for the slow startup). I Paused the JBuilder IDE during this long pause and the last few entries in the stack trace are: testRead() : -1, gnu.io.RXTXCommDriver registerValidPorts() : 255, gnu.io.RXTXCommDriver registerScannedPorts() : 777, gnu.io.RXTXCommDriver This was all initiated by the following call in the programs init routine: Enumeration en = CommPortIdentifier.getPortIdentifiers(); After looking at this, My guess is that Trent is correct in that the delay is in scanning for ports. I guess one solution would be to not scan for ports, though it would be nice to detect what is available on the system. Is there any way to reduce the number of ports scanned by this function in windows XP? Thanks again for your time, Doug Trent Jarvi wrote: >On Sat, 27 May 2006, Jim Redman wrote: > > > >>Doug, >> >>Since you mentioned it, we have a system that is also seems slow. From >>memory (I don't have one of the slow systems around), I'm not sure that >>it's consistent, it seems that sometimes it may take longer than others. >>Since it's part of the bootup it hasn't raised a flag and I haven't >>researched it. >> >>The same code runs much faster on other systems, so now you've got me >>wondering what's different. >> >>The slow system boots DSL (http://www.damnsmalllinux.org/) from a >>compact flash. FC4 is on my desktop where I haven't noticed a slow >>down. I think that the rxtx code is the same in both cases with lock >>files disabled. >> >>The slow system has a bunch of serial ports defined, including 4 USB >>serial ports that do not exist - they are not plugged in. >> >>Any clues in there? >> >> >> > >rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. > >When it does this, it will try to open each port and do a timed out read. >most systems will not have entries in device if the port is not there. >But some minimal systems will just put all the device files there in case >hardware is added. > >The list of devices scanned used to be ~10-20 times longer than it is >today. That was getting very slow. > >I suspect moving the device files not used to a backup directory would >increase the enumeration. > >I'll look into why the mail-list archive is not updating. The last update >was about when I thought I 'fixed' the cron jobs. I probably didn't >actually fix it but rather moved the problem. > >-- >Trent Jarvi >tjarvi at qbang.org > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/86796453/attachment-0003.html From doug at dupreeinc.com Tue May 30 14:36:09 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 13:36:09 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447C7E71.4080204@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com> Message-ID: <447CACB9.1000801@dupreeinc.com> Hello all, I also notice this pause (not as long however) when I call: CommPortIdentifier.getPortIdentifier(PortName); I would think that if I supply the name of the port, it would not have to go through the same discovery process. If you have any ideas of how to get rid of this startup delay, I would really appreciate it. Thanks, Doug Doug Thistlethwaite wrote: > Trent, YiQi, and Jim: > > Thanks to all for the replies and information! I am just back from a > long weekend and I am now trying to figure out what I was doing! :) > > As for more information. First off, this example is being run under > windows XP. I am developing test equipment that communicates with a > java application via a serial port. I have been using the commapi for > several years and have not had a problem. Recently, I have started a > design modification that will replace the RS232 connection with a USB > port. I am using the ftdi module for prototyping and I discovered > that their virtual com port driver was not compatible with the commapi > that Sun released. It turns out that it has problems with hardware > flow control ( it works on incoming but not outgoing communications). > The way I figured this out was by experimenting with the SerialDemo > that was included with the Sum commapi. One nice thing about this > example is it has the ability to set incoming and outgoing flow > control independently. > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup). > > I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are: > > testRead() : -1, gnu.io.RXTXCommDriver > registerValidPorts() : 255, gnu.io.RXTXCommDriver > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > This was all initiated by the following call in the programs init routine: > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > After looking at this, My guess is that Trent is correct in that the > delay is in scanning for ports. I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system. Is there any way to reduce the number of ports scanned by > this function in windows XP? > > Thanks again for your time, > > Doug > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/edaa5c3c/attachment-0003.html From lynn at swcp.com Tue May 30 15:07:18 2006 From: lynn at swcp.com (lynn@swcp.com) Date: Tue, 30 May 2006 21:07:18 -0000 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CACB9.1000801@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: *IF* the name of the port is supplied, we might want to use the preferences mechanism (java.util.prefs) where we could have previously saved the info for the port. We could do a quick check to see that things have not changed before using it. If things have changed (or never been defined) we would do a full port scan and save detected ports in the preferences. This way if the hardware is not changed, you only pay the time penalty one time. just an idea... Lynn Doug Thistlethwaite said: > This is a multi-part message in MIME format. > --------------070808020900080005070500 > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > Content-Transfer-Encoding: 7bit > > Hello all, > > I also notice this pause (not as long however) when I call: > > CommPortIdentifier.getPortIdentifier(PortName); > > I would think that if I supply the name of the port, it would not have > to go through the same discovery process. If you have any ideas of how > to get rid of this startup delay, I would really appreciate it. > > Thanks, > > Doug > > Doug Thistlethwaite wrote: > > > Trent, YiQi, and Jim: > > > > Thanks to all for the replies and information! I am just back from a > > long weekend and I am now trying to figure out what I was doing! :) > > > > As for more information. First off, this example is being run under > > windows XP. I am developing test equipment that communicates with a > > java application via a serial port. I have been using the commapi for > > several years and have not had a problem. Recently, I have started a > > design modification that will replace the RS232 connection with a USB > > port. I am using the ftdi module for prototyping and I discovered > > that their virtual com port driver was not compatible with the commapi > > that Sun released. It turns out that it has problems with hardware > > flow control ( it works on incoming but not outgoing communications). > > The way I figured this out was by experimenting with the SerialDemo > > that was included with the Sum commapi. One nice thing about this > > example is it has the ability to set incoming and outgoing flow > > control independently. > > > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > > all instances of javax.comm with gnu.io and it compiled and runs > > without a hitch (except for the slow startup). > > > > I Paused the JBuilder IDE during this long pause and the last few > > entries in the stack trace are: > > > > testRead() : -1, gnu.io.RXTXCommDriver > > registerValidPorts() : 255, gnu.io.RXTXCommDriver > > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > > > This was all initiated by the following call in the programs init routine: > > > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > > > After looking at this, My guess is that Trent is correct in that the > > delay is in scanning for ports. I guess one solution would be to not > > scan for ports, though it would be nice to detect what is available on > > the system. Is there any way to reduce the number of ports scanned by > > this function in windows XP? > > > > Thanks again for your time, > > > > Doug > > > > --------------070808020900080005070500 > Content-Type: text/html; charset=ISO-8859-1 > Content-Transfer-Encoding: 7bit > > > > > > > > > Hello all,
>
> I also notice this pause (not as long however) when I call:
>
>          CommPortIdentifier.getPortIdentifier(PortName);
>
> I would think that if I supply the name of the port, it would not have > to go through the same discovery process.  If you have any ideas of how > to get rid of this startup delay, I would really appreciate it.
>
> Thanks,
>
> Doug
>
> Doug Thistlethwaite wrote: >
> > Trent, YiQi, and Jim:
>
> Thanks to all for the replies and information!  I am just back from a > long weekend and I am now trying to figure out what I was doing! :)
>
> As for more information.  First off, this example is being run under > windows XP.  I am developing test equipment that communicates with a > java application via a serial port.  I have been using the commapi for > several years and have not had a problem.  Recently, I have started a > design modification that will replace the RS232 connection with a USB > port.  I am using the ftdi module for prototyping and I discovered that > their virtual com port driver was not compatible with the commapi that > Sun released.  It turns out that it has problems with hardware flow > control ( it works on incoming but not outgoing communications).  The > way I figured this out was by experimenting with the SerialDemo that > was included with the Sum commapi.  One nice thing about this example > is it has the ability to set incoming and outgoing flow control > independently.
>
> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup).
>
> I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are:
>
> testRead() : -1, gnu.io.RXTXCommDriver
> registerValidPorts() : 255, gnu.io.RXTXCommDriver
> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>
> This was all initiated by the following call in the programs init > routine:
>
> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>
> After looking at this,  My guess is that Trent is correct in that the > delay is in scanning for ports.  I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system.  Is there any way to reduce the number of ports scanned by > this function in windows XP? 
>
> Thanks again for your time,
>
> Doug
>
>
> > > > --------------070808020900080005070500-- > -- From jredman at ergotech.com Tue May 30 15:42:35 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 30 May 2006 15:42:35 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: <447CBC4B.2080206@ergotech.com> Lynn, If I understand your idea correctly, I don't think that this would work well for, say, USB ports since these can be easily added/removed by the end user. Jim lynn at swcp.com wrote: > *IF* the name of the port is supplied, we might want to use the preferences > mechanism (java.util.prefs) where we could have previously saved the info for > the port. We could do a quick check to see that things have not changed > before using it. If things have changed (or never been defined) we would do a > full port scan and save detected ports in the preferences. > > This way if the hardware is not changed, you only pay the time penalty one time. > > just an idea... > Lynn > > > Doug Thistlethwaite said: > >> This is a multi-part message in MIME format. >> --------------070808020900080005070500 >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >> Content-Transfer-Encoding: 7bit >> >> Hello all, >> >> I also notice this pause (not as long however) when I call: >> >> CommPortIdentifier.getPortIdentifier(PortName); >> >> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process. If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it. >> >> Thanks, >> >> Doug >> >> Doug Thistlethwaite wrote: >> >>> Trent, YiQi, and Jim: >>> >>> Thanks to all for the replies and information! I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :) >>> >>> As for more information. First off, this example is being run under >>> windows XP. I am developing test equipment that communicates with a >>> java application via a serial port. I have been using the commapi for >>> several years and have not had a problem. Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port. I am using the ftdi module for prototyping and I discovered >>> that their virtual com port driver was not compatible with the commapi >>> that Sun released. It turns out that it has problems with hardware >>> flow control ( it works on incoming but not outgoing communications). >>> The way I figured this out was by experimenting with the SerialDemo >>> that was included with the Sum commapi. One nice thing about this >>> example is it has the ability to set incoming and outgoing flow >>> control independently. >>> >>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup). >>> >>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are: >>> >>> testRead() : -1, gnu.io.RXTXCommDriver >>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>> >>> This was all initiated by the following call in the programs init routine: >>> >>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>> >>> After looking at this, My guess is that Trent is correct in that the >>> delay is in scanning for ports. I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system. Is there any way to reduce the number of ports scanned by >>> this function in windows XP? >>> >>> Thanks again for your time, >>> >>> Doug >>> >> --------------070808020900080005070500 >> Content-Type: text/html; charset=ISO-8859-1 >> Content-Transfer-Encoding: 7bit >> >> >> >> >> >> >> >> >> Hello all,
>>
>> I also notice this pause (not as long however) when I call:
>>
>>         >  CommPortIdentifier.getPortIdentifier(PortName);
>>
>> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process.  If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it.
>>
>> Thanks,
>>
>> Doug
>>
>> Doug Thistlethwaite wrote: >>
>> >> Trent, YiQi, and Jim:
>>
>> Thanks to all for the replies and information!  I am just back from a >> long weekend and I am now trying to figure out what I was doing! :)
>>
>> As for more information.  First off, this example is being run under >> windows XP.  I am developing test equipment that communicates with a >> java application via a serial port.  I have been using the commapi for >> several years and have not had a problem.  Recently, I have started a >> design modification that will replace the RS232 connection with a USB >> port.  I am using the ftdi module for prototyping and I discovered that >> their virtual com port driver was not compatible with the commapi that >> Sun released.  It turns out that it has problems with hardware flow >> control ( it works on incoming but not outgoing communications).  The >> way I figured this out was by experimenting with the SerialDemo that >> was included with the Sum commapi.  One nice thing about this example >> is it has the ability to set incoming and outgoing flow control >> independently.
>>
>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >> all instances of javax.comm with gnu.io and it compiled and runs >> without a hitch (except for the slow startup).
>>
>> I Paused the JBuilder IDE during this long pause and the last few >> entries in the stack trace are:
>>
>> testRead() : -1, gnu.io.RXTXCommDriver
>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>
>> This was all initiated by the following call in the programs init >> routine:
>>
>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>
>> After looking at this,  My guess is that Trent is correct in that the >> delay is in scanning for ports.  I guess one solution would be to not >> scan for ports, though it would be nice to detect what is available on >> the system.  Is there any way to reduce the number of ports scanned by >> this function in windows XP? 
>>
>> Thanks again for your time,
>>
>> Doug
>>
>>
>> >> >> >> --------------070808020900080005070500-- >> > > > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From yhua537 at cse.unsw.edu.au Tue May 30 18:10:23 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 31 May 2006 10:10:23 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CBC4B.2080206@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: Doug, In the SerialDemo, it allow us to save the parameters into a file, and use it when your program start up. Would this help? YiQi On Tue, 30 May 2006, Jim Redman wrote: > Lynn, > > If I understand your idea correctly, I don't think that this would work > well for, say, USB ports since these can be easily added/removed by the > end user. > > Jim > > lynn at swcp.com wrote: >> *IF* the name of the port is supplied, we might want to use the preferences >> mechanism (java.util.prefs) where we could have previously saved the info for >> the port. We could do a quick check to see that things have not changed >> before using it. If things have changed (or never been defined) we would do a >> full port scan and save detected ports in the preferences. >> >> This way if the hardware is not changed, you only pay the time penalty one time. >> >> just an idea... >> Lynn >> >> >> Doug Thistlethwaite said: >> >>> This is a multi-part message in MIME format. >>> --------------070808020900080005070500 >>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>> Content-Transfer-Encoding: 7bit >>> >>> Hello all, >>> >>> I also notice this pause (not as long however) when I call: >>> >>> CommPortIdentifier.getPortIdentifier(PortName); >>> >>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process. If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it. >>> >>> Thanks, >>> >>> Doug >>> >>> Doug Thistlethwaite wrote: >>> >>>> Trent, YiQi, and Jim: >>>> >>>> Thanks to all for the replies and information! I am just back from a >>>> long weekend and I am now trying to figure out what I was doing! :) >>>> >>>> As for more information. First off, this example is being run under >>>> windows XP. I am developing test equipment that communicates with a >>>> java application via a serial port. I have been using the commapi for >>>> several years and have not had a problem. Recently, I have started a >>>> design modification that will replace the RS232 connection with a USB >>>> port. I am using the ftdi module for prototyping and I discovered >>>> that their virtual com port driver was not compatible with the commapi >>>> that Sun released. It turns out that it has problems with hardware >>>> flow control ( it works on incoming but not outgoing communications). >>>> The way I figured this out was by experimenting with the SerialDemo >>>> that was included with the Sum commapi. One nice thing about this >>>> example is it has the ability to set incoming and outgoing flow >>>> control independently. >>>> >>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>> all instances of javax.comm with gnu.io and it compiled and runs >>>> without a hitch (except for the slow startup). >>>> >>>> I Paused the JBuilder IDE during this long pause and the last few >>>> entries in the stack trace are: >>>> >>>> testRead() : -1, gnu.io.RXTXCommDriver >>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>> >>>> This was all initiated by the following call in the programs init routine: >>>> >>>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>> >>>> After looking at this, My guess is that Trent is correct in that the >>>> delay is in scanning for ports. I guess one solution would be to not >>>> scan for ports, though it would be nice to detect what is available on >>>> the system. Is there any way to reduce the number of ports scanned by >>>> this function in windows XP? >>>> >>>> Thanks again for your time, >>>> >>>> Doug >>>> >>> --------------070808020900080005070500 >>> Content-Type: text/html; charset=ISO-8859-1 >>> Content-Transfer-Encoding: 7bit >>> >>> >>> >>> >>> >>> >>> >>> >>> Hello all,
>>>
>>> I also notice this pause (not as long however) when I call:
>>>
>>>         >>  CommPortIdentifier.getPortIdentifier(PortName);
>>>
>>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process.  If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it.
>>>
>>> Thanks,
>>>
>>> Doug
>>>
>>> Doug Thistlethwaite wrote: >>>
>>> >>> Trent, YiQi, and Jim:
>>>
>>> Thanks to all for the replies and information!  I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :)
>>>
>>> As for more information.  First off, this example is being run under >>> windows XP.  I am developing test equipment that communicates with a >>> java application via a serial port.  I have been using the commapi for >>> several years and have not had a problem.  Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port.  I am using the ftdi module for prototyping and I discovered that >>> their virtual com port driver was not compatible with the commapi that >>> Sun released.  It turns out that it has problems with hardware flow >>> control ( it works on incoming but not outgoing communications).  The >>> way I figured this out was by experimenting with the SerialDemo that >>> was included with the Sum commapi.  One nice thing about this example >>> is it has the ability to set incoming and outgoing flow control >>> independently.
>>>
>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup).
>>>
>>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are:
>>>
>>> testRead() : -1, gnu.io.RXTXCommDriver
>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>
>>> This was all initiated by the following call in the programs init >>> routine:
>>>
>>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>
>>> After looking at this,  My guess is that Trent is correct in that the >>> delay is in scanning for ports.  I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system.  Is there any way to reduce the number of ports scanned by >>> this function in windows XP? 
>>>
>>> Thanks again for your time,
>>>
>>> Doug
>>>
>>>
>>> >>> >>> >>> --------------070808020900080005070500-- >>> >> >> >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From halbleib at rechnerbetriebsgruppe.de Wed May 31 02:06:16 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 10:06:16 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp Message-ID: <447D4E78.30302@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, I getting an error while reloading my app in tomcat. At the first start everything runs well, but if i reload mit webapp by tomcat manager i get the following error. java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader Is there a possibility to unload the native library rxtxSerial.dll? thx for all help! regards tom -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 b8FT80HQ1xlbDLnRecDANCc= =heb1 -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 02:52:17 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 10:52:17 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D4E78.30302@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> Message-ID: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Hello Tom, To the best of my knowledge it is impossible to unload native libraries once loaded into the JVM. The exception you see stems from the fact, that Tomcat creates a new classloader when you "reload" the weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar is loaded from the session class loader. Try to add RXTXComm.jar to your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. Regards, Joachim On 31.05.2006, at 10:06, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 > b8FT80HQ1xlbDLnRecDANCc= > =heb1 > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From halbleib at rechnerbetriebsgruppe.de Wed May 31 03:28:35 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 11:28:35 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Message-ID: <447D61C3.1030807@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Joachim, I'm still not getting it. How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml-file? Perhaps web.xml? Regards, Tom Joachim Buechse schrieb: > Hello Tom, > > To the best of my knowledge it is impossible to unload native > libraries once loaded into the JVM. The exception you see stems from > the fact, that Tomcat creates a new classloader when you "reload" the > weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar > is loaded from the session class loader. Try to add RXTXComm.jar to > your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. > > Regards, > Joachim > > On 31.05.2006, at 10:06, Tom Halbleib wrote: > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL tzNy+/0iIUfkYYgt1+UT1ko= =pkpY -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 04:03:42 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 12:03:42 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D61C3.1030807@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> <447D61C3.1030807@rechnerbetriebsgruppe.de> Message-ID: -Xbootclasspath/a: is a start option to the java vm. Google is your friend in finding how to modfiy it and what it means: tomcat modifying bootclasspath Regards, Joachim On 31.05.2006, at 11:28, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Joachim, > > I'm still not getting it. > How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml- > file? > Perhaps web.xml? > > Regards, > Tom > > Joachim Buechse schrieb: >> Hello Tom, >> >> To the best of my knowledge it is impossible to unload native >> libraries once loaded into the JVM. The exception you see stems from >> the fact, that Tomcat creates a new classloader when you "reload" the >> weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar >> is loaded from the session class loader. Try to add RXTXComm.jar to >> your bootlclasspath (-Xbootclasspath/a:) and the problem should go >> away. >> >> Regards, >> Joachim >> >> On 31.05.2006, at 10:06, Tom Halbleib wrote: >> >> Hi all, >> >> I getting an error while reloading my app in tomcat. At the first >> start >> everything runs well, but if i reload mit webapp by tomcat manager >> i get >> the following error. >> >> java.lang.UnsatisfiedLinkError: Native Library >> C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in >> another classloader thrown while loading gnu.io.RXTXCommDriver >> Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: >> Native >> Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already >> loaded >> in another classloader >> >> >> Is there a possibility to unload the native library rxtxSerial.dll? >> >> thx for all help! >> >> regards >> >> tom > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL > tzNy+/0iIUfkYYgt1+UT1ko= > =pkpY > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From impakt01 at optusnet.com.au Wed May 31 06:55:42 2006 From: impakt01 at optusnet.com.au (Daren) Date: Wed, 31 May 2006 22:55:42 +1000 Subject: [Rxtx] (no subject) Message-ID: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/ade7ad37/attachment-0003.html From doug at dupreeinc.com Wed May 31 10:19:19 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 31 May 2006 09:19:19 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: <447DC207.3070702@dupreeinc.com> I am not sure what you are saying. The Save parameters menu option saves the current settings (baud, data bits, etc.). The long pause (~60 seconds) is when the application first starts (before loading the saved parameters). This does bring up a question, though I hate this type of kludge approach to getting this library to work... What exactly is a PortIdentifier? Is it always the same? If I stored the results from "CommPortIdentifier.getPortIdentifier(PortName);" in a file, could I use this the next time the program is executed? In this case I am using a virtual com port driver to connect to the device through a USB port. Doug YiQi Huang wrote: >Doug, > >In the SerialDemo, it allow us to save the parameters into a file, and use >it when your program start up. Would this help? > >YiQi > >On Tue, 30 May 2006, Jim Redman wrote: > > > >>Lynn, >> >>If I understand your idea correctly, I don't think that this would work >>well for, say, USB ports since these can be easily added/removed by the >>end user. >> >>Jim >> >>lynn at swcp.com wrote: >> >> >>>*IF* the name of the port is supplied, we might want to use the preferences >>>mechanism (java.util.prefs) where we could have previously saved the info for >>>the port. We could do a quick check to see that things have not changed >>>before using it. If things have changed (or never been defined) we would do a >>>full port scan and save detected ports in the preferences. >>> >>>This way if the hardware is not changed, you only pay the time penalty one time. >>> >>>just an idea... >>>Lynn >>> >>> >>>Doug Thistlethwaite said: >>> >>> >>> >>>>This is a multi-part message in MIME format. >>>>--------------070808020900080005070500 >>>>Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>>>Content-Transfer-Encoding: 7bit >>>> >>>>Hello all, >>>> >>>>I also notice this pause (not as long however) when I call: >>>> >>>> CommPortIdentifier.getPortIdentifier(PortName); >>>> >>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process. If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it. >>>> >>>>Thanks, >>>> >>>>Doug >>>> >>>>Doug Thistlethwaite wrote: >>>> >>>> >>>> >>>>>Trent, YiQi, and Jim: >>>>> >>>>>Thanks to all for the replies and information! I am just back from a >>>>>long weekend and I am now trying to figure out what I was doing! :) >>>>> >>>>>As for more information. First off, this example is being run under >>>>>windows XP. I am developing test equipment that communicates with a >>>>>java application via a serial port. I have been using the commapi for >>>>>several years and have not had a problem. Recently, I have started a >>>>>design modification that will replace the RS232 connection with a USB >>>>>port. I am using the ftdi module for prototyping and I discovered >>>>>that their virtual com port driver was not compatible with the commapi >>>>>that Sun released. It turns out that it has problems with hardware >>>>>flow control ( it works on incoming but not outgoing communications). >>>>>The way I figured this out was by experimenting with the SerialDemo >>>>>that was included with the Sum commapi. One nice thing about this >>>>>example is it has the ability to set incoming and outgoing flow >>>>>control independently. >>>>> >>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>>without a hitch (except for the slow startup). >>>>> >>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>>entries in the stack trace are: >>>>> >>>>>testRead() : -1, gnu.io.RXTXCommDriver >>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>>> >>>>>This was all initiated by the following call in the programs init routine: >>>>> >>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>>> >>>>>After looking at this, My guess is that Trent is correct in that the >>>>>delay is in scanning for ports. I guess one solution would be to not >>>>>scan for ports, though it would be nice to detect what is available on >>>>>the system. Is there any way to reduce the number of ports scanned by >>>>>this function in windows XP? >>>>> >>>>>Thanks again for your time, >>>>> >>>>>Doug >>>>> >>>>> >>>>> >>>>--------------070808020900080005070500 >>>>Content-Type: text/html; charset=ISO-8859-1 >>>>Content-Transfer-Encoding: 7bit >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>>Hello all,
>>>>
>>>>I also notice this pause (not as long however) when I call:
>>>>
>>>>        >>>> >>>> >>> CommPortIdentifier.getPortIdentifier(PortName);
>>> >>> >>>>
>>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process.  If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it.
>>>>
>>>>Thanks,
>>>>
>>>>Doug
>>>>
>>>>Doug Thistlethwaite wrote: >>>>
>>>> >>>>Trent, YiQi, and Jim:
>>>>
>>>>Thanks to all for the replies and information!  I am just back from a >>>>long weekend and I am now trying to figure out what I was doing! :)
>>>>
>>>>As for more information.  First off, this example is being run under >>>>windows XP.  I am developing test equipment that communicates with a >>>>java application via a serial port.  I have been using the commapi for >>>>several years and have not had a problem.  Recently, I have started a >>>>design modification that will replace the RS232 connection with a USB >>>>port.  I am using the ftdi module for prototyping and I discovered that >>>>their virtual com port driver was not compatible with the commapi that >>>>Sun released.  It turns out that it has problems with hardware flow >>>>control ( it works on incoming but not outgoing communications).  The >>>>way I figured this out was by experimenting with the SerialDemo that >>>>was included with the Sum commapi.  One nice thing about this example >>>>is it has the ability to set incoming and outgoing flow control >>>>independently.
>>>>
>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>without a hitch (except for the slow startup).
>>>>
>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>entries in the stack trace are:
>>>>
>>>>testRead() : -1, gnu.io.RXTXCommDriver
>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>>
>>>>This was all initiated by the following call in the programs init >>>>routine:
>>>>
>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>>
>>>>After looking at this,  My guess is that Trent is correct in that the >>>>delay is in scanning for ports.  I guess one solution would be to not >>>>scan for ports, though it would be nice to detect what is available on >>>>the system.  Is there any way to reduce the number of ports scanned by >>>>this function in windows XP? 
>>>>
>>>>Thanks again for your time,
>>>>
>>>>Doug
>>>>
>>>>
>>>> >>>> >>>> >>>>--------------070808020900080005070500-- >>>> >>>> >>>> >>> >>> >>> >>-- >>Jim Redman >>(505) 662 5156 x85 >>http://www.ergotech.com >>_______________________________________________ >>Rxtx mailing list >>Rxtx at qbang.org >>http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > >cheers >YiQi Huang >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/61d4d4c9/attachment-0003.html From impakt01 at optusnet.com.au Wed May 31 17:02:54 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 09:02:54 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Message-ID: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Hi all, I downloaded 2.1.7-pre16 and managed to build it and get it going. I made the changes as suggested by Peter Smith in an old post, by adding his code to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. Still not working, it opens the port at 9600 according to portmon.exe . Has anyone managed to get this going at a custom rate? Here is the post I'm referring to: http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 Thanks, Daren ________________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Daren Sent: Wednesday, 31 May 2006 10:56 PM To: rxtx at qbang.org Subject: [Rxtx] (no subject) Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren From tjarvi at qbang.org Wed May 31 21:44:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 May 2006 21:44:01 -0600 (MDT) Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> References: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Message-ID: On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org From impakt01 at optusnet.com.au Wed May 31 22:06:04 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 14:06:04 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: Message-ID: <200606010406.k51464X2010447@mail03.syd.optusnet.com.au> Trent, I have managed to successfully open the port at this speed using Realterm (available on sourceforge). From memory this uses DLPortIO. Using portmon.exe with realterm, even there it says that the port has opened at 1953. I changed termios.c:560 to dcb->BaudRate = 1953 ; and it still opens the port at 9600. Daren -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Thursday, 1 June 2006 1:44 PM To: RXTX Developers and Users Subject: Re: [Rxtx] custom baud rate win32 On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From smontgomery at mediaspansoftware.com Mon May 1 09:52:28 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 11:52:28 -0400 Subject: [Rxtx] RXTX, Java COMM and Windows Server 2003 on x64 experiences? Message-ID: Just wondering if anybody here has had to deploy RXTX or the javax.comm on Windows Server 2003 machines running on x64 (i.e. Xeon EM64T) and would like to relate how things went. From Sun's site, the Supported System Configurations pages give the options for that system: Java 5.0: - 32-bit Java 5.0 running on the OS in the 32-bit mode - 64-bit Java 5.0 running on the OS in the 64-bit native mode Java 1.4.2: - no options listed for EM64T processors, but potentially the standard 32-bit Java 1.4.2 could run on the OS in 32-bit mode? I guess the two main points of failure would be 1) the JVM itself and 2) the jni components. Make that three: there's gotta be hardware vendor driver support for the OS in the various modes, too. Guess I better go look at Keyspan's website... Thanks in advance for any info anyone might be able to provide. From smontgomery at mediaspansoftware.com Mon May 1 10:18:33 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 12:18:33 -0400 Subject: [Rxtx] Mailing list archive out of date? Message-ID: The mailing list archive at: http://mailman.qbang.org/pipermail/rxtx/ only shows emails through the end of March. Is there a new archive somewhere else? Didn't see anything mentioned on the wiki. From p.cain at phasefale.com.au Mon May 1 22:33:09 2006 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 02 May 2006 14:33:09 +1000 Subject: [Rxtx] RXTX and the Linux kernel. Message-ID: <4456E105.5080106@phasefale.com.au> Hi, First off the problem I am having isn't caused by RXTX itself but I'm hoping someone out there may have some knowledge that may help me. Background: I have an application monitoring a control system through a standard PC serial port which I talk to with rxtx-2.0.5. The application runs on RedHat7.3 kernel version 2.4.18 using Java 1.4. This configuration has been in use for several years and has proved to be stable. But it has become necessary for me to upgrade the OS but I'm running into problems with the serial communications. Its not that the comms don't work on the new OS (its never that simple) the comms work for a variable period of time (sometimes several hours) and then just stop, nothing on the data lines and control lines all indicate that data could flow. The new OS is Ubuntu 5.10 running kernel version 2.6.12. I have installed the OS and software on a PC and had it perform ok, then install the new OS and same software on the very same hardware and experienced the problems of them comms stopping. In the new OS I'm using Java5 to run the app but since I have experience the problem I reverted back to Java1.4 which didn't fix the problem. I've moved the app to a different system RedHat FC3 running 2.6.14 had experienced the problem. Not wanting to go through all the thing I have tried but I have established that it seems to be the 2.6 versions of the kernel that seem to be the problem and not an individual distribution of Linux. I should point out that I am using the same jar and library files for each java and OS combination. So I'm just wondering if anyone has had or heard of problems similar to these ? Or perhaps might know of what changed in the Linux serial driver (something I'm having a hard time establishing). I'm starting to run low on ideas of what to try so any help would be much appreciated. -- Peter Cain Senior Programmer Phasefale Pty Ltd From tjarvi at qbang.org Wed May 3 07:31:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 May 2006 07:31:00 -0600 (MDT) Subject: [Rxtx] Re: Concering ircomm and RXTX In-Reply-To: References: Message-ID: On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From legolas.w at gmail.com Wed May 3 08:46:23 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 19:16:23 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <4458C23F.2000003@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From legolas.w at gmail.com Wed May 3 13:10:57 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 23:40:57 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <44590041.80706@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From Lars.Hennig at wow-portal.com Thu May 4 00:39:15 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Thu, 4 May 2006 08:39:15 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: Message-ID: Hi, I could not find any solution. I therefore decided to to my own native implementation. Allthough it only supports the functions I need, it works pretty well now for me. I think the main problem there is the use of a wrong Windows API function and not setting an timeout. Regards, Lars Hennig W?rth Online World GmbH Tel. (0049)7181-258183 Mob. (0049)160-3522889 Fax. (0049)7940-153299 Lars.Hennig at wow-portal.com Gesendet von: rxtx-bounces at qbang.org 09.04.2006 10:42 Bitte antworten zu RXTX Developers and Users An d.herwald at dsh-elektronik.de, RXTX Developers and Users Kopie Thema Re: [Rxtx] USB Serialport - disconnection problems WV Proj./Teilpr.: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/7b39f374/attachment-0004.html From Pawan.Kharbanda at dot.state.co.us Thu May 4 11:00:58 2006 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Thu, 4 May 2006 11:00:58 -0600 Subject: [Rxtx] Dangling Lock Files Message-ID: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Hi, I have been using RXTX API's for the Serial Communication for quite some time now and for some of the devices we are opening and closing the connection every 2 minutes. This works great for few days and then suddenly I start seeing some "Port in Use Exception" and I see that the Lock files are still in the /var/lock folder after manually removing the lock files it works good for few hours and I see the same problem again. Can somebody explain me the scenarios why I am seeing the dangling Lock files? I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise Servers. Thanks Pawan Kharbanda -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/ba0e9261/attachment-0004.html From tjarvi at qbang.org Thu May 4 14:10:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:10:30 -0600 (MDT) Subject: [Rxtx] Dangling Lock Files In-Reply-To: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> References: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Message-ID: On Thu, 4 May 2006, Kharbanda, Pawan wrote: > Hi, > I have been using RXTX API's for the Serial Communication for quite > some time now and for some of the devices we are opening and closing the > connection every 2 minutes. This works great for few days and then > suddenly I start seeing some "Port in Use Exception" and I see that the > Lock files are still in the /var/lock folder after manually removing the > lock files it works good for few hours and I see the same problem again. > Can somebody explain me the scenarios why I am seeing the dangling Lock > files? > > I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise > Servers. Hi Pawan The next time it happens, look in the lockfile. There will be a pid. ps aux |grep 'pid' I think you will see that the application is still running for some reason. RXTX does a kill -0 on the pid to see if its alive. If not, it will remove the lockfile. So I suspect the previous program did not exit as you expected. -- Trent Jarvi tjarvi at qbang.org From Scott.Hughes at dalsemi.com Thu May 4 14:23:11 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 4 May 2006 15:23:11 -0500 Subject: [Rxtx] Wiki instructions... Message-ID: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire demo apps, when I stumbled across this tip on the wiki to add yourself to the uucp group: It may be simpler to just run usermod -G uucp jarvi Taken from: http://rxtx.qbang.org/wiki/index.php/Installation This does not work as advertised. I should have read the man page for usermod before I tried that out. If there are any groups which are not listed after the -G switch, the user is removed from those groups. On Ubuntu, this is bad... I removed myself from the Admin group, which removed my sudo priviledges. Ubuntu has no root account, so I've disabled the only account which could fix it. Anyone know of a good workaround? Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor From tjarvi at qbang.org Thu May 4 14:32:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:32:09 -0600 (MDT) Subject: [Rxtx] Wiki instructions... In-Reply-To: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> Message-ID: On Thu, 4 May 2006, Scott Hughes wrote: > I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire > demo apps, when I stumbled across this tip on the wiki to add yourself to > the uucp group: > > It may be simpler to just run > > usermod -G uucp jarvi > > Taken from: > http://rxtx.qbang.org/wiki/index.php/Installation > > This does not work as advertised. I should have read the man page for > usermod before I tried that out. If there are any groups which are not > listed after the -G switch, the user is removed from those groups. On > Ubuntu, this is bad... I removed myself from the Admin group, which removed > my sudo priviledges. Ubuntu has no root account, so I've disabled the only > account which could fix it. > > Anyone know of a good workaround? > Yikes This will get your permissions back: in grub/lilo/.. pass the following option to the kernel init=/bin/sh You are now root. when it boots, mount -o remount,rw / add yourself to the groups, reboot to get normal init going. Thats about all I can think of without sudo/root. -- Trent Jarvi tjarvi at qbang.org From Gettings at earth.utah.edu Thu May 4 14:41:22 2006 From: Gettings at earth.utah.edu (Paul Gettings) Date: Thu, 4 May 2006 14:41:22 -0600 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <20060504204122.GA6534@earth.utah.edu> When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get messages on stdout from the JVM: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 As the only change was the version of RXTX (from 2.1.6), I am unsure why the messages suddenly appeared. Anyone know how to get rid of them? Thanks. -- 101 USES FOR A DEAD MICROPROCESSOR (23) Dead cat brush From mmester at sps.edu Mon May 1 21:22:28 2006 From: mmester at sps.edu (Michael Mester) Date: Mon, 1 May 2006 23:22:28 -0400 Subject: [Rxtx] Windows PortInUseException Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> I'm trying to get simple serial communication going with RxTx under Windows XP. I can enumerate the ports fine, but I always run into problems when I try to open one. I get a PortInUseException, but the owner application is "Unknown" and the port is never open. I've tried this on several different systems and all of them give the same behavior. The only thing I can thiunk of that might be causing the problem is that fact that I had to put the serial .dll file in system32 instead of the reccommended folder, because it didn't work in the folder the documentation gives. The library loads fine, though, so I'm not sure whether that makes sense, and I don't know how to fix it anyway. Any help is greatly appreciated. Below is the output of the program, right up to the PortInUseException and the NullPointerException it causes (because the serial port object is not instantiated). C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI Starting GPSTalkerGUI... Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 gnu.io.PortInUseException: Unknown Application Exception in thread "main" java.lang.NullPointerException at GPSTalkerGUI.(GPSTalkerGUI.java:102) at GPSTalkerGUI.main(GPSTalkerGUI.java:161) Again, thank you very much for any help you can give. From lshellman at qwest.net Wed May 3 01:38:34 2006 From: lshellman at qwest.net (Lucious Shellman) Date: Wed, 03 May 2006 01:38:34 -0600 Subject: [Rxtx] Help needed: Project using parallel port Message-ID: <1146641914.8337.14.camel@localhost.localdomain> I was looking for a way to access the parallel port on a PC using Java. Searching the Internet, I came across this site (rxtx.org). What I am trying to do is detect logic levels from a TTL logic IC on the parallel port. I am not trying to do classic parallel port communication. I just want to detect whether a line(s) is (are) high or low. I am using Windows 98. Can rxtx be used to do this? If yes, is there a tutorial for using rxtx posted on the Internet that someone can direct me to. If you need more information, feel free to e-mail me. Unfortunately for me, I need the information ASAP. Thanks. lshellman at qwest.net From webmaster at egyhelp.com Wed May 3 18:43:39 2006 From: webmaster at egyhelp.com (Mohamed Samy) Date: Thu, 4 May 2006 02:43:39 +0200 Subject: [Rxtx] RE: Concering ircomm and RXTX In-Reply-To: Message-ID: <20060503184362.SM01044@Geek> Hey, I issue the command "modprobe ircomm-tty" yet no ttyircomm appears, while the ircomm appear by "modprobe ircomm" so forgive me but I am bit lost. Even searching google for the keyword "ttyircomm" only returns 3 matches. So any way I can start the ttyircomm???? Thanks a lot. -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Wednesday, May 03, 2006 3:31 PM To: Mohamed Samy; rxtx at qbang.org Cc: taj at www.linux.org.uk Subject: Re: Concering ircomm and RXTX On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 4 15:49:49 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 15:49:49 -0600 (MDT) Subject: [Rxtx] Windows PortInUseException In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> Message-ID: On Mon, 1 May 2006, Michael Mester wrote: > > I'm trying to get simple serial communication going with RxTx under > Windows XP. I can enumerate the ports fine, but I always run into > problems when I try to open one. I get a PortInUseException, but the > owner application is "Unknown" and the port is never open. I've tried > this on several different systems and all of them give the same > behavior. The only thing I can thiunk of that might be causing the > problem is that fact that I had to put the serial .dll file in system32 > instead of the reccommended folder, because it didn't work in the folder > the documentation gives. The library loads fine, though, so I'm not sure > whether that makes sense, and I don't know how to fix it anyway. Any > help is greatly appreciated. Below is the output of the program, right > up to the PortInUseException and the NullPointerException it causes > (because the serial port object is not instantiated). > > C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI > Starting GPSTalkerGUI... > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > gnu.io.PortInUseException: Unknown Application > Exception in thread "main" java.lang.NullPointerException > at GPSTalkerGUI.(GPSTalkerGUI.java:102) > at GPSTalkerGUI.main(GPSTalkerGUI.java:161) > Perhaps you are trying to open the port twice in your code? rxtx does open the ports, do a timed out read and then close the ports during enumeration. I think the port is being opened fine. The Unknown Application is always reported. On linux, there is some code that finds the actual application but on windows, its always unknown. If the port enumeration is returning the ports you expect, rxtx has opened the port and closed it with success. The port should open. There is also example code in the contrib directory that comes with rxtx source that has examples you can modify to work. -- Trent Jarvi tjarvi at qbang.org From Christian.Klemke at t-online.de Thu May 4 23:37:23 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Fri, 5 May 2006 07:37:23 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu> Message-ID: <004f01c67005$fc72fee0$016a10ac@NB600> Hi Paul, I was wondering about the same question some days ago and took a look at the source files. Unfortunately, I found that you can only get rid of that messages by altering and recompiling the Java code. There is a final static boolean variable called "devel" in the file "RXTXCommDriver.java" which is set to "true". This constellation causes the output after the native libraries have been loaded. No mechanism exists to suppress them otherwise :-(. Trent, does that mean that 2.1.7 is still officially a "development" version ? When will this value be changed to "false" by default ? With 2.1.8 ? It would be nice to provide a means to suppress such messages besides that static flag (maybe by setting a property called "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The output can indeed by annoying, especially when used with console applications, where the message potentially appears "in the middle" of your own output. Another possibility would be not to use System.out directly, but instead some PrintStream field which is initially set to System.out but can programatically be changed. That would allow for any kind of redirection or suppression by implementing appropriate user-defined PrintStream subclasses and making RXTX use that stream. What do you think ? Best regards, Christian ----- Original Message ----- From: "Paul Gettings" To: Sent: Thursday, May 04, 2006 10:41 PM Subject: [Rxtx] RXTX causing stdout messages > When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get > messages on stdout from the JVM: > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > As the only change was the version of RXTX (from 2.1.6), I am unsure > why the messages suddenly appeared. Anyone know how to get rid of > them? > > Thanks. > > -- > 101 USES FOR A DEAD MICROPROCESSOR > (23) Dead cat brush > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri May 5 06:09:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 06:09:46 -0600 (MDT) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <004f01c67005$fc72fee0$016a10ac@NB600> References: <20060504204122.GA6534@earth.utah.edu> <004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: On Fri, 5 May 2006, Christian Klemke wrote: > Hi Paul, > > I was wondering about the same question some days ago and took a look at the > source files. Unfortunately, I found that you can only get rid of that > messages by altering and recompiling the Java code. There is a final static > boolean variable called "devel" in the file "RXTXCommDriver.java" which is > set to "true". This constellation causes the output after the native > libraries have been loaded. No mechanism exists to suppress them otherwise > :-(. > > Trent, does that mean that 2.1.7 is still officially a "development" version > ? When will this value be changed to "false" by default ? With 2.1.8 ? It > would be nice to provide a means to suppress such messages besides that > static flag (maybe by setting a property called > "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The > output can indeed by annoying, especially when used with console > applications, where the message potentially appears "in the middle" of your > own output. Another possibility would be not to use System.out directly, but > instead some PrintStream field which is initially set to System.out but can > programatically be changed. That would allow for any kind of redirection or > suppression by implementing appropriate user-defined PrintStream subclasses > and making RXTX use that stream. What do you think ? > A patch for using properties would be accepted I'm sure. The reason the default is to display the message is not related to the development state of rxtx anymore. The problem is that people first using rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. The message prevents a great deal of email thats easily explained by the message. I question if we should support rxtx 2.0 at all anymore. If you post a patch in bugzilla, we'll put it into CVS this weekend. we'll be going through and doing such things anyhow. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri May 5 13:23:56 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 13:23:56 -0600 (MDT) Subject: [Rxtx] How to read from RxTx parallel port in Win XP In-Reply-To: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> References: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> Message-ID: On Thu, 27 Apr 2006, Worsley, Bob (Development Engineer) wrote: > I'm sorry if this is a dumb question, but I didn't find the answer in > the archives. > > I'm using the RxTx binaries for Windows on a reasonably current notebook > PC running Windows XP. I can send stuff to a printer on the parallel > port (LPT1), but I can't get anything back. > > I wrote a class that has the methods listed below. I write some data to > the printer with the "write" method and then try to read a response > using the "read" method, but I never get any data. I'd greatly > appreciate any help you can give! > > Bob Worsley > bobwoyid2 at yahoo.com > > > > > private ParallelPort parallelPort = null; > private RXTXCommDriver parallelPortDriver = null; > > > public boolean initialize() throws IOException { > if (parallelPort != null) { > return false; // Already initialized > } > > // Create the parallel port; > parallelPortDriver = new RXTXCommDriver(); > parallelPort = > (ParallelPort)parallelPortDriver.getCommPort(address, > CommPortIdentifier.PORT_PARALLEL); > > // Set the parallel port parameters. > try { > parallelPort.enableReceiveTimeout(READ_TIMEOUT); > parallelPort.disableReceiveFraming(); > parallelPort.disableReceiveThreshold(); > //parallelPort.setMode(mode); !!!!errors > } catch (UnsupportedCommOperationException e) { > throw (new IOException("Parallel port with address '" + > address > + "' cannot be configured as specified")); > } > > return true; > } > > > > public void write(final byte[] bytes) throws IOException { > initialize(); > while (busyReading) { > Thread.yield(); > } > busyWriting = true; > if (bytes.length < 1) { > return; > } > OutputStream outputStream = parallelPort.getOutputStream(); > outputStream.write(bytes); > outputStream.flush(); > outputStream.close(); > Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); > busyWriting = false; > } > > > public byte[] read() throws IOException { > > // Read up to MAX_BYTES bytes. > initialize(); > while (busyWriting) { > Thread.yield(); > } > busyReading = true; > byte[] buff = new byte[MAX_BYTES_READ]; > InputStream inputStream = parallelPort.getInputStream(); > // This read blocks until input data is available > int bytesRead = inputStream.read(buff); > inputStream.close(); > // If no data read, create empty array > if (bytesRead == -1) { > bytesRead = 0; > } > byte[] deviceBytes = new byte[bytesRead]; > System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); > if (bytesRead > 0) { > Debug.p("PPIOP.read - got data: '" + new > String(deviceBytes) + "'"); > } > busyReading = false; > return deviceBytes; > } > Hi Bob I've only used rxtx to test a hello world page printing but there are others that have used it. PPIOP? hmm what is this? :) The rxtx parallel support is behind the serial support but should be OK. As you note, the setting of modes is not supported. rxtx uses what is provided when the port is open. Are your asserting the pin for the printer being online? I suspect what often happens is people try to just use the data pins but the C API rxtx uses wants the printer to be online. There should be some posts relating to this in the rxtx mail-list archive. Some APIs are probably reading and writing from the port address (also suggested in your code as something you are looking at). RXTX currently uses a higher level C/C++ API for port access. This can still work if the API thinks the 'printer' is there. -- Trent Jarvi tjarvi at qbang.org From agrodellic at gmail.com Sat May 6 08:39:40 2006 From: agrodellic at gmail.com (Leigh Stewart) Date: Sat, 6 May 2006 10:39:40 -0400 Subject: [Rxtx] sun commapi 3 Message-ID: I think I read here: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html that rxtx-2.0 is basically fracked for now? Does anyone know of a workaround? ie can i somehow get an older version of sun's comm api and use that (not easy to find)? i mean 2.0 must be working for someone...how is it being tested. 2.1 isnt working for me....im getting nasty native exceptions etc, which is why im so set on 2.0... any ideas? From tjarvi at qbang.org Sun May 7 15:40:27 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 7 May 2006 15:40:27 -0600 (MDT) Subject: [Rxtx] sun commapi 3 In-Reply-To: References: Message-ID: On Sat, 6 May 2006, Leigh Stewart wrote: > > 2.1 isnt working for me....im getting nasty native exceptions etc, > which is why im so set on 2.0... any ideas? > Hi Leigh What native exceptions are you seeing? Which OS? The native code is almost identical between rxtx 2.0 and 2.1. Only the names have been changed to protect the inocent. :) ie: javax_comm_... vs gnu_io_... So the odds are very likely that even if you do find commapi 2.0 and get it installed, you will run into the same error. It would be better to just find and fix the problem. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Mon May 8 10:47:20 2006 From: mail at willicon.de (WILLICon) Date: Mon, 08 May 2006 18:47:20 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 Message-ID: <445F7618.3070303@willicon.de> Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/ef37e8ec/attachment-0004.html From tjarvi at qbang.org Mon May 8 16:14:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 May 2006 16:14:51 -0600 (MDT) Subject: [Rxtx] Screenshot of Application using RXTX (fwd) Message-ID: Just though someone may end up searching for 0x0D and 0x0A. Here are the details from his system. SuSE Linux 10.0 (x86_64) Kernel 2.6.13-15.8 j2se 1.4.2_11 (i586) Sun: comm3.0_u1 rxtx: rxtx-2.1-7 ---------- Forwarded message ---------- Date: Sat, 6 May 2006 20:01:46 +0200 From: Michael Poppitz To: taj at www.linux.org.uk Subject: Screenshot of Application using RXTX Hi Trent, the rxtx package works like a charm. Sun's package seemed to replace all 0x0D with 0x0A in received data on my Linux box, which is really annoying when transfering binary data. But rxtx came and saved the day - and turned out to be a lot more convenient as it does not require a configuration file. I use it for connecting to a home made logic analyzer. (http://www.sump.org/projects/analyzer/) Thanks for your great job, Michael -------------- next part -------------- A non-text attachment was scrubbed... Name: la_client.png Type: image/png Size: 16592 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/45494fbb/la_client-0004.png From tjarvi at qbang.org Tue May 9 14:56:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 May 2006 14:56:05 -0600 (MDT) Subject: [Rxtx] RXTX javax.comm: which one to install? In-Reply-To: <20060509161742.43547.qmail@web53814.mail.yahoo.com> References: <20060509161742.43547.qmail@web53814.mail.yahoo.com> Message-ID: On Tue, 9 May 2006, Adenilson Cavalcanti wrote: > Dear Trent Jarvi > > I'm trying to write a small Java app running in linux that interfaces with a device connected to serial port. > > I do have some questions about RXTX and javax.comm state of affairs, since I'm new to Java programming (used to program in plain old C writting to devices using termios and open/write/read syscalls, but this is another story). > > I ask you the favor to clarify this issues (if possible...): > > a) Sun offers to download a file (comm3.0_u1_PUTAUNIXVERSION.zip) which does contain .so files. Does it work out of box? > > b) Case negative, its there that we should use 'librxtx*.so' provided by your site? > > c) Sun's comm3 API version does work with which version of rxtx? > > I already searched google and read documentation available in rxtx site ("Java Comm Serial API How-to") but still have this issues unsolved. Any help will be appreciated. > > Best regards > > Adenilson Hi Adenilson, RXTX does not currently support javax.comm in Sun's CommAPI 3.0. I would recommend using package gnu.io provided by rxtx 2.1. -- Trent Jarvi tjarvi at qbang.org From chris.develder at intec.ugent.be Wed May 10 08:45:40 2006 From: chris.develder at intec.ugent.be (Chris Develder) Date: Wed, 10 May 2006 16:45:40 +0200 Subject: [Rxtx] rxtx troubles on ARM Message-ID: <4461FC94.6040909@intec.ugent.be> Hi all, Sorry to bother you, but I don't seem to get RXTX working on an ARM processor (xscale ixp 425, big endian). I managed to crosscompile the rxtx libs and moved it over to the ARM. Using jamvm (which is the only open source java VM we got working on the ARM), I get the following error result when running SimpleRead from Sun's javax.comm examples (commapi\examples\Simple\SimpleRead) -- see bottom of mail for complete output: "java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver" However, output shows that the RXTXCommDriver code is accessible (cf. debug and devel output of lib versions). So it doesn't seem to be a missing lib/jar issue. The error happens before RXTXCommDriver.initialize() is called, since the first line there is System.out.println("RXTXCommDriver:initialize()"); Any ideas? Cheers, Chris ---------------------------- [root at xxx(ttyp1) /work/cdvelder/xscale/test]# jamvm -Djava.library.path=/work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/jre/lib/arm -classpath /work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/lib/ext/RXTXcomm.jar:./comm.jar:. SimpleRead RXTXCommDriver {} Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTXCommDriver: Jar version = RXTX-2.1-7 native lib Version = RXTX-2.1-7 java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver gnu/io/RXTXCommDriver at javax.comm.CommPortIdentifier.loadDriver (CommPortIdentifier.java:239) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:109) at SimpleRead.main (Unknown Source) java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive (Native Method) at com.sun.comm.Portmapping.registerCommPorts (Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase (Portmapping.java:100) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:138) at SimpleRead.main (Unknown Source) From joachim at buechse.de Fri May 12 00:44:48 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 08:44:48 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) Message-ID: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Good day, I guess that only a selected few (hi Trent) will be able to answer this question, but the answer might be interesting for anyone trying to debug or understand the code. Apparently the MonitorThread is started and stopped in RXTXPort.addEventListener and RXTXPort.removeEventListener. This would indicate that (originally?) the MonitorThread is only required when there is an EventListener. However the MonitorThread is also started in the RXTXPort constructor, which could mean that RXTX won't work at all if it isn't there. It seems to me, that if anyone would add an event listener and later on remove it, he could potentially wreak the port. Because the second action would kill the MonitorThread. For the moment I am only trying to understand the role of and idea behind the MonitorThread. But of course there is a deeper reason thor my question: If the MonitorThread needs to exist anyway, it could be the thread that cleans up the port (ie calls nativeClose) - this would eliminate (a further) problem I am seeing with some USB drivers on Mac OSX. (Close blocks (after releasing the tty, but still) in the USB driver if the device is "not responding"). Greetings, Joachim From tjarvi at qbang.org Fri May 12 07:10:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 12 May 2006 07:10:59 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Fri, 12 May 2006, Joachim Buechse wrote: > Good day, > > I guess that only a selected few (hi Trent) will be able to answer > this question, but the answer might be interesting for anyone trying > to debug or understand the code. > > Apparently the MonitorThread is started and stopped in > RXTXPort.addEventListener and RXTXPort.removeEventListener. This > would indicate that (originally?) the MonitorThread is only required > when there is an EventListener. However the MonitorThread is also > started in the RXTXPort constructor, which could mean that RXTX won't > work at all if it isn't there. > > It seems to me, that if anyone would add an event listener and later > on remove it, he could potentially wreak the port. Because the second > action would kill the MonitorThread. > > > For the moment I am only trying to understand the role of and idea > behind the MonitorThread. But of course there is a deeper reason thor > my question: > > If the MonitorThread needs to exist anyway, it could be the thread > that cleans up the port (ie calls nativeClose) - this would eliminate > (a further) problem I am seeing with some USB drivers on Mac OSX. > (Close blocks (after releasing the tty, but still) in the USB driver > if the device is "not responding"). > Hi Jaochim Before commapi, rxtx did not support events. You could read, write and change port settings. The MonitorThread was added as an afterthought to support commapi events. So the way things are now his historical spaghetti not a well devised plan. It is my opinion that the MonitorThread should exist as long as the port is open. The odd starting of the thread in the constructor and addEventListener was just to get past the obvious problem of people using the port without adding listeners. -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Fri May 12 07:59:50 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 15:59:50 +0200 Subject: [Rxtx] MonitorThread -> ChangeRequest In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: <2B1E508C-8CEE-4AB7-914D-E7BA25C871A2@buechse.de> In this case I suggest removing the starting/stopping of MonitorThread in addEventListener / removeEventListener. This should not affect existing projects. On 12.05.2006, at 15:10, Trent Jarvi wrote: > It is my opinion that the MonitorThread should exist as long as the > port > is open. The odd starting of the thread in the constructor and > addEventListener was just to get past the obvious problem of people > using > the port without adding listeners. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Fri May 12 11:43:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 19:43:21 +0200 Subject: [Rxtx] Spring Cleaning - some suggestions Message-ID: The current implementation of RXTX contains quite a lot of code that will break if it is used from several threads (especially on a multi processor machine). I think it would be nice to clean this up. I suggest the following changes (which keep the current semantics and should not influence existing projects in a negative way): - InterruptedException will never be ignored or reset - read methods will be protected with a Monitor - write methods will be protected with a (separate) Monitor - close() sets the read and write monitors into a "closed" state which will lead to IOExceptions for any following call to RXTXPort.read/write. - close() will wait a finite amount of time (maybe 500ms) for the release of the read and write monitors after that, it will trigger the closing of the file descriptor to abort any pending read or write. - close() will not call close(file_desc). Instead it will "interrupt" (ie set a flag and then, pthread_kill(ABRT)) the MonitorThread, the MonitorThread will call close(file_desc). - the monitors are properly released in a finally block the try of which starts directly after obtaining the monitor. - finally will not call close(file_desc) it will only "interrupt" the MonitorThread (see above) - the native-code (esp read) does not use SA_RESTART but checks Thread.interrupted() when it receives a SIGNAL (ie system call returns with EINTR or other signalling method). The read/write monitors will be allocated from a factory whose mode can be set to fast/normal/advanced. In fast-mode it will create "non thread safe, non synchronized" pseudo-monitors. In default mode, the monitors will store the owning thread. In "advanced" mode setting the monitors into closed state will "interrupt()" threads which are blocked in a native read/write. {Reasoning close behaviour: Calling close on a file descriptor in Windows unblocks any read() or write() on the same file descriptor with an error. On Solaris < 2.7 and MacOS X however the close() will/ can block - until the read or write have finished:-(( Even the JDK people have trouble with this. I dont know how Linux reacts in this case. The best practice for BSD/Solaris is to send a signal to the thread which will usually unblock the read/write with an EINTR - this however is not guarenteed as it also depends on the device driver. So the only resolution that will certainly not block the thread calling RXTXPort.close() (which will often enough be the AWT event dispatcher or the VM finalizer thread) is to call close(fd) from another thread.} {Reasoning read behaviour: It is rather uncommon to receive a signal while reading or writing - it will happen, but checking Thread.interrupted() when it happens will not degrade performance. The checking of Thread.interrupted() can be handled by returning to Java and potententially reentering into the native code if the thread was not interrupted or by calling back into the VM from the native code. On top of this, many functions like read(byte[]) or read(byte [], int, int) are allowed to return less than the requested amount of data. Only int read() is a bit more tricky. } [Trent: From the code I can tell, that you experimented quite a bit with signals. Do you know if the Java Thread.interrupt() triggers a unix signal on Linux/Solaris? If so, which one?? References: - http://java.sun.com/docs/hotspot/VMOptions.html - http://www.hp.com/products1/unix/java/infolibrary/prog_guide/ signals.html ] On OS X (hotspot client jdk-1.4.2) I did not see any signal propagated to the SELECT of the event_loop/MonitorThread (ie no EINTR) when I call monThread.interrupt(). This is a pitty, but thats the way it is. I simply assume this is true for most system calls. How to handle this? Of course it would be possible to install/ deinstall a specific signal handler before/after every native read and to natively send an ABRT signal if RXTXPort.close is called. A more elegant solution might be to have an additional "signaling" socket which is always included in the SELECT. Or the simplest solution: cap the timeout of the select to 500 ms (the loop around it exists already) after every timeout check the Thread.interrupted() flag. From a performance perspective this should be completely invisible... On the other hand, all write() calls need to be preceeded by a SELECT as well, to avoid running into a blocking write. Best regards, Joachim From lyon at docjava.com Sat May 13 05:54:52 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 13 May 2006 07:54:52 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Dmitry suggests that we acquire an implementation of a serial port reference, use it, then release it (i.e., check it back in). Joachim says that making serial ports thread friendly might be a good idea. This is a good idea. The design pattern that is close to this idea is the "Object Pool Design Pattern". # Object Pool Manage the reuse of objects for a type of object that is expensive to create or only a limited number of a kind of object can be created. It has been described at: http://www.developer.com/java/ent/article.php/626171 and in Marks' book, Patterns in Java, Volume 1. However, the Object Pool is intended to pool objects so that each object is just like every other object. The intent of the Parametric Singleton is to enable others to access the same resource at the same time (as long as the same parameters were used in construction). It sounds like we need a NEW Design Pattern (Oh no, Doug is doing it again!). Yes friends, you got me on a role (roll) :) If you like design patterns, you can thank me later. If you don't like design patterns, blame Dmitry, it was his idea ;) And Dave, thanks for the feedback on Singleton abuse. It has led me to change the way I think about application contexts, which we will see, below. We need (drum roll please): The Parametric Object Pool Design Pattern (POP) By Douglas A. Lyon ABSTRACT The goal of the Parametric Singleton design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values, in a given context. In comparison, the goal of the POP design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values and that only one reference to the class is checked out at a time, in a given context. A context is a namespace for holding identifiers during execution. In Java, A context can be changed in any of several ways. For example, creation of a new class loader, the deserialization of an old POP or the creation of a new process all create a new namespace. The POP Design Pattern combines the Parametric Singleton Design Pattern with the check out mechanism of the Object Pool Design Pattern. This enables unique creation of instances of a class. These instances are cached in a table. When a clients asks for an instance with these parameters, the cache is checked. If the instance is not in the cache it is created. If the instance is available, the clients checks out the instance. A reference is left to the clients that checked out the instance. The POP has the role of creating objects uniquely, from parameters. It also has the role of keeping track of which clients has checked out a given object. This is just like a library keeping track of who borrowed a book. If a resource is left unavailable in a system, a deadlock can occur. Deadlock debugging is facilitated by mapping a resource to the clients that have checked it out. We apply our POP Design Pattern to the retrieval of serial ports. The goal of our system is to make sure that serial ports are checked out to only one client at a time, and that they be checked back in when the client is done. The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. Users are discouraged from calling this the Parametric Object Oriented Pool (POOP). Introduction The intent of the POP Design Pattern is to ensure that a class has only one instance for a given set of parameter values. It also provides a point of access that is global to a given context. The POP uses the Singleton Design Pattern to ensure that there is only one POP, in the given context. The POP DP is responsible for checking out a reference to a given instance, and keeping track of that instance. The instance is responsible for sharing that instance. POP requires that users of the DP implement an interface that enables a recall facility. Thus, if there is a contention for a consumed resource, the deadlock can be resolved in an orderly fashion. Motivation A system cannot tolerate multiple instances of some classes with identical parameters used by different instances at the same time. For example, you cannot have two instances use the same serial port, at the same time. You cannot have two instances that are trying to listen to the same socket connection. You cannot have two instances writing to the same file structure at the same time. Further, once a serial port is checked out by a client, it is assigned to the client. This is like the spin-lock service provided by the operating system, only in the application layer. Naturally, deadlock will occur if a resource is not released, therefore the client of the resource is tracked. Recalling a resource is required for the POP DP by virtue of the implementation of an interface. The policy on how to break a deadlock (by honoring the recall) is application specific. As the operating system is often thought of as the arbiter of consumed resources (i.e., tape drives, serial ports, etc.) we frequently leave it to an operating system implementation to resolve these contention issues. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on naming conventions (which are not well standardized). The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. The POP Design Pattern can take on the role of the peer method mapper that homogenizes the API for different operating environments. That is, it can wrapper the different locking mechanisms used in different operating systems. POP that is responsible for keeping track of the instances created and the client that has checked them out. The POP Design Pattern is implemented using the Singleton Design Pattern. In Java, the POP implementation is declared final, so that it cannot be subclassed. The class also has a private constructor, so that other classes cannot instance it. The new design pattern is called the POP design pattern and it provides a way to check out and create instances with given parameters. Applicability Use the POP Design Pattern when: 1. There must be exactly one instance of a class with the given parameters in a given context. 2. The instances must be accessible to clients from a well-known access point. 3. The instances are reusable. 4. Only one client can check out an instance at a time. Structure Insert UML diagram here. Participants The POP Clients that need instances 1. The POP defines an instance upon request from a client, if, and only if, the instance does not already exist. 2. The POP returns the instance to the client. 3. The POP is responsible for creating unique instances from given parameters. 4. The POP is responsible to recalling instances from clients. Collaborations Clients obtain a reference to a POP instance only through the singleton design pattern. If the POP instance is left in an improper state (e.g., the serial port was left open) it is NOT the role of the POP to close the IO port. However, the POP can be requested to get the instance released. Nor is it the role of the POP Design Pattern to open the port. That role is delegate to some other part of the system. Further, it is the role of the POP Design Pattern to check out resources. However, it is still possible to have, multiple threads that have multiple references to the same resource at the same time. Checkout and resource requests are MUTEX locked (i.e., synchronized). Consequences The POP Design Pattern has several benefits: 1. Controlled access to parametrically defined instances. Since the POP encapsulates its instances, there is some limited control over how and when clients access it. 2. Reduced name space. The POP pattern avoids global variables that store instances created from the same parameter. Implementation Here are implementation issues to consider when using the POP pattern: 1. Unique mapping of parameters. The POP pattern requires that there be a mean to isomorphically map the parameter space into the instance space and back again. 2. Ensure unique instances. The POP pattern makes unique instances from parameters, and it does so only once. 3. Cache instances for fast retrieval. The POP must be able to look up instances, given some set of parameters, and do so from some data structure. That is, there must be enough space to hold references to all the instances the program will need. Also, a mechanism is needed to look up and retrieve the instances quickly enough to satisfy the clients. Sample Code To be written....any volunteers? Thanks! - Doug >I don't think I get it > >On Mar 22, 2006, at 9:36 AM, David Garnier wrote: >>Using the singleton pattern in this case is >>just convenient for the programmer. Problems >>arises >>pretty quickly, especially if you attempt to unit-test your classes. > > >so you're saying that something isn't so good >because you can not test it in the convenient >way? >if that's true, I'm totally disagree >change your test, debug whatever, but if >software is efficient at runtime, works fine and >only problem is some unit test >(which is some kind of framework for testing) >then dump that unit test , dump that unit >framework and make something appropriate to the >software >you're testing > >so if Douglas want to use singletons, what's the problem? >and what do you mean by abusing of singleton usage? > >of course singleton doesn't prevent concurrent >access to the resource across the processes >unless >you're using some OS facility to prevent it, besides >singleton as it was introduced is relevant only >and only inside of the same process >otherwise it's not singleton it's something else >(let's say network singleton: so you have remote >invocation facility >and some factory method that return object created by that facility) > >I don't have any problem with using any kind of singletons. > Parametric Singleton idea (if I understand it >right) could be easily implemented in the >following way: >use a map >populate map with instances of some class and key is your parameter >(you can use lazy population too) > >if somebody ask the key check the value if it's null so resource is taken >if somebody returns the resource put it back to the map > >public synchronized static Object getSomeResource(Object parameter); >public synchronized static void returnResource(Object parameter); > >getSomeResource (inside of the same process) could return null in 2 cases >1. if somebody (from other thread for example) already took that resource >2. if OS API said that resource corresponded to >that parameter (serial port with parameter = 1 >(port #)) >is locked and unavailable; >I'm not sure that in case of serial ports we >even need those Parametric Singletons >(unless lock checking is a very expensive operation) >just ask the OS about availability of that >resource and if it's available give it away >and then OS will lock it and therefore in next >time somebody ask it just answer that resource >is locked >and return null > >for example system has 2 serial ports available >so I ask getResource("tty"); >or I ask getResource("Bluetooth-Modem"); > >and if OS is ok you can give tty or Bluetooth-Modem or both > >no need for any additional pattern I think > >back to the problem >mac os x doesn't recognize locking via files, so >it handles locking via some API >an instance of the singleton in each process >should recognize that resource is locked >(by using that API) that's all >we don't have to make things more complicate >then they are just because there is some nice >design pattern or nice unit test framework or whatever >keep things simple, make them work fast, don't introduce middle layers >unless you have really good reason to do so > >of course I could be entirely wrong, so sorry about that in advance > >thanks > > >Dmitry Markman > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx >Good day, > >I guess that only a selected few (hi Trent) will be able to answer? >this question, but the answer might be interesting for anyone trying? >to debug or understand the code. > >Apparently the MonitorThread is started and stopped in? >RXTXPort.addEventListener and RXTXPort.removeEventListener. This? >would indicate that (originally?) the MonitorThread is only required? >when there is an EventListener. However the MonitorThread is also? >started in the RXTXPort constructor, which could mean that RXTX won't? >work at all if it isn't there. > >It seems to me, that if anyone would add an event listener and later? >on remove it, he could potentially wreak the port. Because the second? >action would kill the MonitorThread. > > >For the moment I am only trying to understand the role of and idea? >behind the MonitorThread. But of course there is a deeper reason thor? >my question: > >If the MonitorThread needs to exist anyway, it could be the thread? >that cleans up the port (ie calls nativeClose) - this would eliminate? >(a further) problem I am seeing with some USB drivers on Mac OSX.? >(Close blocks (after releasing the tty, but still) in the USB driver? >if the device is "not responding"). > >Greetings, >Joachim > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Sat May 13 10:07:37 2006 From: joachim at buechse.de (Joachim Buechse) Date: Sat, 13 May 2006 18:07:37 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Douglas, Looking at the current code, leaves me with the feeling, that there is a lot to do. Defining an API that wraps javax.comm to provide what you describe is certainly possible, but I wonder how much benefit it will actually provide. Personally I think the API defined by javax.comm "request/lock" a port with: cp= new CommunicationPort(identifier) "release" a port with: cp.close(); works quite nice for 99% of the applications. In my experience, the most efficient and elegant implementation is to wrap a port/socket/.. into a business object which declares the remote operations that are possible. Ie "uploadFile", "waitForPrompt", "getSerialNumber", "sendContact", "executeCommand", etc Those methods are then either synchronized or guarded by a monitor. I do not see how your design pattern applied to the port resource would help implementing this. [details start, skip if you agree to the above] When I talked about "thread-safe" I didn't mean several independent "sessions" accessing the port concurrently. I think this is a very rare usage. I believe the most common use case for serial ports today is the control of an external device from a PC running a GUI based application. To implement a clean Swing/AWT-GUI one needs to pass any action that can block to a "worker" thread (else the GUI blocks, the application appears dead). While it is possible to use own prespawned thread that will accept Runnables which operate on the port, this is not very elegant. It is more common to spawn a new thread for every action triggered by the user. Additionally the ABORT of a running operation is often implemented via a port.close() delegated to a different thread. - During the lifetime of a port, it will usually be accessed from several different threads. Instance variables need to be set/read in synchronized regions to guarantee a correct operation based on the Java memory model. - Synchronizing the access is usually handled on the application level (synchronizing the reads/writes is usually useless from the applications view because it is not a transaction mechanism). [details end] I am very open to learn about other scenarios where your proposed design pattern applied to the port resource is beneficial to the application implementor. Best regards, Joachim On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > Dmitry suggests that we acquire an implementation of > a serial port reference, use it, then release it (i.e., check it > back in). > > Joachim says that making serial ports thread friendly might be a > good idea. > > This is a good idea. The design pattern that is close to this idea > is the "Object Pool Design Pattern". > # Object Pool From jredman at ergotech.com Sun May 14 14:28:24 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 14:28:24 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers Message-ID: <446792E8.4000506@ergotech.com> Does anyone know of any work to make RXTX work with Ethernet (telent) Terminal Servers? If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? We've used RXTX with upwards of 100 virtual COM ports on Windows and it works well. Linux is more problematic. It would be good to have an OS independent solution to accesses remote Ethernet serial ports. Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From legolas.w at gmail.com Sun May 14 14:26:34 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:56:34 +0430 Subject: [Rxtx] does any one have a working sample of RXTX and LPT port Message-ID: <4467927A.4000008@gmail.com> Hi Thank you for reading my post does any one has a working sample for RXTX and LPT port ? Thanks From legolas.w at gmail.com Sun May 14 14:27:29 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:57:29 +0430 Subject: [Rxtx] does RXTX support Trigerr on parallel port? Message-ID: <446792B1.4040905@gmail.com> Hi does RXTX support trigger on LPT port ? if so , how i can use it ? Thanks From tjarvi at qbang.org Sun May 14 17:40:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 17:40:59 -0600 (MDT) Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: <446792E8.4000506@ergotech.com> References: <446792E8.4000506@ergotech.com> Message-ID: On Sun, 14 May 2006, Jim Redman wrote: > Does anyone know of any work to make RXTX work with Ethernet (telent) > Terminal Servers? > > If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 > Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? > Hi Jim It appears the author of NVTCom has decided to release the library into the public domain. Integration with rxtx is possible but it would be best to contact the author and find out what his intent is. I would suggest contacting the author with a proposal of what you would like to do and take it from there. We could 'take' public domain software but its better to show respect to the authors and respect their wishes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:10:23 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:10:23 -0600 (MDT) Subject: [Rxtx] does any one have a working sample of RXTX and LPT port In-Reply-To: <4467927A.4000008@gmail.com> References: <4467927A.4000008@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > Thank you for reading my post > does any one has a working sample for RXTX and LPT port ? > Thanks Hi Legolas LPT port support in rxtx is spotty. That means some people have sent in patches for what they do and it works well for them. The original code was not very good. It may have been 3 hours work :/ To get started, Sun has some demo programs with their commapi. With rxtx 2.1 you can change their code from using javax.com to gnu.io and it -should- work. But if it does not you can post here and on bugzilla. There has been more interest lately off the list and maybe there will be enough community resources to get what you need going. If you do get a sample program together, we would gladly put it in the contrib directory so the next person can get things going faster. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:12:12 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:12:12 -0600 (MDT) Subject: [Rxtx] does RXTX support Trigerr on parallel port? In-Reply-To: <446792B1.4040905@gmail.com> References: <446792B1.4040905@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > does RXTX support trigger on LPT port ? > if so , how i can use it ? > Hi Legolas As mentioned in the previous post, rxtx parallel support is not very mature. But if you can point to something that describes the trigger feature, we can probably make sure its there and give a quick code example. -- Trent Jarvi tjarvi at qbang.org From jredman at ergotech.com Sun May 14 22:22:48 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 22:22:48 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: References: <446792E8.4000506@ergotech.com> Message-ID: <44680218.4080008@ergotech.com> Trent, Trent Jarvi wrote: > On Sun, 14 May 2006, Jim Redman wrote: > >> Does anyone know of any work to make RXTX work with Ethernet (telent) >> Terminal Servers? >> >> If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 >> Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? >> > > Hi Jim > > It appears the author of NVTCom has decided to release the library into > the public domain. Integration with rxtx is possible but it would be best > to contact the author and find out what his intent is. > > I would suggest contacting the author with a proposal of what you would > like to do and take it from there. We could 'take' public domain software > but its better to show respect to the authors and respect their wishes. > I sent Marco(?), the author of the library, a note before asking the list - I'll let you know the response. If anyone is already working on it, or has an interest and more time and energy than me, I'd hate to duplicate the efforts. If no one is, and no one objects, maybe I'll see what I can do. Jim > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From Christian.Klemke at t-online.de Mon May 15 02:23:06 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Mon, 15 May 2006 10:23:06 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu><004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: <008a01c677f8$cae18590$02fea8c0@NB600> Hi Trent, Hi Paul, I finally found some time to create a simple patch to enable the optional suppression of version output to the console. It is based on a new system property called "gnu.io.rxtx.NoVersionOutput" which can by set to "true" if necessary. I had some problems accessing CVS, therefore I downloaded the rxtx-2.1-7r2 source archive from ftp.qbang.org (which is linked on the rxtx.org download page) and worked with that release. Please find my proposed patch in the attachment ! Regards, Christian ----- Original Message ----- From: "Trent Jarvi" To: "RXTX Developers and Users" Cc: ""Paul Gettings"" Sent: Friday, May 05, 2006 2:09 PM Subject: Re: [Rxtx] RXTX causing stdout messages > On Fri, 5 May 2006, Christian Klemke wrote: > >> Hi Paul, >> >> I was wondering about the same question some days ago and took a look at >> the >> source files. Unfortunately, I found that you can only get rid of that >> messages by altering and recompiling the Java code. There is a final >> static >> boolean variable called "devel" in the file "RXTXCommDriver.java" which >> is >> set to "true". This constellation causes the output after the native >> libraries have been loaded. No mechanism exists to suppress them >> otherwise >> :-(. >> >> Trent, does that mean that 2.1.7 is still officially a "development" >> version >> ? When will this value be changed to "false" by default ? With 2.1.8 ? It >> would be nice to provide a means to suppress such messages besides that >> static flag (maybe by setting a property called >> "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The >> output can indeed by annoying, especially when used with console >> applications, where the message potentially appears "in the middle" of >> your >> own output. Another possibility would be not to use System.out directly, >> but >> instead some PrintStream field which is initially set to System.out but >> can >> programatically be changed. That would allow for any kind of redirection >> or >> suppression by implementing appropriate user-defined PrintStream >> subclasses >> and making RXTX use that stream. What do you think ? >> > > A patch for using properties would be accepted I'm sure. > > The reason the default is to display the message is not related to the > development state of rxtx anymore. The problem is that people first using > rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. > The message prevents a great deal of email thats easily explained by the > message. > > I question if we should support rxtx 2.0 at all anymore. > > If you post a patch in bugzilla, we'll put it into CVS this weekend. > we'll be going through and doing such things anyhow. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_version_output_patch.diff Type: application/octet-stream Size: 991 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060515/3173c2b6/rxtx_version_output_patch-0004.obj From lyon at docjava.com Mon May 15 06:06:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 May 2006 08:06:21 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Joachim makes several good points. Let me see if I can address some of them below: >Hello Douglas, > >Looking at the current code, leaves me with the feeling, that there? >is a lot to do. Yes! >Defining an API that wraps javax.comm to provide what? >you describe is certainly possible, but I wonder how much benefit it? >will actually provide. > >Personally I think the API defined by javax.comm > >"request/lock" a port with: > cp= new CommunicationPort(identifier) >"release" a port with: > cp.close(); > >works quite nice for 99% of the applications. I don't know what percentage of applications turn off locking, the way that I do in my version of the RXTX lib. I do know that this is not safe practice. I also know that it was motivated by the multi-platform nature of my code and that this was the only way I could make things work, at the time. Java does not appear to have a cross-platform standard for locking resources on various platforms. Each OS appears to have its own standard. The question of who breaks deadlocks and how this is done remains open, as this is not an easy question to resolve. Let me continue, below: > >In my experience, the most efficient and elegant implementation is to? >wrap a port/socket/.. into a business object which declares the? >remote operations that are possible. Ie "uploadFile",? >"waitForPrompt", "getSerialNumber", "sendContact", "executeCommand",? >etc Those methods are then either synchronized or guarded by a? >monitor. I do not see how your design pattern applied to the port? >resource would help implementing this. I have no problem with high-level wrappers that are application specific. That is a very good idea, but orthogonal with respect to the issue of deadlocks. More below: > >[details start, skip if you agree to the above] >When I talked about "thread-safe" I didn't mean several independent? >"sessions" accessing the port concurrently. I think this is a very? >rare usage. That is probably why turning locking off works so well! On the other hand, it is not safe and I shouldn't do it. >I believe the most common use case for serial ports today? >is the control of an external device from a PC running a GUI based? >application. To implement a clean Swing/AWT-GUI one needs to pass any? >action that can block to a "worker" thread (else the GUI blocks, the? >application appears dead). While it is possible to use own prespawned? >thread that will accept Runnables which operate on the port, this is? >not very elegant. It is more common to spawn a new thread for every? >action triggered by the user. Additionally the ABORT of a running? >operation is often implemented via a port.close() delegated to a? >different thread. Here lies the heart of serial port concern. An application opens a serial port and then dies. The application is restarted and finds the port locked. How do we clear the lock? Must the application's user reside in the UUCP group? Must installers of the serial port add users to the UUCP group? Should locking be handled at a high-level of abstraction in an operating system independent way? Should the implementation of the locking mechanism be translated into an API that is dependent on the OS convention? Suppose that we restrict the discussion to serial ports. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on inconsistent naming conventions. Hence my feeling that we need to mirror what is done in other API's; we need a locking toolkit that references peer methods, IMHO. >From the Java programming point of view, the locking API is portable across different platforms, but has, as its implementation, a native peer method that uses the conventions of the underlying OS. This enables portable resource locking (in theory!). Consider, for example: org.apache.commons.transaction.locking with: Interface LockManager at: http://jakarta.apache.org/commons/transaction/apidocs/org/apache/commons/transaction/locking/LockManager.html Or, more recently: java.util.concurrent.locks Interface Lock based on Doug Lea's code: http://kickjava.com/src/EDU/oswego/cs/dl/util/concurrent/ReadWriteLock.java.htm Should we incorporate a clean, portable design into serial port use, one that is consistent with current locking APIs? Basically, a comm port is a resource and resources are typically controlled by managers. Thus, I suggest that we make use of a CommPortManager to help control and centralize serial port usage. The question of how this is done remains open, IMHO, but using core API's like: java.util.concurrent.locks might not be amiss. High-level methods (getAllPorts, getAllSerialPorts, getAllParallelPorts, etc...) might be welcome additions. Basic questions like, "what if a port is in use?" remain open, hence my proposal for the new design pattern. Isn't it the CommPortManager's role to break the deadlock? Cheers! - Doug > >- During the lifetime of a port, it will usually be accessed from? >several different threads. Instance variables need to be set/read in? >synchronized regions to guarantee a correct operation based on the? >Java memory model. >- Synchronizing the access is usually handled on the application? >level (synchronizing the reads/writes is usually useless from the? >applications view because it is not a transaction mechanism). >[details end] > >I am very open to learn about other scenarios where your proposed? >design pattern applied to the port resource is beneficial to the? >application implementor. > >Best regards, >Joachim > >On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > >> Dmitry suggests that we acquire an implementation of >> a serial port reference, use it, then release it (i.e., check it? >> back in). >> > > Joachim says that making serial ports thread friendly might be a? >> good idea. >> >> This is a good idea. The design pattern that is close to this idea >> is the "Object Pool Design Pattern". >> # Object Pool > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Mon May 15 06:58:19 2006 From: joachim at buechse.de (Joachim Buechse) Date: Mon, 15 May 2006 14:58:19 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Doug, I agree fully, that locking of the system resource should be abstracted from the user (programmer). Currently this is already the case, but I agree it might be nice to extract the code into a separate class, which uses platform dependent providers to do its job. What I described in my email was not targeted at allocating the system resource, but at handling an already allocated system resource inside the framework. I agree that it may be possible to combine the two - however, I would suggest to do this in phase2. I can contribute a work over of RXTXPort.java which implements clean internal locking and proper close behavior (which I would call phase 1). I could do this this week. However I strongly believe that there is little sense in trying to do this as a series of patches. It will be closer to a rewrite than to a patch. I have already provided a number of suggested patches via Bugzilla, but this is quite inconvenient (for me). My working copy diverges more and more from the master and hence it gets more and more annoying to provide self contained patches. Best regards, Joachim From tjarvi at qbang.org Mon May 15 08:27:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 May 2006 08:27:51 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Mon, 15 May 2006, Joachim Buechse wrote: > Hello Doug, > > I agree fully, that locking of the system resource should be > abstracted from the user (programmer). Currently this is already the > case, but I agree it might be nice to extract the code into a > separate class, which uses platform dependent providers to do its job. > > What I described in my email was not targeted at allocating the > system resource, but at handling an already allocated system resource > inside the framework. I agree that it may be possible to combine the > two - however, I would suggest to do this in phase2. > > I can contribute a work over of RXTXPort.java which implements clean > internal locking and proper close behavior (which I would call phase > 1). I could do this this week. > > However I strongly believe that there is little sense in trying to do > this as a series of patches. It will be closer to a rewrite than to a > patch. I have already provided a number of suggested patches via > Bugzilla, but this is quite inconvenient (for me). My working copy > diverges more and more from the master and hence it gets more and > more annoying to provide self contained patches. > For methodical testing purposes (which does go on) the incremental patches are better. I'm lagging behind in bugzilla but thats soon to change (this week). It has just been rather chaotic up until now. I moved, purchased a house, and jumped into the fire of a feature freeze timeframe at a new job. btw, we see the Solaris close issues on 2.8 also. 9 and 10 are fine. I'll work towards making those test results public and allow others to run new rxtx code through them. We had the OK at one point but setting up the environment is involved. It isn't just a collection of java classes. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Tue May 16 02:01:47 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:01:47 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] Message-ID: <446986EB.209@willicon.de> Hi, any ideas for my problem? Hans -------- Original-Nachricht -------- Betreff: [Rxtx] Problem under Mac OSX 10.3.9 Datum: Mon, 08 May 2006 18:47:20 +0200 Von: WILLICon Antwort an: RXTX Developers and Users An: RXTX Developers and Users Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/b0741c2b/attachment-0004.html From joachim at buechse.de Tue May 16 02:15:08 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 10:15:08 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: Hello Hans, I am using RXTX on OS X for my own project. I do not see the problem you describe. I had some troubles installing it because the current version uses lock files which is non-standard on OS X. I have created a patched version which I currently use. This version does not need to modify user groups and hence does not need an installer. I just pop it in the application directory. If you send me a link where I can download your OSX installer, I will have a quick look. Regards, Joachim On 16.05.2006, at 10:01, WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we > have some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + > spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + > spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always > the value "false". > I can only get the status, while I open the port and catch the > exception. > > Any ideas? > > Hans > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail at willicon.de Tue May 16 02:26:53 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:26:53 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: References: <446986EB.209@willicon.de> Message-ID: <44698CCD.7050709@willicon.de> Joachim, tanks for the answer. I'll send You a mail. Hans Joachim Buechse schrieb: > Hello Hans, > > I am using RXTX on OS X for my own project. I do not see the problem > you describe. > > I had some troubles installing it because the current version uses > lock files which is non-standard on OS X. I have created a patched > version which I currently use. This version does not need to modify > user groups and hence does not need an installer. I just pop it in > the application directory. If you send me a link where I can download > your OSX installer, I will have a quick look. > > Regards, > Joachim > > On 16.05.2006, at 10:01, WILLICon wrote: > > >> Hi, >> >> any ideas for my problem? >> >> Hans >> >> -------- Original-Nachricht -------- >> Betreff: [Rxtx] Problem under Mac OSX 10.3.9 >> Datum: Mon, 08 May 2006 18:47:20 +0200 >> Von: WILLICon >> Antwort an: RXTX Developers and Users >> An: RXTX Developers and Users >> >> >> Hi, >> >> I use for RXTX for communicate with CyclingComputers. >> >> It works good under Win32, Sloaris and Linux but with Mac OSX we >> have some problems. >> >> My users install the Mac OSX serial lib from the actual binary. >> >> After starting the program, they get this error message: >> >> java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while >> loading gnu.io.RXTXCommDriver >> >> Remember, this error comes only under Mac OSX. >> >> That is the code for the error: >> >> Enumeration portList = CommPortIdentifier.getPortIdentifiers(); >> spInUse = getBundleStr("serialPortInUse"); >> spFree = getBundleStr("serialPortFree"); >> while (portList.hasMoreElements()) { >> CommPortIdentifier portId = (CommPortIdentifier) >> portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (osName != null && osName.startsWith("mac")) { >> if (!portId.getName().startsWith("dev/cu.")) { >> continue; >> } >> } >> if (portId.isCurrentlyOwned()) { >> serialPortNames.add(portId.getName() + " - " + >> spInUse); >> } >> else { >> serialPortNames.add(portId.getName() + " - " + >> spFree); >> } >> } >> } >> if (serialPortNames.size() == 0) { >> serialPortNames.add(getBundleStr("serialPortNotFound")); >> } >> >> BTW: The methode isCurrentlyOwned() is not working. I get always >> the value "false". >> I can only get the status, while I open the port and catch the >> exception. >> >> Any ideas? >> >> Hans >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/948333be/attachment-0004.html From jredman at ergotech.com Tue May 16 07:35:52 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 16 May 2006 07:35:52 -0600 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: <4469D538.6070408@ergotech.com> Hans, I have no direct insight, but would note that what you have is a "NoClassDefFoundError" not a "ClassNotFoundException". So the class javax/comm/CommDriver is found, but one of its dependencies is missing. NoClassDefFoundError are a bigger problem to resolve because you get no indication of the real problem. Jim WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we have > some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > * spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always the > value "false". > I can only get the status, while I open the port and catch the exception. > > Any ideas? > > Hans > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.de Tue May 16 08:01:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 16:01:21 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 In-Reply-To: <4469AFC3.6000002@willicon.de> References: <44698EBC.8000008@willicon.de> <8C5680C4-E2BA-42FF-B221-36E1124FA6A4@buechse.de> <4469AFC3.6000002@willicon.de> Message-ID: <9825A602-D6ED-4C28-BF33-9A7C984FACD5@buechse.de> Hallo Hans, you include RXTX 2.17 in your "bikeXexperience.jar" (2.17 uses Interfaces from gnu.io.* not javax.comm.*). Now inspect your error log closely: The class gnu.io.RXTXCommDriver tries to load javax.comm.CommDriver: this is only the case for RXTX 2.07. I assume, that the user has installed Version 2.07 into one of the java.ext.dirs . The VM always tries to load classes from the "system" path first. The current Mac installer distributed with RXTX in fact installs RXTXcomm.jar and librxtxSerial.jnilib into /Library/Java/Extensions. (I wrote some time ago that I consider this as a bad idea because of potential version conflicts-> thanks for delivering the example). For 2.07 it does so without installing the javax.comm classes it seems. I would recommend that you instruct your users to install version 2.17 only. Until RXTX is changed to use TIOCEXCL instead of lock files, you can hardly avoid the installer, as the user needs to be added to a special group and a lockfile directory needs be created. More precisely you are waiting for: http://bugzilla.qbang.org/show_bug.cgi?id=50 [RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL)] Regards, Joachim -------------- next part -------------- A non-text attachment was scrubbed... Name: log.tiff Type: image/tiff Size: 38394 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/e3e52128/log-0004.tiff -------------- next part -------------- > > Ich verwende RXTX 2.17. Das orginal RXTXcomm.jar ist in > CyclingDataManager.jar enthalten. > From tjarvi at qbang.org Wed May 17 23:18:15 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 May 2006 23:18:15 -0600 (MDT) Subject: [Rxtx] update Message-ID: So we have several patches and these have stacked up. I'd like to thank everyone for being patient. Tests for the most intrusive patches look good so far. I still have to get some bits together on my end but it looks like we can catch everything up in CVS this week. I'll try to post a normal list of what went in by whom with links Saturday. But I'm not seeing anything that raises flags yet. I also think I'll be able to submit a patch for nonstandard baud rates. I have to confirm w32 but I think its going to be a one line fix. I don't know if its bugzilla or people tinkering with patch files before submitting but patches are not applying cleanly. So the patches have to be done by hand. This may make things difficult for people hoping to add other patches on top. I'm trying to make that go well but ... -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Thu May 18 02:23:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 May 2006 10:23:47 +0200 Subject: [Rxtx] update In-Reply-To: References: Message-ID: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Hello Trent, in fact I tinkered with the patches (never used this mechanism before, usually I "communicate" via cvs) ... so sorry for any trouble you had applying them. Basicly I edited the patches to make them self contained. Having the tests run with different speeds on different platforms, may well be an effect of caching. I have seen quite interesting propagation delays for the closing flag on my PowerPC system, which makes me doubt, that the propagation of output_buffer_empty_flag works as it should. Maybe the communication mechanism between the two threads should be replaced by something like pthread_cond_*. Could you describe which problems you see on Solaris/SPARC? I'd be interested to see if they exist on OS X (PowerPC) as well... As you seem to work on the stuff at the moment I would like to suggest the following additions (it looks more than it is, I posted some context to make clear where to apply the change). See the comments in braces for what was changed Greetings, Joachim (1) The end of the drain loop could be: --- report("drain_loop: received EINTR in tcdrain\n"); --- (added "in tcdrain" to make debug output clearer) (2) The start of the drain loop should be: --- for(i=0;;i++) { report_verbose("drain_loop: looping\n"); #if defined(__sun__) /* FIXME: No time to test on all OS's for production */ if( eis->eventloop_interrupted ) { goto end; } if (usleep(5000)) { report("drain_loop: received EINTR"); } #else if (usleep(1000000)) { report("drain_loop: received EINTR"); } #endif /* __sun__ */ --- (added a check for "eis->eventloop_interrupted" before the sleep) (3) The end of interrupt_event_loop could (and maybe should) be: --- #if !defined(TIOCSERGETLSR) && !defined(WIN32) /* make sure that the drainloop unblocks from tcdrain */ pthread_kill(index->drain_tid, SIGABRT); /* TODO use wait/join/SIGCHLD/?? instead of sleep? */ usleep(50 * 1000); /* Under normal conditions, SIGABRT will unblock tcdrain. However a non-responding USB device combined with an unclean driver may still block. This is very ugly because it may block the call to close indefinetly. */ if (index->closing != 1) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); index->closing = 1; } #endif report("interruptEventLoop: interrupted\n"); --- (added some comments and pthread_cancel for resisting drain thread) On 18.05.2006, at 07:18, Trent Jarvi wrote: > > So we have several patches and these have stacked up. I'd like to > thank > everyone for being patient. > > Tests for the most intrusive patches look good so far. I still > have to > get some bits together on my end but it looks like we can catch > everything > up in CVS this week. > > I'll try to post a normal list of what went in by whom with links > Saturday. But I'm not seeing anything that raises flags yet. I also > think I'll be able to submit a patch for nonstandard baud rates. > I have > to confirm w32 but I think its going to be a one line fix. > > I don't know if its bugzilla or people tinkering with patch files > before > submitting but patches are not applying cleanly. So the patches > have to > be done by hand. This may make things difficult for people hoping > to add > other patches on top. I'm trying to make that go well but ... > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu May 18 22:28:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 18 May 2006 22:28:00 -0600 (MDT) Subject: [Rxtx] update In-Reply-To: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> References: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Message-ID: On Thu, 18 May 2006, Joachim Buechse wrote: > Hello Trent, > > in fact I tinkered with the patches (never used this mechanism > before, usually I "communicate" via cvs) ... so sorry for any trouble > you had applying them. Basicly I edited the patches to make them self > contained. I think we are close to moving towards that. > > Having the tests run with different speeds on different platforms, > may well be an effect of caching. I have seen quite interesting > propagation delays for the closing flag on my PowerPC system, which > makes me doubt, that the propagation of output_buffer_empty_flag > works as it should. Maybe the communication mechanism between the two > threads should be replaced by something like pthread_cond_*. Could > you describe which problems you see on Solaris/SPARC? I'd be > interested to see if they exist on OS X (PowerPC) as well... This is interesting. I have seen problems with output buffer empty in applications that require it. I'm trying to get a bug list and or test results open for everyone to see but that may take time. But missed output buffer events ... yep. With Sparc, we have seen a few things. One was a kernel race condition that went away when we reimaged and updated 2.8. RXTX was hanging on close, top showed no cpu use but there was 2 second delays just typing on console. The other is our tests now take ~4 times longer on Solaris. Someone is looking at timing just open, close, read, write, ... to see if they can find where the slowdown is. This happened after solaris 2.8. I'll try to share more when/if there is something interesting. This may well not be solvable in userland. > > As you seem to work on the stuff at the moment I would like to > suggest the following additions (it looks more than it is, I posted > some context to make clear where to apply the change). See the > comments in braces for what was changed I'll take a look. This could all come together Saturday but I also have an event to attend that day. I may not wrap this up until Sunday. -- Trent Jarvi tjarvi at qbang.org From andrewlord at internode.on.net Sun May 21 20:10:02 2006 From: andrewlord at internode.on.net (Andrew Lord) Date: Mon, 22 May 2006 11:40:02 +0930 Subject: [Rxtx] Kernel include files do not match kernel Message-ID: <200605221140.03271.andrewlord@internode.on.net> Hi, I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel 2.6.12-18 with the command: ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include However I get the message: ## checking java.version 1.5.0_06 ## checking os.version 2.6.12-18mdk ## ## WARNING: Kernel include files do not match the current kernel ## ## configure: creating ./config.status etc. Is there a problem with the way I'm specifying the 'include' directory ? If not, how else can I specify the correct directory for the include files please ? Cheers, Andrew From tjarvi at qbang.org Sun May 21 20:31:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 May 2006 20:31:31 -0600 (MDT) Subject: [Rxtx] Kernel include files do not match kernel In-Reply-To: <200605221140.03271.andrewlord@internode.on.net> References: <200605221140.03271.andrewlord@internode.on.net> Message-ID: On Mon, 22 May 2006, Andrew Lord wrote: > Hi, > > I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel > 2.6.12-18 with the command: > > ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk > CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include > > However I get the message: > > ## checking java.version 1.5.0_06 > ## checking os.version 2.6.12-18mdk > ## > ## WARNING: Kernel include files do not match the current kernel > ## > ## configure: creating ./config.status > etc. > > Is there a problem with the way I'm specifying the 'include' directory ? If > not, how else can I specify the correct directory for the include files > please ? > Hi Andrew I'm fairly sure your --with-kernel option does nothing. The CPPFLAGS should do what you want. Maybe put an #error message in /usr/src/linux.../incude/linux/version.h But I don't recall a recent problem with version missmatches. It should work. Distros will even ship include files that don't match versions exactly. In theory it should never matter for users. I used to compile new kernels by hand and really didnt have a distro. I didnt have a seperate package of kernel headers for users (myself). When changing a gateway from linux 1.2.12 to 2.1.77, I would worry about such messages. So if you are doing something that weird, the message may be of use to you. If you just see the message on a distro you installed, it is more than likely harmless. -- Trent Jarvi tjarvi at qbang.org From mrogers at spro.net Mon May 22 14:45:39 2006 From: mrogers at spro.net (Mike Rogers) Date: Mon, 22 May 2006 14:45:39 -0600 Subject: [Rxtx] Sun's CommAPI -- think May? Message-ID: <447222F3.9040302@spro.net> Hi, Any word from Sun about progress towards fixing the Java CommAPI v3 "incompatibilities" so RXTX 2.0 can operate within the framework's namespace (javax.comm)? I recall mention of a May time frame. Thanks, Mike From paul.klissner at sun.com Mon May 22 15:09:27 2006 From: paul.klissner at sun.com (Paul Klissner) Date: Mon, 22 May 2006 14:09:27 -0700 Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <447222F3.9040302@spro.net> References: <447222F3.9040302@spro.net> Message-ID: <44722887.8080308@sun.com> Mike Rogers wrote: > Hi, > > Any word from Sun about progress towards fixing the Java CommAPI v3 > "incompatibilities" so RXTX 2.0 can operate within the framework's > namespace (javax.comm)? I recall mention of a May time frame. > > Thanks, > > Mike > We've had a lot of work come in. This hasn't been the only priority. I'm running behind the plan in addressing this, but will be looking at it again soon. Rather than state a new, I'll just say it is in progress, and not off the table. I'll get this fixed as soon as I can. Good timing for asking as we just started discussing javax.comm plans today, and I'll have some cycles to work on it soon. Paul From yhua537 at cse.unsw.edu.au Mon May 22 16:03:05 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Tue, 23 May 2006 08:03:05 +1000 (EST) Subject: [Rxtx] install rxtx in XP Message-ID: Hi Guys, I am new to serial port programming, and have no experience on programming java in xp, but my project require me to builld a communication link between xp and a UART device. Most of the information in the web site seems for linux only. including the commands such as export and chmod. How do I install rxtx in xp? cheers YiQi Huang From mark at mdsh.com Tue May 23 01:24:20 2006 From: mark at mdsh.com (Mark Himsley) Date: Tue, 23 May 2006 08:24:20 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off , it includes DLLs for Windows and the JAR for Java. Follow the Windows instructions in the INSTALL. ie RXTXcomm.jar goes in \jre\lib\ext (under java) rxtxSerial.dll goes in \jre\bin So, assuming a fairly standard Java install, copy RXTXcomm.jar into C:\Program Files\Java\jre1.5.0_06\lib\ext and copy rxtxSerial.dll into C:\Program Files\Java\jre1.5.0_06\bin Yes, it really is that simple. On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > I am new to serial port programming, and have no experience on > programming java in xp, but my project require me to builld a > communication link between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang -- Mark Himsley From joachim at buechse.de Tue May 23 02:51:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 23 May 2006 10:51:47 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) Unless it is absolutely required you should NOT install RXTX in your global Java Runtime Environment. This will for sure create versioning conflicts - if not now, than in the future, if not on your system than at your clients. Instead put the dll in your application directory and include the RXTXcomm.jar in your classpath. This is much safer and not a bit more complicated. Regards, Joachim On 23.05.2006, at 09:24, Mark Himsley wrote: > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR > for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > >> I am new to serial port programming, and have no experience on >> programming java in xp, but my project require me to builld a >> communication link between xp and a UART device. >> >> Most of the information in the web site seems for linux only. >> including >> the commands such as export and chmod. How do I install rxtx in xp? >> >> cheers >> YiQi Huang > > > > -- > Mark Himsley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tod at todbot.com Tue May 23 03:12:22 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 02:12:22 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I totally agree: do not contaminate the Java installation. I put all the RXTX files in a directory and then change my java invocation to be: % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* Alternatively, use Launch4J to create a double-clickable application and keep the RXTX libraries in the directory of the application. -=tod On May 23, 2006, at 1:51 AM, Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > >> Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off >> , it includes DLLs for Windows and the JAR >> for Java. >> >> Follow the Windows instructions in the INSTALL. >> >> ie >> >> RXTXcomm.jar goes in \jre\lib\ext (under java) >> rxtxSerial.dll goes in \jre\bin >> >> So, assuming a fairly standard Java install, copy RXTXcomm.jar into >> C:\Program Files\Java\jre1.5.0_06\lib\ext >> and copy rxtxSerial.dll into >> C:\Program Files\Java\jre1.5.0_06\bin >> >> Yes, it really is that simple. >> >> >> >> On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: >> >>> I am new to serial port programming, and have no experience on >>> programming java in xp, but my project require me to builld a >>> communication link between xp and a UART device. >>> >>> Most of the information in the web site seems for linux only. >>> including >>> the commands such as export and chmod. How do I install rxtx in xp? >>> >>> cheers >>> YiQi Huang >> >> >> >> -- >> Mark Himsley >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From smontgomery at mediaspansoftware.com Tue May 23 08:46:53 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Tue, 23 May 2006 10:46:53 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: Message-ID: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Joachim and Tod mentioned how to keep the files RXTX requires on Windows XP out of the Java installations - thanks gentlemen! Are there similar suggestions for an RXTX install on OS X? The current "canonical" OS X installation instructions "contaminate the Java installation", to use Tod's words. Our app will run fine under 1.4.2 and 5.0 on OS X, and a lot of users will have both. We've already been burned by the recent switch from 1.4.2 to 5.0 as the platform default. Any suggestions welcomed. From tod at todbot.com Tue May 23 13:27:55 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 12:27:55 -0700 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <9BA0F670-A862-42E7-BB2C-130D775ABDF9@todbot.com> Hi Sean, It depends on how you build and deploy your code. If you're using shell scripts, you can do something like this: #!/bin/sh # pick one JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/ Commands/java #JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/ Commands/java $JAVA -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* That both picks which VM to use and uses the RXTX in the directory called 'rxtxlib'. If you want your shell script to be clever, you could test for the existence of the different 'java' executables and go from there (maybe even use different jar files). I am almost positive all OS X systems with Java 1.5 are guaranteed to also have Java 1.4.2. If you're using Jar Builder or XCode, you can specify which JVM to use and add the extra args in the Info.plist file. The paths specified in the 'java' invocation then are based off of the $JAVAROOT variable that the JavaApplicationStub sets for you. For my app, I've have been compiling two sets of jars, one compiled with 1.4.2 and one with 1.5, but they both run under 1.5. So I have a similar shell script that chooses a different 'javac' depending on the need. -=tod On May 23, 2006, at 7:46 AM, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From yhua537 at cse.unsw.edu.au Tue May 23 11:09:37 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 03:09:37 +1000 (EST) Subject: [Rxtx] install rxtx in XP (Mark Himsley, Joachim Buechse, Tod E. Kurt> In-Reply-To: References: Message-ID: > Message: 8 > Date: Tue, 23 May 2006 08:03:05 +1000 (EST) > From: YiQi Huang > Subject: [Rxtx] install rxtx in XP > To: rxtx at qbang.org > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > Hi Guys, > > I am new to serial port programming, and have no experience on programming > java in xp, but my project require me to builld a communication link > between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang > > > ------------------------------ > > Message: 9 > Date: Tue, 23 May 2006 08:24:20 +0100 > From: Mark Himsley > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=us-ascii; format=flowed > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > ------------------------------ > > Message: 10 > Date: Tue, 23 May 2006 10:51:47 +0200 > From: Joachim Buechse > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > > ------------------------------ > > Message: 11 > Date: Tue, 23 May 2006 02:12:22 -0700 > From: "Tod E. Kurt" > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I totally agree: do not contaminate the Java installation. > > I put all the RXTX files in a directory and then change my java > invocation to be: > > % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* > > Alternatively, use Launch4J to create a double-clickable application > and keep the RXTX libraries in the directory of the application. > > -=tod > > Hi, Thanks guys, I don't know if this is the correct way to reply your mecessage, if wrong, please point out. Thank you for Mark to give the detail instructions and Joachim to point out the cons ot installing in the java directory, and specially thanks for Tod to give the instrection in detail. Sorry to ask another stupid question: I have followed Tod's instruction. Now I think i am ready to start hacking. But where is the RXTX API documentation? Is it the same as using normal java comm API? btw, where could i find some examples to start with? Thanks very much cheers YiQi Huang From tjarvi at qbang.org Tue May 23 16:09:32 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 May 2006 16:09:32 -0600 (MDT) Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <44722887.8080308@sun.com> References: <447222F3.9040302@spro.net> <44722887.8080308@sun.com> Message-ID: > Good timing for asking as we just started discussing javax.comm plans > today, and I'll have some cycles to work on it soon. Hi Paul I assume you mean Sun is discussing plans concerning its own internal actions and there is no community involvment at this point. -- Trent Jarvi tjarvi at qbang.org From yhua537 at cse.unsw.edu.au Tue May 23 22:50:01 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 14:50:01 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } From mmester at sps.edu Tue May 23 22:58:21 2006 From: mmester at sps.edu (Michael Mester) Date: Wed, 24 May 2006 00:58:21 -0400 Subject: [Rxtx] install rxtx in XP References: Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below -----Original Message----- From: rxtx-bounces at qbang.org on behalf of YiQi Huang Sent: Wed 5/24/2006 12:50 AM To: RXTX Developers and Users Subject: Re: [Rxtx] install rxtx in XP Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3950 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060523/b36d0c63/attachment-0004.bin From yhua537 at cse.unsw.edu.au Tue May 23 23:05:50 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 15:05:50 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: Yes, Michael you are right, it should be semicolons, But it still can't find the correct library. On Wed, 24 May 2006, Michael Mester wrote: > I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below > > > -----Original Message----- > From: rxtx-bounces at qbang.org on behalf of YiQi Huang > Sent: Wed 5/24/2006 12:50 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] install rxtx in XP > > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > cheers YiQi Huang From tod at todbot.com Wed May 24 00:01:57 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 23:01:57 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Yes, sorry, classpath entries are semicolon-separated on Windows and colon-separated on everything else. Your example code below is importing the wrong set of classes. It should not "import javax.comm.*", instead it should "import gnu.io.*". When I make that change, your example program compiles. The "javax.comm" package is the one released by Sun, the "gnu.io" package is the RXTX one. You might've seen some discussion that the two will be merged or become compatible, but that hasn't happened yet. -=tod On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > > Yes, Michael you are right, it should be semicolons, But it still > can't > find the correct library. > > On Wed, 24 May 2006, Michael Mester wrote: > >> I believe the entries in the classpath need to be seperated with >> semicolons, not a colon as you have in your command below >> >> >> -----Original Message----- >> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >> Sent: Wed 5/24/2006 12:50 AM >> To: RXTX Developers and Users >> Subject: Re: [Rxtx] install rxtx in XP >> >> Hi, >> >> Sorry guys.I follow Tod's instruction, and here is what i did: >> >> put >> RXTXcomm.jar, >> rxtxParallel.dll, >> rxtxSerial.dll >> in >> C:\RXTX_files >> >> and I got a SimpleRead class attached below, compile it with : >> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >> it still saying "cannot find symbol". >> >> Is there anything I did wrong? Do I need the comm.jar from Sun? >> >> Thanks & regards >> YiQi Huang >> >> >> //////////////////////////////////////////////////////// >> // SimpleRead.java >> //////////////////////////////////////////////////////// >> >> import java.io.*; >> import java.util.*; >> import javax.comm.*; >> >> public class SimpleRead >> implements Runnable, SerialPortEventListener { >> static CommPortIdentifier portId; >> static Enumeration portList; >> InputStream inputStream; >> SerialPort serialPort; >> Thread readThread; >> public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == >> CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals("COM1")) { >> //if (portId.getName().equals("/dev/term/a")) { >> SimpleRead reader = new SimpleRead(); >> } >> } >> } >> } >> public SimpleRead() { >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", >> 2000); >> } catch (PortInUseException e) {} >> try { >> inputStream = serialPort.getInputStream(); >> } catch (IOException e) {} >> try { >> serialPort.addEventListener(this); >> } catch (TooManyListenersException e) {} >> serialPort.notifyOnDataAvailable(true); >> try { >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } catch (UnsupportedCommOperationException e) {} >> readThread = new Thread(this); >> readThread.start(); >> } >> public void run() { >> try { >> Thread.sleep(20000); >> } catch (InterruptedException e) {} >> } >> public void serialEvent(SerialPortEvent event) { >> switch(event.getEventType()) { >> case SerialPortEvent.BI: >> case SerialPortEvent.OE: >> case SerialPortEvent.FE: >> case SerialPortEvent.PE: >> case SerialPortEvent.CD: >> case SerialPortEvent.CTS: >> case SerialPortEvent.DSR: >> case SerialPortEvent.RI: >> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >> break; >> case SerialPortEvent.DATA_AVAILABLE: >> byte[] readBuffer = new byte[20]; >> try { >> while (inputStream.available() > 0) { >> int numBytes = inputStream.read(readBuffer); >> } >> System.out.print(new String(readBuffer)); >> } catch (IOException e) {} >> break; >> } >> } >> } >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > cheers > YiQi Huang > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From joachim at buechse.de Wed May 24 00:10:06 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:10:06 +0200 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Hi Sean, my preferred way of dealing with RXTX on OS X is to include the RXTX classes into my application jar and to put the RXTX lib in the same directory as this jar. To make it even more comfortable, you can include the lib in the jar and have some startup code extract it and write it to a temporary file from which you load it with System.load(). Unfortunately the current version of RXTX for OS X requires tinkering with user groups as it is based on lockfiles - and hence it needs the RXTX OS X installer or you need to duplicated this functionality in your own installer. I have created my own native version which is not based on lockfiles but tty locking (the standard way to do it on OSX). I hope that these patches will be integrated soon into the distribution. Regards, Joachim On 23.05.2006, at 16:46, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Wed May 24 00:16:12 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:16:12 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <7017ECFC-B13E-4806-B321-9FFCAC5830F0@buechse.de> I assume you downloaded rxtx-217 (not 207). Instead of importing javax.comm.* you must import gnu.io.* The classes have the same name, but they are not in the same package. On 24.05.2006, at 06:50, YiQi Huang wrote: > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From yhua537 at cse.unsw.edu.au Wed May 24 00:17:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 16:17:45 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Message-ID: Thanks Tod again, i kept reading "gnu.io.*" as "gun.io.*" last few hours after i read some commons from web. Thanks very much Tod. thanks YiQi Huang On Tue, 23 May 2006, Tod E. Kurt wrote: > Yes, sorry, classpath entries are semicolon-separated on Windows and > colon-separated on everything else. > > Your example code below is importing the wrong set of classes. It > should not "import javax.comm.*", instead it should "import > gnu.io.*". When I make that change, your example program compiles. > The "javax.comm" package is the one released by Sun, the "gnu.io" > package is the RXTX one. You might've seen some discussion that the > two will be merged or become compatible, but that hasn't happened yet. > > -=tod > > > On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > >> >> Yes, Michael you are right, it should be semicolons, But it still >> can't >> find the correct library. >> >> On Wed, 24 May 2006, Michael Mester wrote: >> >>> I believe the entries in the classpath need to be seperated with >>> semicolons, not a colon as you have in your command below >>> >>> >>> -----Original Message----- >>> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >>> Sent: Wed 5/24/2006 12:50 AM >>> To: RXTX Developers and Users >>> Subject: Re: [Rxtx] install rxtx in XP >>> >>> Hi, >>> >>> Sorry guys.I follow Tod's instruction, and here is what i did: >>> >>> put >>> RXTXcomm.jar, >>> rxtxParallel.dll, >>> rxtxSerial.dll >>> in >>> C:\RXTX_files >>> >>> and I got a SimpleRead class attached below, compile it with : >>> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >>> it still saying "cannot find symbol". >>> >>> Is there anything I did wrong? Do I need the comm.jar from Sun? >>> >>> Thanks & regards >>> YiQi Huang >>> >>> >>> //////////////////////////////////////////////////////// >>> // SimpleRead.java >>> //////////////////////////////////////////////////////// >>> >>> import java.io.*; >>> import java.util.*; >>> import javax.comm.*; >>> >>> public class SimpleRead >>> implements Runnable, SerialPortEventListener { >>> static CommPortIdentifier portId; >>> static Enumeration portList; >>> InputStream inputStream; >>> SerialPort serialPort; >>> Thread readThread; >>> public static void main(String[] args) { >>> portList = CommPortIdentifier.getPortIdentifiers(); >>> while (portList.hasMoreElements()) { >>> portId = (CommPortIdentifier) portList.nextElement(); >>> if (portId.getPortType() == >>> CommPortIdentifier.PORT_SERIAL) { >>> if (portId.getName().equals("COM1")) { >>> //if (portId.getName().equals("/dev/term/a")) { >>> SimpleRead reader = new SimpleRead(); >>> } >>> } >>> } >>> } >>> public SimpleRead() { >>> try { >>> serialPort = (SerialPort) portId.open("SimpleReadApp", >>> 2000); >>> } catch (PortInUseException e) {} >>> try { >>> inputStream = serialPort.getInputStream(); >>> } catch (IOException e) {} >>> try { >>> serialPort.addEventListener(this); >>> } catch (TooManyListenersException e) {} >>> serialPort.notifyOnDataAvailable(true); >>> try { >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, >>> SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> } catch (UnsupportedCommOperationException e) {} >>> readThread = new Thread(this); >>> readThread.start(); >>> } >>> public void run() { >>> try { >>> Thread.sleep(20000); >>> } catch (InterruptedException e) {} >>> } >>> public void serialEvent(SerialPortEvent event) { >>> switch(event.getEventType()) { >>> case SerialPortEvent.BI: >>> case SerialPortEvent.OE: >>> case SerialPortEvent.FE: >>> case SerialPortEvent.PE: >>> case SerialPortEvent.CD: >>> case SerialPortEvent.CTS: >>> case SerialPortEvent.DSR: >>> case SerialPortEvent.RI: >>> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >>> break; >>> case SerialPortEvent.DATA_AVAILABLE: >>> byte[] readBuffer = new byte[20]; >>> try { >>> while (inputStream.available() > 0) { >>> int numBytes = inputStream.read(readBuffer); >>> } >>> System.out.print(new String(readBuffer)); >>> } catch (IOException e) {} >>> break; >>> } >>> } >>> } >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> >> cheers >> YiQi Huang >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From smontgomery at mediaspansoftware.com Wed May 24 10:24:13 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 12:24:13 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: Tod & Joachim, Thanks for the info, that's very helpful. I'll give that a whirl when I move to rxtx 2.1. I'm still using the older 2.0.7 version for now (don't ask), which probably requires the Sun comm.jar, javax.comm.properties and librxtxSerial.jnilib to be in very specific places in each jvm's file hierarchy. From tjarvi at qbang.org Wed May 24 11:59:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 11:59:16 -0600 (MDT) Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: On Wed, 24 May 2006, Sean Montgomery wrote: > Tod & Joachim, > > Thanks for the info, that's very helpful. I'll give that a whirl > when I move to rxtx 2.1. I'm still using the older 2.0.7 version for > now (don't ask), which probably requires the Sun comm.jar, > javax.comm.properties and librxtxSerial.jnilib to be in very specific > places in each jvm's file hierarchy. > You will need comm.jar from Sun then. It must be Sun's version 2.* or older for Linux or Solaris. I assume they have this in download archives. The default offering from Sun is version 3.0. This version currently does not support rxtx. The older version will probably be fine for your needs. -- Trent Jarvi tjarvi at qbang.org From smontgomery at mediaspansoftware.com Wed May 24 12:19:06 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 14:19:06 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: <3939EFB8-11E1-4E3E-A684-5B3C525577CD@mediaspansoftware.com> Yup, that's right, thanks Trent. I've been using these files for quite a while now. Thanks for bringing it up. I almost didn't mention using 2.0.7 because I didn't want to give any new members of the list the wrong idea! :-) On May 24, 2006, at 1:59 PM, Trent Jarvi wrote: > On Wed, 24 May 2006, Sean Montgomery wrote: > >> Tod & Joachim, >> >> Thanks for the info, that's very helpful. I'll give that a whirl >> when I move to rxtx 2.1. I'm still using the older 2.0.7 version for >> now (don't ask), which probably requires the Sun comm.jar, >> javax.comm.properties and librxtxSerial.jnilib to be in very specific >> places in each jvm's file hierarchy. >> > > You will need comm.jar from Sun then. It must be Sun's version 2.* or > older for Linux or Solaris. I assume they have this in download > archives. > > The default offering from Sun is version 3.0. This version > currently does > not support rxtx. > > The older version will probably be fine for your needs. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mark at mdsh.com Wed May 24 15:55:46 2006 From: mark at mdsh.com (Mark Himsley) Date: Wed, 24 May 2006 22:55:46 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <37B0FC4B1F3237321F093ABE@MacMini.local> On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) That's no problem. BUT, do note that the instructions I elaborated on are in the INSTALL file within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone please update the INSTALL file? > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > > , it includes DLLs for Windows and the JAR > > for Java. > > > > Follow the Windows instructions in the INSTALL. > > > > ie > > > > RXTXcomm.jar goes in \jre\lib\ext (under java) > > rxtxSerial.dll goes in \jre\bin > > > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > > C:\Program Files\Java\jre1.5.0_06\lib\ext > > and copy rxtxSerial.dll into > > C:\Program Files\Java\jre1.5.0_06\bin > > > > Yes, it really is that simple. > > > > > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > > > >> I am new to serial port programming, and have no experience on > >> programming java in xp, but my project require me to builld a > >> communication link between xp and a UART device. > >> > >> Most of the information in the web site seems for linux only. > >> including > >> the commands such as export and chmod. How do I install rxtx in xp? > >> > >> cheers > >> YiQi Huang > > > > > > > > -- > > Mark Himsley > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Mark Himsley From tjarvi at qbang.org Wed May 24 16:41:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 16:41:46 -0600 (MDT) Subject: [Rxtx] install rxtx in XP In-Reply-To: <37B0FC4B1F3237321F093ABE@MacMini.local> References: <37B0FC4B1F3237321F093ABE@MacMini.local> Message-ID: On Wed, 24 May 2006, Mark Himsley wrote: > > > On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > >> I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > That's no problem. > > BUT, do note that the instructions I elaborated on are in the INSTALL file > within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone > please update the INSTALL file? > > The INSTALL file may be updated by anyone at anytime. http://rxtx.qbang.org/wiki/index.php/Installation We are moving it to the wiki so end users may put the type of answers they would like to see in. Sometimes it's best if developers don't give what appears to be cryptic answers. You can even put in that jre/lib/ext is not the right place but you don't understand the classpath solution mentioned on the mail-list and then we know what to add. -- Trent Jarvi tjarvi at qbang.org From stramit at gmail.com Wed May 24 21:45:31 2006 From: stramit at gmail.com (Tim Cooper) Date: Thu, 25 May 2006 13:45:31 +1000 Subject: [Rxtx] Accessing Virtual Com Port Message-ID: Hi, I have to develop an application that talks to a virtual com port (in this case com3) which translates any messages sent across a USB cable to a micro. Using C++ I can talk to this com port and I know that it is configured, present, and working. For the application that I am trying to write I want to use RXTX for the communication. My problem is that the configured virtual port (in windows) is not showing up when I do an enumeration over the available ports. The output I get is (com 3 is not present) : Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 PORT FOUND: COM1 PORT FOUND: LPT1 Is there anything that I need to do to make com3 available to RXTX and my application? Timothy Cooper -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060524/c5591648/attachment-0004.html From antonio.luis at iscte.pt Thu May 25 01:39:13 2006 From: antonio.luis at iscte.pt (=?ISO-8859-1?Q?Ant=F3nio_Lopes?=) Date: Thu, 25 May 2006 08:39:13 +0100 Subject: [Rxtx] RXTX on Pocket PC Message-ID: <44755F21.8060103@iscte.pt> Hello everyone, I've been using RXTX to communicate with serial ports in Windows and it's been quite successful. However, I'm now considering porting my application from Windows to Pocket PC but I can't seem to find the RXTX binaries (*.jar and *.dll) to use in Pocket PC. I've been "digging" on the mailing list's archives and also on the web and I can't find these anywhere. Can anyone in this mailing list give me some pointers on this? Where can I find the necessary files and basic installation instructions? Thanks very much for your help. I very much appreciate any help that you can provide me. Regards, -- Ant?nio Lopes @contact: antonio.luis at iscte.pt @work: ADETTI - ISCTE @web: http://antonio.lopes.googlepages.com/home From doug at dupreeinc.com Fri May 26 15:45:50 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Fri, 26 May 2006 14:45:50 -0700 Subject: [Rxtx] rxtx slow startup Message-ID: <4477770E.9010400@dupreeinc.com> Hello, I hope there are people still reading this mailing list. The archive appeared to not have anything new after 4/2005. I was using the commapi from sun for a project where a java application reads data from test equipment connected to the serial port. I had to upgrade the ftdi vcp driver on my pc and the old sun commapi no longer works with hardware flow control. as an experiment I replaced the javax.com with gnu.io in the SerialDemo.java project that was included with the commapi. This compiled fine using JBuilder 2006 and JRE 1.5.0_05. RXTX also works with the latest ftdi drivers so life is wonderful again... almost... When using the commapi jar the SerialDemo program starts in about 1 second on my system. Using the RXTX jar it takes over 56 seconds to start. Has anyone else seen this problem? Is there a workaround to get the startup performance close to the old commapi? The last thing printed to the console before this delay is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks for your time! Doug From yhua537 at cse.unsw.edu.au Sat May 27 05:46:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 21:46:45 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <4477770E.9010400@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> Message-ID: hi Doug The archive hasn't been update for a long time, But people certainly still reading the list. I don't have enough experience to help on your problem, but without any detail about what your problem doing during that 56 seconds, it is hard to target the your question, I think. cheers YiQi On Fri, 26 May 2006, Doug Thistlethwaite wrote: > Hello, > > I hope there are people still reading this mailing list. The archive > appeared to not have anything new after 4/2005. > > I was using the commapi from sun for a project where a java application > reads data from test equipment connected to the serial port. I had to > upgrade the ftdi vcp driver on my pc and the old sun commapi no longer > works with hardware flow control. as an experiment I replaced the > javax.com with gnu.io in the SerialDemo.java project that was included > with the commapi. This compiled fine using JBuilder 2006 and JRE > 1.5.0_05. RXTX also works with the latest ftdi drivers so life is > wonderful again... almost... > > When using the commapi jar the SerialDemo program starts in about 1 > second on my system. Using the RXTX jar it takes over 56 seconds to > start. Has anyone else seen this problem? Is there a workaround to get > the startup performance close to the old commapi? > > The last thing printed to the console before this delay is: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Thanks for your time! > > Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------- Just a student, Still a student ------------------------------- From yhua537 at cse.unsw.edu.au Sat May 27 06:04:26 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 22:04:26 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: Sorry, I don't think you could understand what I mean .I mean this: Without any detail about what your program is doing during that 56 seconds, it is hard for anyone to target the problem. On Sat, 27 May 2006, YiQi Huang wrote: > hi Doug > > The archive hasn't been update for a long time, But people certainly still > reading the list. > > I don't have enough experience to help on your problem, but without any > detail about what your problem doing during that 56 seconds, it is hard to > target the your question, I think. > > cheers > YiQi > > On Fri, 26 May 2006, Doug Thistlethwaite wrote: > >> Hello, >> >> I hope there are people still reading this mailing list. The archive >> appeared to not have anything new after 4/2005. >> >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From jredman at ergotech.com Sat May 27 08:32:02 2006 From: jredman at ergotech.com (Jim Redman) Date: Sat, 27 May 2006 08:32:02 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: <447862E2.4080506@ergotech.com> Doug, Since you mentioned it, we have a system that is also seems slow. From memory (I don't have one of the slow systems around), I'm not sure that it's consistent, it seems that sometimes it may take longer than others. Since it's part of the bootup it hasn't raised a flag and I haven't researched it. The same code runs much faster on other systems, so now you've got me wondering what's different. The slow system boots DSL (http://www.damnsmalllinux.org/) from a compact flash. FC4 is on my desktop where I haven't noticed a slow down. I think that the rxtx code is the same in both cases with lock files disabled. The slow system has a bunch of serial ports defined, including 4 USB serial ports that do not exist - they are not plugged in. Any clues in there? Jim > On Fri, 26 May 2006, Doug Thistlethwaite wrote: >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Sat May 27 10:41:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 May 2006 10:41:54 -0600 (MDT) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447862E2.4080506@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: On Sat, 27 May 2006, Jim Redman wrote: > Doug, > > Since you mentioned it, we have a system that is also seems slow. From > memory (I don't have one of the slow systems around), I'm not sure that > it's consistent, it seems that sometimes it may take longer than others. > Since it's part of the bootup it hasn't raised a flag and I haven't > researched it. > > The same code runs much faster on other systems, so now you've got me > wondering what's different. > > The slow system boots DSL (http://www.damnsmalllinux.org/) from a > compact flash. FC4 is on my desktop where I haven't noticed a slow > down. I think that the rxtx code is the same in both cases with lock > files disabled. > > The slow system has a bunch of serial ports defined, including 4 USB > serial ports that do not exist - they are not plugged in. > > Any clues in there? > rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. When it does this, it will try to open each port and do a timed out read. most systems will not have entries in device if the port is not there. But some minimal systems will just put all the device files there in case hardware is added. The list of devices scanned used to be ~10-20 times longer than it is today. That was getting very slow. I suspect moving the device files not used to a backup directory would increase the enumeration. I'll look into why the mail-list archive is not updating. The last update was about when I thought I 'fixed' the cron jobs. I probably didn't actually fix it but rather moved the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon May 29 19:46:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 May 2006 19:46:47 -0600 (MDT) Subject: [Rxtx] Mail-List Archives are updating. Message-ID: It was pointed out earlier that the archive is dated. This was a missing crontab entry. The list is currently archived by the week on the web page. It is updated once a day. So every 7 days it starts a new link and updates it daily. I've been limited in what I could do while my cable modem was disconnected this last week. rxtx.org is something I do on my own time. The patches and credits will be comming next. Many of these can be seen in bugzilla right now. -- Trent Jarvi tjarvi at qbang.org From doug at dupreeinc.com Tue May 30 11:18:41 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 10:18:41 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: <447C7E71.4080204@dupreeinc.com> Trent, YiQi, and Jim: Thanks to all for the replies and information! I am just back from a long weekend and I am now trying to figure out what I was doing! :) As for more information. First off, this example is being run under windows XP. I am developing test equipment that communicates with a java application via a serial port. I have been using the commapi for several years and have not had a problem. Recently, I have started a design modification that will replace the RS232 connection with a USB port. I am using the ftdi module for prototyping and I discovered that their virtual com port driver was not compatible with the commapi that Sun released. It turns out that it has problems with hardware flow control ( it works on incoming but not outgoing communications). The way I figured this out was by experimenting with the SerialDemo that was included with the Sum commapi. One nice thing about this example is it has the ability to set incoming and outgoing flow control independently. After I installed RXTX into my JBuilder 2006 IDE, I just replaced all all instances of javax.comm with gnu.io and it compiled and runs without a hitch (except for the slow startup). I Paused the JBuilder IDE during this long pause and the last few entries in the stack trace are: testRead() : -1, gnu.io.RXTXCommDriver registerValidPorts() : 255, gnu.io.RXTXCommDriver registerScannedPorts() : 777, gnu.io.RXTXCommDriver This was all initiated by the following call in the programs init routine: Enumeration en = CommPortIdentifier.getPortIdentifiers(); After looking at this, My guess is that Trent is correct in that the delay is in scanning for ports. I guess one solution would be to not scan for ports, though it would be nice to detect what is available on the system. Is there any way to reduce the number of ports scanned by this function in windows XP? Thanks again for your time, Doug Trent Jarvi wrote: >On Sat, 27 May 2006, Jim Redman wrote: > > > >>Doug, >> >>Since you mentioned it, we have a system that is also seems slow. From >>memory (I don't have one of the slow systems around), I'm not sure that >>it's consistent, it seems that sometimes it may take longer than others. >>Since it's part of the bootup it hasn't raised a flag and I haven't >>researched it. >> >>The same code runs much faster on other systems, so now you've got me >>wondering what's different. >> >>The slow system boots DSL (http://www.damnsmalllinux.org/) from a >>compact flash. FC4 is on my desktop where I haven't noticed a slow >>down. I think that the rxtx code is the same in both cases with lock >>files disabled. >> >>The slow system has a bunch of serial ports defined, including 4 USB >>serial ports that do not exist - they are not plugged in. >> >>Any clues in there? >> >> >> > >rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. > >When it does this, it will try to open each port and do a timed out read. >most systems will not have entries in device if the port is not there. >But some minimal systems will just put all the device files there in case >hardware is added. > >The list of devices scanned used to be ~10-20 times longer than it is >today. That was getting very slow. > >I suspect moving the device files not used to a backup directory would >increase the enumeration. > >I'll look into why the mail-list archive is not updating. The last update >was about when I thought I 'fixed' the cron jobs. I probably didn't >actually fix it but rather moved the problem. > >-- >Trent Jarvi >tjarvi at qbang.org > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/86796453/attachment-0004.html From doug at dupreeinc.com Tue May 30 14:36:09 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 13:36:09 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447C7E71.4080204@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com> Message-ID: <447CACB9.1000801@dupreeinc.com> Hello all, I also notice this pause (not as long however) when I call: CommPortIdentifier.getPortIdentifier(PortName); I would think that if I supply the name of the port, it would not have to go through the same discovery process. If you have any ideas of how to get rid of this startup delay, I would really appreciate it. Thanks, Doug Doug Thistlethwaite wrote: > Trent, YiQi, and Jim: > > Thanks to all for the replies and information! I am just back from a > long weekend and I am now trying to figure out what I was doing! :) > > As for more information. First off, this example is being run under > windows XP. I am developing test equipment that communicates with a > java application via a serial port. I have been using the commapi for > several years and have not had a problem. Recently, I have started a > design modification that will replace the RS232 connection with a USB > port. I am using the ftdi module for prototyping and I discovered > that their virtual com port driver was not compatible with the commapi > that Sun released. It turns out that it has problems with hardware > flow control ( it works on incoming but not outgoing communications). > The way I figured this out was by experimenting with the SerialDemo > that was included with the Sum commapi. One nice thing about this > example is it has the ability to set incoming and outgoing flow > control independently. > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup). > > I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are: > > testRead() : -1, gnu.io.RXTXCommDriver > registerValidPorts() : 255, gnu.io.RXTXCommDriver > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > This was all initiated by the following call in the programs init routine: > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > After looking at this, My guess is that Trent is correct in that the > delay is in scanning for ports. I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system. Is there any way to reduce the number of ports scanned by > this function in windows XP? > > Thanks again for your time, > > Doug > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/edaa5c3c/attachment-0004.html From lynn at swcp.com Tue May 30 15:07:18 2006 From: lynn at swcp.com (lynn@swcp.com) Date: Tue, 30 May 2006 21:07:18 -0000 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CACB9.1000801@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: *IF* the name of the port is supplied, we might want to use the preferences mechanism (java.util.prefs) where we could have previously saved the info for the port. We could do a quick check to see that things have not changed before using it. If things have changed (or never been defined) we would do a full port scan and save detected ports in the preferences. This way if the hardware is not changed, you only pay the time penalty one time. just an idea... Lynn Doug Thistlethwaite said: > This is a multi-part message in MIME format. > --------------070808020900080005070500 > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > Content-Transfer-Encoding: 7bit > > Hello all, > > I also notice this pause (not as long however) when I call: > > CommPortIdentifier.getPortIdentifier(PortName); > > I would think that if I supply the name of the port, it would not have > to go through the same discovery process. If you have any ideas of how > to get rid of this startup delay, I would really appreciate it. > > Thanks, > > Doug > > Doug Thistlethwaite wrote: > > > Trent, YiQi, and Jim: > > > > Thanks to all for the replies and information! I am just back from a > > long weekend and I am now trying to figure out what I was doing! :) > > > > As for more information. First off, this example is being run under > > windows XP. I am developing test equipment that communicates with a > > java application via a serial port. I have been using the commapi for > > several years and have not had a problem. Recently, I have started a > > design modification that will replace the RS232 connection with a USB > > port. I am using the ftdi module for prototyping and I discovered > > that their virtual com port driver was not compatible with the commapi > > that Sun released. It turns out that it has problems with hardware > > flow control ( it works on incoming but not outgoing communications). > > The way I figured this out was by experimenting with the SerialDemo > > that was included with the Sum commapi. One nice thing about this > > example is it has the ability to set incoming and outgoing flow > > control independently. > > > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > > all instances of javax.comm with gnu.io and it compiled and runs > > without a hitch (except for the slow startup). > > > > I Paused the JBuilder IDE during this long pause and the last few > > entries in the stack trace are: > > > > testRead() : -1, gnu.io.RXTXCommDriver > > registerValidPorts() : 255, gnu.io.RXTXCommDriver > > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > > > This was all initiated by the following call in the programs init routine: > > > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > > > After looking at this, My guess is that Trent is correct in that the > > delay is in scanning for ports. I guess one solution would be to not > > scan for ports, though it would be nice to detect what is available on > > the system. Is there any way to reduce the number of ports scanned by > > this function in windows XP? > > > > Thanks again for your time, > > > > Doug > > > > --------------070808020900080005070500 > Content-Type: text/html; charset=ISO-8859-1 > Content-Transfer-Encoding: 7bit > > > > > > > > > Hello all,
>
> I also notice this pause (not as long however) when I call:
>
>          CommPortIdentifier.getPortIdentifier(PortName);
>
> I would think that if I supply the name of the port, it would not have > to go through the same discovery process.  If you have any ideas of how > to get rid of this startup delay, I would really appreciate it.
>
> Thanks,
>
> Doug
>
> Doug Thistlethwaite wrote: >
> > Trent, YiQi, and Jim:
>
> Thanks to all for the replies and information!  I am just back from a > long weekend and I am now trying to figure out what I was doing! :)
>
> As for more information.  First off, this example is being run under > windows XP.  I am developing test equipment that communicates with a > java application via a serial port.  I have been using the commapi for > several years and have not had a problem.  Recently, I have started a > design modification that will replace the RS232 connection with a USB > port.  I am using the ftdi module for prototyping and I discovered that > their virtual com port driver was not compatible with the commapi that > Sun released.  It turns out that it has problems with hardware flow > control ( it works on incoming but not outgoing communications).  The > way I figured this out was by experimenting with the SerialDemo that > was included with the Sum commapi.  One nice thing about this example > is it has the ability to set incoming and outgoing flow control > independently.
>
> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup).
>
> I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are:
>
> testRead() : -1, gnu.io.RXTXCommDriver
> registerValidPorts() : 255, gnu.io.RXTXCommDriver
> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>
> This was all initiated by the following call in the programs init > routine:
>
> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>
> After looking at this,  My guess is that Trent is correct in that the > delay is in scanning for ports.  I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system.  Is there any way to reduce the number of ports scanned by > this function in windows XP? 
>
> Thanks again for your time,
>
> Doug
>
>
> > > > --------------070808020900080005070500-- > -- From jredman at ergotech.com Tue May 30 15:42:35 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 30 May 2006 15:42:35 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: <447CBC4B.2080206@ergotech.com> Lynn, If I understand your idea correctly, I don't think that this would work well for, say, USB ports since these can be easily added/removed by the end user. Jim lynn at swcp.com wrote: > *IF* the name of the port is supplied, we might want to use the preferences > mechanism (java.util.prefs) where we could have previously saved the info for > the port. We could do a quick check to see that things have not changed > before using it. If things have changed (or never been defined) we would do a > full port scan and save detected ports in the preferences. > > This way if the hardware is not changed, you only pay the time penalty one time. > > just an idea... > Lynn > > > Doug Thistlethwaite said: > >> This is a multi-part message in MIME format. >> --------------070808020900080005070500 >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >> Content-Transfer-Encoding: 7bit >> >> Hello all, >> >> I also notice this pause (not as long however) when I call: >> >> CommPortIdentifier.getPortIdentifier(PortName); >> >> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process. If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it. >> >> Thanks, >> >> Doug >> >> Doug Thistlethwaite wrote: >> >>> Trent, YiQi, and Jim: >>> >>> Thanks to all for the replies and information! I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :) >>> >>> As for more information. First off, this example is being run under >>> windows XP. I am developing test equipment that communicates with a >>> java application via a serial port. I have been using the commapi for >>> several years and have not had a problem. Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port. I am using the ftdi module for prototyping and I discovered >>> that their virtual com port driver was not compatible with the commapi >>> that Sun released. It turns out that it has problems with hardware >>> flow control ( it works on incoming but not outgoing communications). >>> The way I figured this out was by experimenting with the SerialDemo >>> that was included with the Sum commapi. One nice thing about this >>> example is it has the ability to set incoming and outgoing flow >>> control independently. >>> >>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup). >>> >>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are: >>> >>> testRead() : -1, gnu.io.RXTXCommDriver >>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>> >>> This was all initiated by the following call in the programs init routine: >>> >>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>> >>> After looking at this, My guess is that Trent is correct in that the >>> delay is in scanning for ports. I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system. Is there any way to reduce the number of ports scanned by >>> this function in windows XP? >>> >>> Thanks again for your time, >>> >>> Doug >>> >> --------------070808020900080005070500 >> Content-Type: text/html; charset=ISO-8859-1 >> Content-Transfer-Encoding: 7bit >> >> >> >> >> >> >> >> >> Hello all,
>>
>> I also notice this pause (not as long however) when I call:
>>
>>         >  CommPortIdentifier.getPortIdentifier(PortName);
>>
>> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process.  If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it.
>>
>> Thanks,
>>
>> Doug
>>
>> Doug Thistlethwaite wrote: >>
>> >> Trent, YiQi, and Jim:
>>
>> Thanks to all for the replies and information!  I am just back from a >> long weekend and I am now trying to figure out what I was doing! :)
>>
>> As for more information.  First off, this example is being run under >> windows XP.  I am developing test equipment that communicates with a >> java application via a serial port.  I have been using the commapi for >> several years and have not had a problem.  Recently, I have started a >> design modification that will replace the RS232 connection with a USB >> port.  I am using the ftdi module for prototyping and I discovered that >> their virtual com port driver was not compatible with the commapi that >> Sun released.  It turns out that it has problems with hardware flow >> control ( it works on incoming but not outgoing communications).  The >> way I figured this out was by experimenting with the SerialDemo that >> was included with the Sum commapi.  One nice thing about this example >> is it has the ability to set incoming and outgoing flow control >> independently.
>>
>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >> all instances of javax.comm with gnu.io and it compiled and runs >> without a hitch (except for the slow startup).
>>
>> I Paused the JBuilder IDE during this long pause and the last few >> entries in the stack trace are:
>>
>> testRead() : -1, gnu.io.RXTXCommDriver
>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>
>> This was all initiated by the following call in the programs init >> routine:
>>
>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>
>> After looking at this,  My guess is that Trent is correct in that the >> delay is in scanning for ports.  I guess one solution would be to not >> scan for ports, though it would be nice to detect what is available on >> the system.  Is there any way to reduce the number of ports scanned by >> this function in windows XP? 
>>
>> Thanks again for your time,
>>
>> Doug
>>
>>
>> >> >> >> --------------070808020900080005070500-- >> > > > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From yhua537 at cse.unsw.edu.au Tue May 30 18:10:23 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 31 May 2006 10:10:23 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CBC4B.2080206@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: Doug, In the SerialDemo, it allow us to save the parameters into a file, and use it when your program start up. Would this help? YiQi On Tue, 30 May 2006, Jim Redman wrote: > Lynn, > > If I understand your idea correctly, I don't think that this would work > well for, say, USB ports since these can be easily added/removed by the > end user. > > Jim > > lynn at swcp.com wrote: >> *IF* the name of the port is supplied, we might want to use the preferences >> mechanism (java.util.prefs) where we could have previously saved the info for >> the port. We could do a quick check to see that things have not changed >> before using it. If things have changed (or never been defined) we would do a >> full port scan and save detected ports in the preferences. >> >> This way if the hardware is not changed, you only pay the time penalty one time. >> >> just an idea... >> Lynn >> >> >> Doug Thistlethwaite said: >> >>> This is a multi-part message in MIME format. >>> --------------070808020900080005070500 >>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>> Content-Transfer-Encoding: 7bit >>> >>> Hello all, >>> >>> I also notice this pause (not as long however) when I call: >>> >>> CommPortIdentifier.getPortIdentifier(PortName); >>> >>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process. If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it. >>> >>> Thanks, >>> >>> Doug >>> >>> Doug Thistlethwaite wrote: >>> >>>> Trent, YiQi, and Jim: >>>> >>>> Thanks to all for the replies and information! I am just back from a >>>> long weekend and I am now trying to figure out what I was doing! :) >>>> >>>> As for more information. First off, this example is being run under >>>> windows XP. I am developing test equipment that communicates with a >>>> java application via a serial port. I have been using the commapi for >>>> several years and have not had a problem. Recently, I have started a >>>> design modification that will replace the RS232 connection with a USB >>>> port. I am using the ftdi module for prototyping and I discovered >>>> that their virtual com port driver was not compatible with the commapi >>>> that Sun released. It turns out that it has problems with hardware >>>> flow control ( it works on incoming but not outgoing communications). >>>> The way I figured this out was by experimenting with the SerialDemo >>>> that was included with the Sum commapi. One nice thing about this >>>> example is it has the ability to set incoming and outgoing flow >>>> control independently. >>>> >>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>> all instances of javax.comm with gnu.io and it compiled and runs >>>> without a hitch (except for the slow startup). >>>> >>>> I Paused the JBuilder IDE during this long pause and the last few >>>> entries in the stack trace are: >>>> >>>> testRead() : -1, gnu.io.RXTXCommDriver >>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>> >>>> This was all initiated by the following call in the programs init routine: >>>> >>>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>> >>>> After looking at this, My guess is that Trent is correct in that the >>>> delay is in scanning for ports. I guess one solution would be to not >>>> scan for ports, though it would be nice to detect what is available on >>>> the system. Is there any way to reduce the number of ports scanned by >>>> this function in windows XP? >>>> >>>> Thanks again for your time, >>>> >>>> Doug >>>> >>> --------------070808020900080005070500 >>> Content-Type: text/html; charset=ISO-8859-1 >>> Content-Transfer-Encoding: 7bit >>> >>> >>> >>> >>> >>> >>> >>> >>> Hello all,
>>>
>>> I also notice this pause (not as long however) when I call:
>>>
>>>         >>  CommPortIdentifier.getPortIdentifier(PortName);
>>>
>>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process.  If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it.
>>>
>>> Thanks,
>>>
>>> Doug
>>>
>>> Doug Thistlethwaite wrote: >>>
>>> >>> Trent, YiQi, and Jim:
>>>
>>> Thanks to all for the replies and information!  I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :)
>>>
>>> As for more information.  First off, this example is being run under >>> windows XP.  I am developing test equipment that communicates with a >>> java application via a serial port.  I have been using the commapi for >>> several years and have not had a problem.  Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port.  I am using the ftdi module for prototyping and I discovered that >>> their virtual com port driver was not compatible with the commapi that >>> Sun released.  It turns out that it has problems with hardware flow >>> control ( it works on incoming but not outgoing communications).  The >>> way I figured this out was by experimenting with the SerialDemo that >>> was included with the Sum commapi.  One nice thing about this example >>> is it has the ability to set incoming and outgoing flow control >>> independently.
>>>
>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup).
>>>
>>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are:
>>>
>>> testRead() : -1, gnu.io.RXTXCommDriver
>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>
>>> This was all initiated by the following call in the programs init >>> routine:
>>>
>>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>
>>> After looking at this,  My guess is that Trent is correct in that the >>> delay is in scanning for ports.  I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system.  Is there any way to reduce the number of ports scanned by >>> this function in windows XP? 
>>>
>>> Thanks again for your time,
>>>
>>> Doug
>>>
>>>
>>> >>> >>> >>> --------------070808020900080005070500-- >>> >> >> >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From halbleib at rechnerbetriebsgruppe.de Wed May 31 02:06:16 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 10:06:16 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp Message-ID: <447D4E78.30302@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, I getting an error while reloading my app in tomcat. At the first start everything runs well, but if i reload mit webapp by tomcat manager i get the following error. java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader Is there a possibility to unload the native library rxtxSerial.dll? thx for all help! regards tom -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 b8FT80HQ1xlbDLnRecDANCc= =heb1 -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 02:52:17 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 10:52:17 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D4E78.30302@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> Message-ID: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Hello Tom, To the best of my knowledge it is impossible to unload native libraries once loaded into the JVM. The exception you see stems from the fact, that Tomcat creates a new classloader when you "reload" the weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar is loaded from the session class loader. Try to add RXTXComm.jar to your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. Regards, Joachim On 31.05.2006, at 10:06, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 > b8FT80HQ1xlbDLnRecDANCc= > =heb1 > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From halbleib at rechnerbetriebsgruppe.de Wed May 31 03:28:35 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 11:28:35 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Message-ID: <447D61C3.1030807@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Joachim, I'm still not getting it. How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml-file? Perhaps web.xml? Regards, Tom Joachim Buechse schrieb: > Hello Tom, > > To the best of my knowledge it is impossible to unload native > libraries once loaded into the JVM. The exception you see stems from > the fact, that Tomcat creates a new classloader when you "reload" the > weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar > is loaded from the session class loader. Try to add RXTXComm.jar to > your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. > > Regards, > Joachim > > On 31.05.2006, at 10:06, Tom Halbleib wrote: > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL tzNy+/0iIUfkYYgt1+UT1ko= =pkpY -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 04:03:42 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 12:03:42 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D61C3.1030807@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> <447D61C3.1030807@rechnerbetriebsgruppe.de> Message-ID: -Xbootclasspath/a: is a start option to the java vm. Google is your friend in finding how to modfiy it and what it means: tomcat modifying bootclasspath Regards, Joachim On 31.05.2006, at 11:28, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Joachim, > > I'm still not getting it. > How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml- > file? > Perhaps web.xml? > > Regards, > Tom > > Joachim Buechse schrieb: >> Hello Tom, >> >> To the best of my knowledge it is impossible to unload native >> libraries once loaded into the JVM. The exception you see stems from >> the fact, that Tomcat creates a new classloader when you "reload" the >> weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar >> is loaded from the session class loader. Try to add RXTXComm.jar to >> your bootlclasspath (-Xbootclasspath/a:) and the problem should go >> away. >> >> Regards, >> Joachim >> >> On 31.05.2006, at 10:06, Tom Halbleib wrote: >> >> Hi all, >> >> I getting an error while reloading my app in tomcat. At the first >> start >> everything runs well, but if i reload mit webapp by tomcat manager >> i get >> the following error. >> >> java.lang.UnsatisfiedLinkError: Native Library >> C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in >> another classloader thrown while loading gnu.io.RXTXCommDriver >> Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: >> Native >> Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already >> loaded >> in another classloader >> >> >> Is there a possibility to unload the native library rxtxSerial.dll? >> >> thx for all help! >> >> regards >> >> tom > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL > tzNy+/0iIUfkYYgt1+UT1ko= > =pkpY > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From impakt01 at optusnet.com.au Wed May 31 06:55:42 2006 From: impakt01 at optusnet.com.au (Daren) Date: Wed, 31 May 2006 22:55:42 +1000 Subject: [Rxtx] (no subject) Message-ID: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/ade7ad37/attachment-0004.html From doug at dupreeinc.com Wed May 31 10:19:19 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 31 May 2006 09:19:19 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: <447DC207.3070702@dupreeinc.com> I am not sure what you are saying. The Save parameters menu option saves the current settings (baud, data bits, etc.). The long pause (~60 seconds) is when the application first starts (before loading the saved parameters). This does bring up a question, though I hate this type of kludge approach to getting this library to work... What exactly is a PortIdentifier? Is it always the same? If I stored the results from "CommPortIdentifier.getPortIdentifier(PortName);" in a file, could I use this the next time the program is executed? In this case I am using a virtual com port driver to connect to the device through a USB port. Doug YiQi Huang wrote: >Doug, > >In the SerialDemo, it allow us to save the parameters into a file, and use >it when your program start up. Would this help? > >YiQi > >On Tue, 30 May 2006, Jim Redman wrote: > > > >>Lynn, >> >>If I understand your idea correctly, I don't think that this would work >>well for, say, USB ports since these can be easily added/removed by the >>end user. >> >>Jim >> >>lynn at swcp.com wrote: >> >> >>>*IF* the name of the port is supplied, we might want to use the preferences >>>mechanism (java.util.prefs) where we could have previously saved the info for >>>the port. We could do a quick check to see that things have not changed >>>before using it. If things have changed (or never been defined) we would do a >>>full port scan and save detected ports in the preferences. >>> >>>This way if the hardware is not changed, you only pay the time penalty one time. >>> >>>just an idea... >>>Lynn >>> >>> >>>Doug Thistlethwaite said: >>> >>> >>> >>>>This is a multi-part message in MIME format. >>>>--------------070808020900080005070500 >>>>Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>>>Content-Transfer-Encoding: 7bit >>>> >>>>Hello all, >>>> >>>>I also notice this pause (not as long however) when I call: >>>> >>>> CommPortIdentifier.getPortIdentifier(PortName); >>>> >>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process. If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it. >>>> >>>>Thanks, >>>> >>>>Doug >>>> >>>>Doug Thistlethwaite wrote: >>>> >>>> >>>> >>>>>Trent, YiQi, and Jim: >>>>> >>>>>Thanks to all for the replies and information! I am just back from a >>>>>long weekend and I am now trying to figure out what I was doing! :) >>>>> >>>>>As for more information. First off, this example is being run under >>>>>windows XP. I am developing test equipment that communicates with a >>>>>java application via a serial port. I have been using the commapi for >>>>>several years and have not had a problem. Recently, I have started a >>>>>design modification that will replace the RS232 connection with a USB >>>>>port. I am using the ftdi module for prototyping and I discovered >>>>>that their virtual com port driver was not compatible with the commapi >>>>>that Sun released. It turns out that it has problems with hardware >>>>>flow control ( it works on incoming but not outgoing communications). >>>>>The way I figured this out was by experimenting with the SerialDemo >>>>>that was included with the Sum commapi. One nice thing about this >>>>>example is it has the ability to set incoming and outgoing flow >>>>>control independently. >>>>> >>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>>without a hitch (except for the slow startup). >>>>> >>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>>entries in the stack trace are: >>>>> >>>>>testRead() : -1, gnu.io.RXTXCommDriver >>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>>> >>>>>This was all initiated by the following call in the programs init routine: >>>>> >>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>>> >>>>>After looking at this, My guess is that Trent is correct in that the >>>>>delay is in scanning for ports. I guess one solution would be to not >>>>>scan for ports, though it would be nice to detect what is available on >>>>>the system. Is there any way to reduce the number of ports scanned by >>>>>this function in windows XP? >>>>> >>>>>Thanks again for your time, >>>>> >>>>>Doug >>>>> >>>>> >>>>> >>>>--------------070808020900080005070500 >>>>Content-Type: text/html; charset=ISO-8859-1 >>>>Content-Transfer-Encoding: 7bit >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>>Hello all,
>>>>
>>>>I also notice this pause (not as long however) when I call:
>>>>
>>>>        >>>> >>>> >>> CommPortIdentifier.getPortIdentifier(PortName);
>>> >>> >>>>
>>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process.  If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it.
>>>>
>>>>Thanks,
>>>>
>>>>Doug
>>>>
>>>>Doug Thistlethwaite wrote: >>>>
>>>> >>>>Trent, YiQi, and Jim:
>>>>
>>>>Thanks to all for the replies and information!  I am just back from a >>>>long weekend and I am now trying to figure out what I was doing! :)
>>>>
>>>>As for more information.  First off, this example is being run under >>>>windows XP.  I am developing test equipment that communicates with a >>>>java application via a serial port.  I have been using the commapi for >>>>several years and have not had a problem.  Recently, I have started a >>>>design modification that will replace the RS232 connection with a USB >>>>port.  I am using the ftdi module for prototyping and I discovered that >>>>their virtual com port driver was not compatible with the commapi that >>>>Sun released.  It turns out that it has problems with hardware flow >>>>control ( it works on incoming but not outgoing communications).  The >>>>way I figured this out was by experimenting with the SerialDemo that >>>>was included with the Sum commapi.  One nice thing about this example >>>>is it has the ability to set incoming and outgoing flow control >>>>independently.
>>>>
>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>without a hitch (except for the slow startup).
>>>>
>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>entries in the stack trace are:
>>>>
>>>>testRead() : -1, gnu.io.RXTXCommDriver
>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>>
>>>>This was all initiated by the following call in the programs init >>>>routine:
>>>>
>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>>
>>>>After looking at this,  My guess is that Trent is correct in that the >>>>delay is in scanning for ports.  I guess one solution would be to not >>>>scan for ports, though it would be nice to detect what is available on >>>>the system.  Is there any way to reduce the number of ports scanned by >>>>this function in windows XP? 
>>>>
>>>>Thanks again for your time,
>>>>
>>>>Doug
>>>>
>>>>
>>>> >>>> >>>> >>>>--------------070808020900080005070500-- >>>> >>>> >>>> >>> >>> >>> >>-- >>Jim Redman >>(505) 662 5156 x85 >>http://www.ergotech.com >>_______________________________________________ >>Rxtx mailing list >>Rxtx at qbang.org >>http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > >cheers >YiQi Huang >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/61d4d4c9/attachment-0004.html From impakt01 at optusnet.com.au Wed May 31 17:02:54 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 09:02:54 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Message-ID: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Hi all, I downloaded 2.1.7-pre16 and managed to build it and get it going. I made the changes as suggested by Peter Smith in an old post, by adding his code to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. Still not working, it opens the port at 9600 according to portmon.exe . Has anyone managed to get this going at a custom rate? Here is the post I'm referring to: http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 Thanks, Daren ________________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Daren Sent: Wednesday, 31 May 2006 10:56 PM To: rxtx at qbang.org Subject: [Rxtx] (no subject) Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren From tjarvi at qbang.org Wed May 31 21:44:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 May 2006 21:44:01 -0600 (MDT) Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> References: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Message-ID: On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org From impakt01 at optusnet.com.au Wed May 31 22:06:04 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 14:06:04 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: Message-ID: <200606010406.k51464X2010447@mail03.syd.optusnet.com.au> Trent, I have managed to successfully open the port at this speed using Realterm (available on sourceforge). From memory this uses DLPortIO. Using portmon.exe with realterm, even there it says that the port has opened at 1953. I changed termios.c:560 to dcb->BaudRate = 1953 ; and it still opens the port at 9600. Daren -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Thursday, 1 June 2006 1:44 PM To: RXTX Developers and Users Subject: Re: [Rxtx] custom baud rate win32 On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From smontgomery at mediaspansoftware.com Mon May 1 09:52:28 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 11:52:28 -0400 Subject: [Rxtx] RXTX, Java COMM and Windows Server 2003 on x64 experiences? Message-ID: Just wondering if anybody here has had to deploy RXTX or the javax.comm on Windows Server 2003 machines running on x64 (i.e. Xeon EM64T) and would like to relate how things went. From Sun's site, the Supported System Configurations pages give the options for that system: Java 5.0: - 32-bit Java 5.0 running on the OS in the 32-bit mode - 64-bit Java 5.0 running on the OS in the 64-bit native mode Java 1.4.2: - no options listed for EM64T processors, but potentially the standard 32-bit Java 1.4.2 could run on the OS in 32-bit mode? I guess the two main points of failure would be 1) the JVM itself and 2) the jni components. Make that three: there's gotta be hardware vendor driver support for the OS in the various modes, too. Guess I better go look at Keyspan's website... Thanks in advance for any info anyone might be able to provide. From smontgomery at mediaspansoftware.com Mon May 1 10:18:33 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 12:18:33 -0400 Subject: [Rxtx] Mailing list archive out of date? Message-ID: The mailing list archive at: http://mailman.qbang.org/pipermail/rxtx/ only shows emails through the end of March. Is there a new archive somewhere else? Didn't see anything mentioned on the wiki. From p.cain at phasefale.com.au Mon May 1 22:33:09 2006 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 02 May 2006 14:33:09 +1000 Subject: [Rxtx] RXTX and the Linux kernel. Message-ID: <4456E105.5080106@phasefale.com.au> Hi, First off the problem I am having isn't caused by RXTX itself but I'm hoping someone out there may have some knowledge that may help me. Background: I have an application monitoring a control system through a standard PC serial port which I talk to with rxtx-2.0.5. The application runs on RedHat7.3 kernel version 2.4.18 using Java 1.4. This configuration has been in use for several years and has proved to be stable. But it has become necessary for me to upgrade the OS but I'm running into problems with the serial communications. Its not that the comms don't work on the new OS (its never that simple) the comms work for a variable period of time (sometimes several hours) and then just stop, nothing on the data lines and control lines all indicate that data could flow. The new OS is Ubuntu 5.10 running kernel version 2.6.12. I have installed the OS and software on a PC and had it perform ok, then install the new OS and same software on the very same hardware and experienced the problems of them comms stopping. In the new OS I'm using Java5 to run the app but since I have experience the problem I reverted back to Java1.4 which didn't fix the problem. I've moved the app to a different system RedHat FC3 running 2.6.14 had experienced the problem. Not wanting to go through all the thing I have tried but I have established that it seems to be the 2.6 versions of the kernel that seem to be the problem and not an individual distribution of Linux. I should point out that I am using the same jar and library files for each java and OS combination. So I'm just wondering if anyone has had or heard of problems similar to these ? Or perhaps might know of what changed in the Linux serial driver (something I'm having a hard time establishing). I'm starting to run low on ideas of what to try so any help would be much appreciated. -- Peter Cain Senior Programmer Phasefale Pty Ltd From tjarvi at qbang.org Wed May 3 07:31:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 May 2006 07:31:00 -0600 (MDT) Subject: [Rxtx] Re: Concering ircomm and RXTX In-Reply-To: References: Message-ID: On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From legolas.w at gmail.com Wed May 3 08:46:23 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 19:16:23 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <4458C23F.2000003@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From legolas.w at gmail.com Wed May 3 13:10:57 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 23:40:57 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <44590041.80706@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From Lars.Hennig at wow-portal.com Thu May 4 00:39:15 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Thu, 4 May 2006 08:39:15 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: Message-ID: Hi, I could not find any solution. I therefore decided to to my own native implementation. Allthough it only supports the functions I need, it works pretty well now for me. I think the main problem there is the use of a wrong Windows API function and not setting an timeout. Regards, Lars Hennig W?rth Online World GmbH Tel. (0049)7181-258183 Mob. (0049)160-3522889 Fax. (0049)7940-153299 Lars.Hennig at wow-portal.com Gesendet von: rxtx-bounces at qbang.org 09.04.2006 10:42 Bitte antworten zu RXTX Developers and Users An d.herwald at dsh-elektronik.de, RXTX Developers and Users Kopie Thema Re: [Rxtx] USB Serialport - disconnection problems WV Proj./Teilpr.: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/7b39f374/attachment-0005.html From Pawan.Kharbanda at dot.state.co.us Thu May 4 11:00:58 2006 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Thu, 4 May 2006 11:00:58 -0600 Subject: [Rxtx] Dangling Lock Files Message-ID: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Hi, I have been using RXTX API's for the Serial Communication for quite some time now and for some of the devices we are opening and closing the connection every 2 minutes. This works great for few days and then suddenly I start seeing some "Port in Use Exception" and I see that the Lock files are still in the /var/lock folder after manually removing the lock files it works good for few hours and I see the same problem again. Can somebody explain me the scenarios why I am seeing the dangling Lock files? I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise Servers. Thanks Pawan Kharbanda -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/ba0e9261/attachment-0005.html From tjarvi at qbang.org Thu May 4 14:10:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:10:30 -0600 (MDT) Subject: [Rxtx] Dangling Lock Files In-Reply-To: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> References: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Message-ID: On Thu, 4 May 2006, Kharbanda, Pawan wrote: > Hi, > I have been using RXTX API's for the Serial Communication for quite > some time now and for some of the devices we are opening and closing the > connection every 2 minutes. This works great for few days and then > suddenly I start seeing some "Port in Use Exception" and I see that the > Lock files are still in the /var/lock folder after manually removing the > lock files it works good for few hours and I see the same problem again. > Can somebody explain me the scenarios why I am seeing the dangling Lock > files? > > I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise > Servers. Hi Pawan The next time it happens, look in the lockfile. There will be a pid. ps aux |grep 'pid' I think you will see that the application is still running for some reason. RXTX does a kill -0 on the pid to see if its alive. If not, it will remove the lockfile. So I suspect the previous program did not exit as you expected. -- Trent Jarvi tjarvi at qbang.org From Scott.Hughes at dalsemi.com Thu May 4 14:23:11 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 4 May 2006 15:23:11 -0500 Subject: [Rxtx] Wiki instructions... Message-ID: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire demo apps, when I stumbled across this tip on the wiki to add yourself to the uucp group: It may be simpler to just run usermod -G uucp jarvi Taken from: http://rxtx.qbang.org/wiki/index.php/Installation This does not work as advertised. I should have read the man page for usermod before I tried that out. If there are any groups which are not listed after the -G switch, the user is removed from those groups. On Ubuntu, this is bad... I removed myself from the Admin group, which removed my sudo priviledges. Ubuntu has no root account, so I've disabled the only account which could fix it. Anyone know of a good workaround? Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor From tjarvi at qbang.org Thu May 4 14:32:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:32:09 -0600 (MDT) Subject: [Rxtx] Wiki instructions... In-Reply-To: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> Message-ID: On Thu, 4 May 2006, Scott Hughes wrote: > I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire > demo apps, when I stumbled across this tip on the wiki to add yourself to > the uucp group: > > It may be simpler to just run > > usermod -G uucp jarvi > > Taken from: > http://rxtx.qbang.org/wiki/index.php/Installation > > This does not work as advertised. I should have read the man page for > usermod before I tried that out. If there are any groups which are not > listed after the -G switch, the user is removed from those groups. On > Ubuntu, this is bad... I removed myself from the Admin group, which removed > my sudo priviledges. Ubuntu has no root account, so I've disabled the only > account which could fix it. > > Anyone know of a good workaround? > Yikes This will get your permissions back: in grub/lilo/.. pass the following option to the kernel init=/bin/sh You are now root. when it boots, mount -o remount,rw / add yourself to the groups, reboot to get normal init going. Thats about all I can think of without sudo/root. -- Trent Jarvi tjarvi at qbang.org From Gettings at earth.utah.edu Thu May 4 14:41:22 2006 From: Gettings at earth.utah.edu (Paul Gettings) Date: Thu, 4 May 2006 14:41:22 -0600 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <20060504204122.GA6534@earth.utah.edu> When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get messages on stdout from the JVM: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 As the only change was the version of RXTX (from 2.1.6), I am unsure why the messages suddenly appeared. Anyone know how to get rid of them? Thanks. -- 101 USES FOR A DEAD MICROPROCESSOR (23) Dead cat brush From mmester at sps.edu Mon May 1 21:22:28 2006 From: mmester at sps.edu (Michael Mester) Date: Mon, 1 May 2006 23:22:28 -0400 Subject: [Rxtx] Windows PortInUseException Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> I'm trying to get simple serial communication going with RxTx under Windows XP. I can enumerate the ports fine, but I always run into problems when I try to open one. I get a PortInUseException, but the owner application is "Unknown" and the port is never open. I've tried this on several different systems and all of them give the same behavior. The only thing I can thiunk of that might be causing the problem is that fact that I had to put the serial .dll file in system32 instead of the reccommended folder, because it didn't work in the folder the documentation gives. The library loads fine, though, so I'm not sure whether that makes sense, and I don't know how to fix it anyway. Any help is greatly appreciated. Below is the output of the program, right up to the PortInUseException and the NullPointerException it causes (because the serial port object is not instantiated). C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI Starting GPSTalkerGUI... Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 gnu.io.PortInUseException: Unknown Application Exception in thread "main" java.lang.NullPointerException at GPSTalkerGUI.(GPSTalkerGUI.java:102) at GPSTalkerGUI.main(GPSTalkerGUI.java:161) Again, thank you very much for any help you can give. From lshellman at qwest.net Wed May 3 01:38:34 2006 From: lshellman at qwest.net (Lucious Shellman) Date: Wed, 03 May 2006 01:38:34 -0600 Subject: [Rxtx] Help needed: Project using parallel port Message-ID: <1146641914.8337.14.camel@localhost.localdomain> I was looking for a way to access the parallel port on a PC using Java. Searching the Internet, I came across this site (rxtx.org). What I am trying to do is detect logic levels from a TTL logic IC on the parallel port. I am not trying to do classic parallel port communication. I just want to detect whether a line(s) is (are) high or low. I am using Windows 98. Can rxtx be used to do this? If yes, is there a tutorial for using rxtx posted on the Internet that someone can direct me to. If you need more information, feel free to e-mail me. Unfortunately for me, I need the information ASAP. Thanks. lshellman at qwest.net From webmaster at egyhelp.com Wed May 3 18:43:39 2006 From: webmaster at egyhelp.com (Mohamed Samy) Date: Thu, 4 May 2006 02:43:39 +0200 Subject: [Rxtx] RE: Concering ircomm and RXTX In-Reply-To: Message-ID: <20060503184362.SM01044@Geek> Hey, I issue the command "modprobe ircomm-tty" yet no ttyircomm appears, while the ircomm appear by "modprobe ircomm" so forgive me but I am bit lost. Even searching google for the keyword "ttyircomm" only returns 3 matches. So any way I can start the ttyircomm???? Thanks a lot. -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Wednesday, May 03, 2006 3:31 PM To: Mohamed Samy; rxtx at qbang.org Cc: taj at www.linux.org.uk Subject: Re: Concering ircomm and RXTX On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 4 15:49:49 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 15:49:49 -0600 (MDT) Subject: [Rxtx] Windows PortInUseException In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> Message-ID: On Mon, 1 May 2006, Michael Mester wrote: > > I'm trying to get simple serial communication going with RxTx under > Windows XP. I can enumerate the ports fine, but I always run into > problems when I try to open one. I get a PortInUseException, but the > owner application is "Unknown" and the port is never open. I've tried > this on several different systems and all of them give the same > behavior. The only thing I can thiunk of that might be causing the > problem is that fact that I had to put the serial .dll file in system32 > instead of the reccommended folder, because it didn't work in the folder > the documentation gives. The library loads fine, though, so I'm not sure > whether that makes sense, and I don't know how to fix it anyway. Any > help is greatly appreciated. Below is the output of the program, right > up to the PortInUseException and the NullPointerException it causes > (because the serial port object is not instantiated). > > C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI > Starting GPSTalkerGUI... > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > gnu.io.PortInUseException: Unknown Application > Exception in thread "main" java.lang.NullPointerException > at GPSTalkerGUI.(GPSTalkerGUI.java:102) > at GPSTalkerGUI.main(GPSTalkerGUI.java:161) > Perhaps you are trying to open the port twice in your code? rxtx does open the ports, do a timed out read and then close the ports during enumeration. I think the port is being opened fine. The Unknown Application is always reported. On linux, there is some code that finds the actual application but on windows, its always unknown. If the port enumeration is returning the ports you expect, rxtx has opened the port and closed it with success. The port should open. There is also example code in the contrib directory that comes with rxtx source that has examples you can modify to work. -- Trent Jarvi tjarvi at qbang.org From Christian.Klemke at t-online.de Thu May 4 23:37:23 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Fri, 5 May 2006 07:37:23 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu> Message-ID: <004f01c67005$fc72fee0$016a10ac@NB600> Hi Paul, I was wondering about the same question some days ago and took a look at the source files. Unfortunately, I found that you can only get rid of that messages by altering and recompiling the Java code. There is a final static boolean variable called "devel" in the file "RXTXCommDriver.java" which is set to "true". This constellation causes the output after the native libraries have been loaded. No mechanism exists to suppress them otherwise :-(. Trent, does that mean that 2.1.7 is still officially a "development" version ? When will this value be changed to "false" by default ? With 2.1.8 ? It would be nice to provide a means to suppress such messages besides that static flag (maybe by setting a property called "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The output can indeed by annoying, especially when used with console applications, where the message potentially appears "in the middle" of your own output. Another possibility would be not to use System.out directly, but instead some PrintStream field which is initially set to System.out but can programatically be changed. That would allow for any kind of redirection or suppression by implementing appropriate user-defined PrintStream subclasses and making RXTX use that stream. What do you think ? Best regards, Christian ----- Original Message ----- From: "Paul Gettings" To: Sent: Thursday, May 04, 2006 10:41 PM Subject: [Rxtx] RXTX causing stdout messages > When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get > messages on stdout from the JVM: > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > As the only change was the version of RXTX (from 2.1.6), I am unsure > why the messages suddenly appeared. Anyone know how to get rid of > them? > > Thanks. > > -- > 101 USES FOR A DEAD MICROPROCESSOR > (23) Dead cat brush > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri May 5 06:09:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 06:09:46 -0600 (MDT) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <004f01c67005$fc72fee0$016a10ac@NB600> References: <20060504204122.GA6534@earth.utah.edu> <004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: On Fri, 5 May 2006, Christian Klemke wrote: > Hi Paul, > > I was wondering about the same question some days ago and took a look at the > source files. Unfortunately, I found that you can only get rid of that > messages by altering and recompiling the Java code. There is a final static > boolean variable called "devel" in the file "RXTXCommDriver.java" which is > set to "true". This constellation causes the output after the native > libraries have been loaded. No mechanism exists to suppress them otherwise > :-(. > > Trent, does that mean that 2.1.7 is still officially a "development" version > ? When will this value be changed to "false" by default ? With 2.1.8 ? It > would be nice to provide a means to suppress such messages besides that > static flag (maybe by setting a property called > "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The > output can indeed by annoying, especially when used with console > applications, where the message potentially appears "in the middle" of your > own output. Another possibility would be not to use System.out directly, but > instead some PrintStream field which is initially set to System.out but can > programatically be changed. That would allow for any kind of redirection or > suppression by implementing appropriate user-defined PrintStream subclasses > and making RXTX use that stream. What do you think ? > A patch for using properties would be accepted I'm sure. The reason the default is to display the message is not related to the development state of rxtx anymore. The problem is that people first using rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. The message prevents a great deal of email thats easily explained by the message. I question if we should support rxtx 2.0 at all anymore. If you post a patch in bugzilla, we'll put it into CVS this weekend. we'll be going through and doing such things anyhow. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri May 5 13:23:56 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 13:23:56 -0600 (MDT) Subject: [Rxtx] How to read from RxTx parallel port in Win XP In-Reply-To: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> References: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> Message-ID: On Thu, 27 Apr 2006, Worsley, Bob (Development Engineer) wrote: > I'm sorry if this is a dumb question, but I didn't find the answer in > the archives. > > I'm using the RxTx binaries for Windows on a reasonably current notebook > PC running Windows XP. I can send stuff to a printer on the parallel > port (LPT1), but I can't get anything back. > > I wrote a class that has the methods listed below. I write some data to > the printer with the "write" method and then try to read a response > using the "read" method, but I never get any data. I'd greatly > appreciate any help you can give! > > Bob Worsley > bobwoyid2 at yahoo.com > > > > > private ParallelPort parallelPort = null; > private RXTXCommDriver parallelPortDriver = null; > > > public boolean initialize() throws IOException { > if (parallelPort != null) { > return false; // Already initialized > } > > // Create the parallel port; > parallelPortDriver = new RXTXCommDriver(); > parallelPort = > (ParallelPort)parallelPortDriver.getCommPort(address, > CommPortIdentifier.PORT_PARALLEL); > > // Set the parallel port parameters. > try { > parallelPort.enableReceiveTimeout(READ_TIMEOUT); > parallelPort.disableReceiveFraming(); > parallelPort.disableReceiveThreshold(); > //parallelPort.setMode(mode); !!!!errors > } catch (UnsupportedCommOperationException e) { > throw (new IOException("Parallel port with address '" + > address > + "' cannot be configured as specified")); > } > > return true; > } > > > > public void write(final byte[] bytes) throws IOException { > initialize(); > while (busyReading) { > Thread.yield(); > } > busyWriting = true; > if (bytes.length < 1) { > return; > } > OutputStream outputStream = parallelPort.getOutputStream(); > outputStream.write(bytes); > outputStream.flush(); > outputStream.close(); > Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); > busyWriting = false; > } > > > public byte[] read() throws IOException { > > // Read up to MAX_BYTES bytes. > initialize(); > while (busyWriting) { > Thread.yield(); > } > busyReading = true; > byte[] buff = new byte[MAX_BYTES_READ]; > InputStream inputStream = parallelPort.getInputStream(); > // This read blocks until input data is available > int bytesRead = inputStream.read(buff); > inputStream.close(); > // If no data read, create empty array > if (bytesRead == -1) { > bytesRead = 0; > } > byte[] deviceBytes = new byte[bytesRead]; > System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); > if (bytesRead > 0) { > Debug.p("PPIOP.read - got data: '" + new > String(deviceBytes) + "'"); > } > busyReading = false; > return deviceBytes; > } > Hi Bob I've only used rxtx to test a hello world page printing but there are others that have used it. PPIOP? hmm what is this? :) The rxtx parallel support is behind the serial support but should be OK. As you note, the setting of modes is not supported. rxtx uses what is provided when the port is open. Are your asserting the pin for the printer being online? I suspect what often happens is people try to just use the data pins but the C API rxtx uses wants the printer to be online. There should be some posts relating to this in the rxtx mail-list archive. Some APIs are probably reading and writing from the port address (also suggested in your code as something you are looking at). RXTX currently uses a higher level C/C++ API for port access. This can still work if the API thinks the 'printer' is there. -- Trent Jarvi tjarvi at qbang.org From agrodellic at gmail.com Sat May 6 08:39:40 2006 From: agrodellic at gmail.com (Leigh Stewart) Date: Sat, 6 May 2006 10:39:40 -0400 Subject: [Rxtx] sun commapi 3 Message-ID: I think I read here: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html that rxtx-2.0 is basically fracked for now? Does anyone know of a workaround? ie can i somehow get an older version of sun's comm api and use that (not easy to find)? i mean 2.0 must be working for someone...how is it being tested. 2.1 isnt working for me....im getting nasty native exceptions etc, which is why im so set on 2.0... any ideas? From tjarvi at qbang.org Sun May 7 15:40:27 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 7 May 2006 15:40:27 -0600 (MDT) Subject: [Rxtx] sun commapi 3 In-Reply-To: References: Message-ID: On Sat, 6 May 2006, Leigh Stewart wrote: > > 2.1 isnt working for me....im getting nasty native exceptions etc, > which is why im so set on 2.0... any ideas? > Hi Leigh What native exceptions are you seeing? Which OS? The native code is almost identical between rxtx 2.0 and 2.1. Only the names have been changed to protect the inocent. :) ie: javax_comm_... vs gnu_io_... So the odds are very likely that even if you do find commapi 2.0 and get it installed, you will run into the same error. It would be better to just find and fix the problem. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Mon May 8 10:47:20 2006 From: mail at willicon.de (WILLICon) Date: Mon, 08 May 2006 18:47:20 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 Message-ID: <445F7618.3070303@willicon.de> Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/ef37e8ec/attachment-0005.html From tjarvi at qbang.org Mon May 8 16:14:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 May 2006 16:14:51 -0600 (MDT) Subject: [Rxtx] Screenshot of Application using RXTX (fwd) Message-ID: Just though someone may end up searching for 0x0D and 0x0A. Here are the details from his system. SuSE Linux 10.0 (x86_64) Kernel 2.6.13-15.8 j2se 1.4.2_11 (i586) Sun: comm3.0_u1 rxtx: rxtx-2.1-7 ---------- Forwarded message ---------- Date: Sat, 6 May 2006 20:01:46 +0200 From: Michael Poppitz To: taj at www.linux.org.uk Subject: Screenshot of Application using RXTX Hi Trent, the rxtx package works like a charm. Sun's package seemed to replace all 0x0D with 0x0A in received data on my Linux box, which is really annoying when transfering binary data. But rxtx came and saved the day - and turned out to be a lot more convenient as it does not require a configuration file. I use it for connecting to a home made logic analyzer. (http://www.sump.org/projects/analyzer/) Thanks for your great job, Michael -------------- next part -------------- A non-text attachment was scrubbed... Name: la_client.png Type: image/png Size: 16592 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/45494fbb/la_client-0005.png From tjarvi at qbang.org Tue May 9 14:56:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 May 2006 14:56:05 -0600 (MDT) Subject: [Rxtx] RXTX javax.comm: which one to install? In-Reply-To: <20060509161742.43547.qmail@web53814.mail.yahoo.com> References: <20060509161742.43547.qmail@web53814.mail.yahoo.com> Message-ID: On Tue, 9 May 2006, Adenilson Cavalcanti wrote: > Dear Trent Jarvi > > I'm trying to write a small Java app running in linux that interfaces with a device connected to serial port. > > I do have some questions about RXTX and javax.comm state of affairs, since I'm new to Java programming (used to program in plain old C writting to devices using termios and open/write/read syscalls, but this is another story). > > I ask you the favor to clarify this issues (if possible...): > > a) Sun offers to download a file (comm3.0_u1_PUTAUNIXVERSION.zip) which does contain .so files. Does it work out of box? > > b) Case negative, its there that we should use 'librxtx*.so' provided by your site? > > c) Sun's comm3 API version does work with which version of rxtx? > > I already searched google and read documentation available in rxtx site ("Java Comm Serial API How-to") but still have this issues unsolved. Any help will be appreciated. > > Best regards > > Adenilson Hi Adenilson, RXTX does not currently support javax.comm in Sun's CommAPI 3.0. I would recommend using package gnu.io provided by rxtx 2.1. -- Trent Jarvi tjarvi at qbang.org From chris.develder at intec.ugent.be Wed May 10 08:45:40 2006 From: chris.develder at intec.ugent.be (Chris Develder) Date: Wed, 10 May 2006 16:45:40 +0200 Subject: [Rxtx] rxtx troubles on ARM Message-ID: <4461FC94.6040909@intec.ugent.be> Hi all, Sorry to bother you, but I don't seem to get RXTX working on an ARM processor (xscale ixp 425, big endian). I managed to crosscompile the rxtx libs and moved it over to the ARM. Using jamvm (which is the only open source java VM we got working on the ARM), I get the following error result when running SimpleRead from Sun's javax.comm examples (commapi\examples\Simple\SimpleRead) -- see bottom of mail for complete output: "java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver" However, output shows that the RXTXCommDriver code is accessible (cf. debug and devel output of lib versions). So it doesn't seem to be a missing lib/jar issue. The error happens before RXTXCommDriver.initialize() is called, since the first line there is System.out.println("RXTXCommDriver:initialize()"); Any ideas? Cheers, Chris ---------------------------- [root at xxx(ttyp1) /work/cdvelder/xscale/test]# jamvm -Djava.library.path=/work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/jre/lib/arm -classpath /work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/lib/ext/RXTXcomm.jar:./comm.jar:. SimpleRead RXTXCommDriver {} Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTXCommDriver: Jar version = RXTX-2.1-7 native lib Version = RXTX-2.1-7 java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver gnu/io/RXTXCommDriver at javax.comm.CommPortIdentifier.loadDriver (CommPortIdentifier.java:239) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:109) at SimpleRead.main (Unknown Source) java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive (Native Method) at com.sun.comm.Portmapping.registerCommPorts (Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase (Portmapping.java:100) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:138) at SimpleRead.main (Unknown Source) From joachim at buechse.de Fri May 12 00:44:48 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 08:44:48 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) Message-ID: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Good day, I guess that only a selected few (hi Trent) will be able to answer this question, but the answer might be interesting for anyone trying to debug or understand the code. Apparently the MonitorThread is started and stopped in RXTXPort.addEventListener and RXTXPort.removeEventListener. This would indicate that (originally?) the MonitorThread is only required when there is an EventListener. However the MonitorThread is also started in the RXTXPort constructor, which could mean that RXTX won't work at all if it isn't there. It seems to me, that if anyone would add an event listener and later on remove it, he could potentially wreak the port. Because the second action would kill the MonitorThread. For the moment I am only trying to understand the role of and idea behind the MonitorThread. But of course there is a deeper reason thor my question: If the MonitorThread needs to exist anyway, it could be the thread that cleans up the port (ie calls nativeClose) - this would eliminate (a further) problem I am seeing with some USB drivers on Mac OSX. (Close blocks (after releasing the tty, but still) in the USB driver if the device is "not responding"). Greetings, Joachim From tjarvi at qbang.org Fri May 12 07:10:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 12 May 2006 07:10:59 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Fri, 12 May 2006, Joachim Buechse wrote: > Good day, > > I guess that only a selected few (hi Trent) will be able to answer > this question, but the answer might be interesting for anyone trying > to debug or understand the code. > > Apparently the MonitorThread is started and stopped in > RXTXPort.addEventListener and RXTXPort.removeEventListener. This > would indicate that (originally?) the MonitorThread is only required > when there is an EventListener. However the MonitorThread is also > started in the RXTXPort constructor, which could mean that RXTX won't > work at all if it isn't there. > > It seems to me, that if anyone would add an event listener and later > on remove it, he could potentially wreak the port. Because the second > action would kill the MonitorThread. > > > For the moment I am only trying to understand the role of and idea > behind the MonitorThread. But of course there is a deeper reason thor > my question: > > If the MonitorThread needs to exist anyway, it could be the thread > that cleans up the port (ie calls nativeClose) - this would eliminate > (a further) problem I am seeing with some USB drivers on Mac OSX. > (Close blocks (after releasing the tty, but still) in the USB driver > if the device is "not responding"). > Hi Jaochim Before commapi, rxtx did not support events. You could read, write and change port settings. The MonitorThread was added as an afterthought to support commapi events. So the way things are now his historical spaghetti not a well devised plan. It is my opinion that the MonitorThread should exist as long as the port is open. The odd starting of the thread in the constructor and addEventListener was just to get past the obvious problem of people using the port without adding listeners. -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Fri May 12 07:59:50 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 15:59:50 +0200 Subject: [Rxtx] MonitorThread -> ChangeRequest In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: <2B1E508C-8CEE-4AB7-914D-E7BA25C871A2@buechse.de> In this case I suggest removing the starting/stopping of MonitorThread in addEventListener / removeEventListener. This should not affect existing projects. On 12.05.2006, at 15:10, Trent Jarvi wrote: > It is my opinion that the MonitorThread should exist as long as the > port > is open. The odd starting of the thread in the constructor and > addEventListener was just to get past the obvious problem of people > using > the port without adding listeners. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Fri May 12 11:43:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 19:43:21 +0200 Subject: [Rxtx] Spring Cleaning - some suggestions Message-ID: The current implementation of RXTX contains quite a lot of code that will break if it is used from several threads (especially on a multi processor machine). I think it would be nice to clean this up. I suggest the following changes (which keep the current semantics and should not influence existing projects in a negative way): - InterruptedException will never be ignored or reset - read methods will be protected with a Monitor - write methods will be protected with a (separate) Monitor - close() sets the read and write monitors into a "closed" state which will lead to IOExceptions for any following call to RXTXPort.read/write. - close() will wait a finite amount of time (maybe 500ms) for the release of the read and write monitors after that, it will trigger the closing of the file descriptor to abort any pending read or write. - close() will not call close(file_desc). Instead it will "interrupt" (ie set a flag and then, pthread_kill(ABRT)) the MonitorThread, the MonitorThread will call close(file_desc). - the monitors are properly released in a finally block the try of which starts directly after obtaining the monitor. - finally will not call close(file_desc) it will only "interrupt" the MonitorThread (see above) - the native-code (esp read) does not use SA_RESTART but checks Thread.interrupted() when it receives a SIGNAL (ie system call returns with EINTR or other signalling method). The read/write monitors will be allocated from a factory whose mode can be set to fast/normal/advanced. In fast-mode it will create "non thread safe, non synchronized" pseudo-monitors. In default mode, the monitors will store the owning thread. In "advanced" mode setting the monitors into closed state will "interrupt()" threads which are blocked in a native read/write. {Reasoning close behaviour: Calling close on a file descriptor in Windows unblocks any read() or write() on the same file descriptor with an error. On Solaris < 2.7 and MacOS X however the close() will/ can block - until the read or write have finished:-(( Even the JDK people have trouble with this. I dont know how Linux reacts in this case. The best practice for BSD/Solaris is to send a signal to the thread which will usually unblock the read/write with an EINTR - this however is not guarenteed as it also depends on the device driver. So the only resolution that will certainly not block the thread calling RXTXPort.close() (which will often enough be the AWT event dispatcher or the VM finalizer thread) is to call close(fd) from another thread.} {Reasoning read behaviour: It is rather uncommon to receive a signal while reading or writing - it will happen, but checking Thread.interrupted() when it happens will not degrade performance. The checking of Thread.interrupted() can be handled by returning to Java and potententially reentering into the native code if the thread was not interrupted or by calling back into the VM from the native code. On top of this, many functions like read(byte[]) or read(byte [], int, int) are allowed to return less than the requested amount of data. Only int read() is a bit more tricky. } [Trent: From the code I can tell, that you experimented quite a bit with signals. Do you know if the Java Thread.interrupt() triggers a unix signal on Linux/Solaris? If so, which one?? References: - http://java.sun.com/docs/hotspot/VMOptions.html - http://www.hp.com/products1/unix/java/infolibrary/prog_guide/ signals.html ] On OS X (hotspot client jdk-1.4.2) I did not see any signal propagated to the SELECT of the event_loop/MonitorThread (ie no EINTR) when I call monThread.interrupt(). This is a pitty, but thats the way it is. I simply assume this is true for most system calls. How to handle this? Of course it would be possible to install/ deinstall a specific signal handler before/after every native read and to natively send an ABRT signal if RXTXPort.close is called. A more elegant solution might be to have an additional "signaling" socket which is always included in the SELECT. Or the simplest solution: cap the timeout of the select to 500 ms (the loop around it exists already) after every timeout check the Thread.interrupted() flag. From a performance perspective this should be completely invisible... On the other hand, all write() calls need to be preceeded by a SELECT as well, to avoid running into a blocking write. Best regards, Joachim From lyon at docjava.com Sat May 13 05:54:52 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 13 May 2006 07:54:52 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Dmitry suggests that we acquire an implementation of a serial port reference, use it, then release it (i.e., check it back in). Joachim says that making serial ports thread friendly might be a good idea. This is a good idea. The design pattern that is close to this idea is the "Object Pool Design Pattern". # Object Pool Manage the reuse of objects for a type of object that is expensive to create or only a limited number of a kind of object can be created. It has been described at: http://www.developer.com/java/ent/article.php/626171 and in Marks' book, Patterns in Java, Volume 1. However, the Object Pool is intended to pool objects so that each object is just like every other object. The intent of the Parametric Singleton is to enable others to access the same resource at the same time (as long as the same parameters were used in construction). It sounds like we need a NEW Design Pattern (Oh no, Doug is doing it again!). Yes friends, you got me on a role (roll) :) If you like design patterns, you can thank me later. If you don't like design patterns, blame Dmitry, it was his idea ;) And Dave, thanks for the feedback on Singleton abuse. It has led me to change the way I think about application contexts, which we will see, below. We need (drum roll please): The Parametric Object Pool Design Pattern (POP) By Douglas A. Lyon ABSTRACT The goal of the Parametric Singleton design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values, in a given context. In comparison, the goal of the POP design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values and that only one reference to the class is checked out at a time, in a given context. A context is a namespace for holding identifiers during execution. In Java, A context can be changed in any of several ways. For example, creation of a new class loader, the deserialization of an old POP or the creation of a new process all create a new namespace. The POP Design Pattern combines the Parametric Singleton Design Pattern with the check out mechanism of the Object Pool Design Pattern. This enables unique creation of instances of a class. These instances are cached in a table. When a clients asks for an instance with these parameters, the cache is checked. If the instance is not in the cache it is created. If the instance is available, the clients checks out the instance. A reference is left to the clients that checked out the instance. The POP has the role of creating objects uniquely, from parameters. It also has the role of keeping track of which clients has checked out a given object. This is just like a library keeping track of who borrowed a book. If a resource is left unavailable in a system, a deadlock can occur. Deadlock debugging is facilitated by mapping a resource to the clients that have checked it out. We apply our POP Design Pattern to the retrieval of serial ports. The goal of our system is to make sure that serial ports are checked out to only one client at a time, and that they be checked back in when the client is done. The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. Users are discouraged from calling this the Parametric Object Oriented Pool (POOP). Introduction The intent of the POP Design Pattern is to ensure that a class has only one instance for a given set of parameter values. It also provides a point of access that is global to a given context. The POP uses the Singleton Design Pattern to ensure that there is only one POP, in the given context. The POP DP is responsible for checking out a reference to a given instance, and keeping track of that instance. The instance is responsible for sharing that instance. POP requires that users of the DP implement an interface that enables a recall facility. Thus, if there is a contention for a consumed resource, the deadlock can be resolved in an orderly fashion. Motivation A system cannot tolerate multiple instances of some classes with identical parameters used by different instances at the same time. For example, you cannot have two instances use the same serial port, at the same time. You cannot have two instances that are trying to listen to the same socket connection. You cannot have two instances writing to the same file structure at the same time. Further, once a serial port is checked out by a client, it is assigned to the client. This is like the spin-lock service provided by the operating system, only in the application layer. Naturally, deadlock will occur if a resource is not released, therefore the client of the resource is tracked. Recalling a resource is required for the POP DP by virtue of the implementation of an interface. The policy on how to break a deadlock (by honoring the recall) is application specific. As the operating system is often thought of as the arbiter of consumed resources (i.e., tape drives, serial ports, etc.) we frequently leave it to an operating system implementation to resolve these contention issues. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on naming conventions (which are not well standardized). The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. The POP Design Pattern can take on the role of the peer method mapper that homogenizes the API for different operating environments. That is, it can wrapper the different locking mechanisms used in different operating systems. POP that is responsible for keeping track of the instances created and the client that has checked them out. The POP Design Pattern is implemented using the Singleton Design Pattern. In Java, the POP implementation is declared final, so that it cannot be subclassed. The class also has a private constructor, so that other classes cannot instance it. The new design pattern is called the POP design pattern and it provides a way to check out and create instances with given parameters. Applicability Use the POP Design Pattern when: 1. There must be exactly one instance of a class with the given parameters in a given context. 2. The instances must be accessible to clients from a well-known access point. 3. The instances are reusable. 4. Only one client can check out an instance at a time. Structure Insert UML diagram here. Participants The POP Clients that need instances 1. The POP defines an instance upon request from a client, if, and only if, the instance does not already exist. 2. The POP returns the instance to the client. 3. The POP is responsible for creating unique instances from given parameters. 4. The POP is responsible to recalling instances from clients. Collaborations Clients obtain a reference to a POP instance only through the singleton design pattern. If the POP instance is left in an improper state (e.g., the serial port was left open) it is NOT the role of the POP to close the IO port. However, the POP can be requested to get the instance released. Nor is it the role of the POP Design Pattern to open the port. That role is delegate to some other part of the system. Further, it is the role of the POP Design Pattern to check out resources. However, it is still possible to have, multiple threads that have multiple references to the same resource at the same time. Checkout and resource requests are MUTEX locked (i.e., synchronized). Consequences The POP Design Pattern has several benefits: 1. Controlled access to parametrically defined instances. Since the POP encapsulates its instances, there is some limited control over how and when clients access it. 2. Reduced name space. The POP pattern avoids global variables that store instances created from the same parameter. Implementation Here are implementation issues to consider when using the POP pattern: 1. Unique mapping of parameters. The POP pattern requires that there be a mean to isomorphically map the parameter space into the instance space and back again. 2. Ensure unique instances. The POP pattern makes unique instances from parameters, and it does so only once. 3. Cache instances for fast retrieval. The POP must be able to look up instances, given some set of parameters, and do so from some data structure. That is, there must be enough space to hold references to all the instances the program will need. Also, a mechanism is needed to look up and retrieve the instances quickly enough to satisfy the clients. Sample Code To be written....any volunteers? Thanks! - Doug >I don't think I get it > >On Mar 22, 2006, at 9:36 AM, David Garnier wrote: >>Using the singleton pattern in this case is >>just convenient for the programmer. Problems >>arises >>pretty quickly, especially if you attempt to unit-test your classes. > > >so you're saying that something isn't so good >because you can not test it in the convenient >way? >if that's true, I'm totally disagree >change your test, debug whatever, but if >software is efficient at runtime, works fine and >only problem is some unit test >(which is some kind of framework for testing) >then dump that unit test , dump that unit >framework and make something appropriate to the >software >you're testing > >so if Douglas want to use singletons, what's the problem? >and what do you mean by abusing of singleton usage? > >of course singleton doesn't prevent concurrent >access to the resource across the processes >unless >you're using some OS facility to prevent it, besides >singleton as it was introduced is relevant only >and only inside of the same process >otherwise it's not singleton it's something else >(let's say network singleton: so you have remote >invocation facility >and some factory method that return object created by that facility) > >I don't have any problem with using any kind of singletons. > Parametric Singleton idea (if I understand it >right) could be easily implemented in the >following way: >use a map >populate map with instances of some class and key is your parameter >(you can use lazy population too) > >if somebody ask the key check the value if it's null so resource is taken >if somebody returns the resource put it back to the map > >public synchronized static Object getSomeResource(Object parameter); >public synchronized static void returnResource(Object parameter); > >getSomeResource (inside of the same process) could return null in 2 cases >1. if somebody (from other thread for example) already took that resource >2. if OS API said that resource corresponded to >that parameter (serial port with parameter = 1 >(port #)) >is locked and unavailable; >I'm not sure that in case of serial ports we >even need those Parametric Singletons >(unless lock checking is a very expensive operation) >just ask the OS about availability of that >resource and if it's available give it away >and then OS will lock it and therefore in next >time somebody ask it just answer that resource >is locked >and return null > >for example system has 2 serial ports available >so I ask getResource("tty"); >or I ask getResource("Bluetooth-Modem"); > >and if OS is ok you can give tty or Bluetooth-Modem or both > >no need for any additional pattern I think > >back to the problem >mac os x doesn't recognize locking via files, so >it handles locking via some API >an instance of the singleton in each process >should recognize that resource is locked >(by using that API) that's all >we don't have to make things more complicate >then they are just because there is some nice >design pattern or nice unit test framework or whatever >keep things simple, make them work fast, don't introduce middle layers >unless you have really good reason to do so > >of course I could be entirely wrong, so sorry about that in advance > >thanks > > >Dmitry Markman > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx >Good day, > >I guess that only a selected few (hi Trent) will be able to answer? >this question, but the answer might be interesting for anyone trying? >to debug or understand the code. > >Apparently the MonitorThread is started and stopped in? >RXTXPort.addEventListener and RXTXPort.removeEventListener. This? >would indicate that (originally?) the MonitorThread is only required? >when there is an EventListener. However the MonitorThread is also? >started in the RXTXPort constructor, which could mean that RXTX won't? >work at all if it isn't there. > >It seems to me, that if anyone would add an event listener and later? >on remove it, he could potentially wreak the port. Because the second? >action would kill the MonitorThread. > > >For the moment I am only trying to understand the role of and idea? >behind the MonitorThread. But of course there is a deeper reason thor? >my question: > >If the MonitorThread needs to exist anyway, it could be the thread? >that cleans up the port (ie calls nativeClose) - this would eliminate? >(a further) problem I am seeing with some USB drivers on Mac OSX.? >(Close blocks (after releasing the tty, but still) in the USB driver? >if the device is "not responding"). > >Greetings, >Joachim > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Sat May 13 10:07:37 2006 From: joachim at buechse.de (Joachim Buechse) Date: Sat, 13 May 2006 18:07:37 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Douglas, Looking at the current code, leaves me with the feeling, that there is a lot to do. Defining an API that wraps javax.comm to provide what you describe is certainly possible, but I wonder how much benefit it will actually provide. Personally I think the API defined by javax.comm "request/lock" a port with: cp= new CommunicationPort(identifier) "release" a port with: cp.close(); works quite nice for 99% of the applications. In my experience, the most efficient and elegant implementation is to wrap a port/socket/.. into a business object which declares the remote operations that are possible. Ie "uploadFile", "waitForPrompt", "getSerialNumber", "sendContact", "executeCommand", etc Those methods are then either synchronized or guarded by a monitor. I do not see how your design pattern applied to the port resource would help implementing this. [details start, skip if you agree to the above] When I talked about "thread-safe" I didn't mean several independent "sessions" accessing the port concurrently. I think this is a very rare usage. I believe the most common use case for serial ports today is the control of an external device from a PC running a GUI based application. To implement a clean Swing/AWT-GUI one needs to pass any action that can block to a "worker" thread (else the GUI blocks, the application appears dead). While it is possible to use own prespawned thread that will accept Runnables which operate on the port, this is not very elegant. It is more common to spawn a new thread for every action triggered by the user. Additionally the ABORT of a running operation is often implemented via a port.close() delegated to a different thread. - During the lifetime of a port, it will usually be accessed from several different threads. Instance variables need to be set/read in synchronized regions to guarantee a correct operation based on the Java memory model. - Synchronizing the access is usually handled on the application level (synchronizing the reads/writes is usually useless from the applications view because it is not a transaction mechanism). [details end] I am very open to learn about other scenarios where your proposed design pattern applied to the port resource is beneficial to the application implementor. Best regards, Joachim On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > Dmitry suggests that we acquire an implementation of > a serial port reference, use it, then release it (i.e., check it > back in). > > Joachim says that making serial ports thread friendly might be a > good idea. > > This is a good idea. The design pattern that is close to this idea > is the "Object Pool Design Pattern". > # Object Pool From jredman at ergotech.com Sun May 14 14:28:24 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 14:28:24 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers Message-ID: <446792E8.4000506@ergotech.com> Does anyone know of any work to make RXTX work with Ethernet (telent) Terminal Servers? If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? We've used RXTX with upwards of 100 virtual COM ports on Windows and it works well. Linux is more problematic. It would be good to have an OS independent solution to accesses remote Ethernet serial ports. Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From legolas.w at gmail.com Sun May 14 14:26:34 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:56:34 +0430 Subject: [Rxtx] does any one have a working sample of RXTX and LPT port Message-ID: <4467927A.4000008@gmail.com> Hi Thank you for reading my post does any one has a working sample for RXTX and LPT port ? Thanks From legolas.w at gmail.com Sun May 14 14:27:29 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:57:29 +0430 Subject: [Rxtx] does RXTX support Trigerr on parallel port? Message-ID: <446792B1.4040905@gmail.com> Hi does RXTX support trigger on LPT port ? if so , how i can use it ? Thanks From tjarvi at qbang.org Sun May 14 17:40:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 17:40:59 -0600 (MDT) Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: <446792E8.4000506@ergotech.com> References: <446792E8.4000506@ergotech.com> Message-ID: On Sun, 14 May 2006, Jim Redman wrote: > Does anyone know of any work to make RXTX work with Ethernet (telent) > Terminal Servers? > > If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 > Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? > Hi Jim It appears the author of NVTCom has decided to release the library into the public domain. Integration with rxtx is possible but it would be best to contact the author and find out what his intent is. I would suggest contacting the author with a proposal of what you would like to do and take it from there. We could 'take' public domain software but its better to show respect to the authors and respect their wishes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:10:23 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:10:23 -0600 (MDT) Subject: [Rxtx] does any one have a working sample of RXTX and LPT port In-Reply-To: <4467927A.4000008@gmail.com> References: <4467927A.4000008@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > Thank you for reading my post > does any one has a working sample for RXTX and LPT port ? > Thanks Hi Legolas LPT port support in rxtx is spotty. That means some people have sent in patches for what they do and it works well for them. The original code was not very good. It may have been 3 hours work :/ To get started, Sun has some demo programs with their commapi. With rxtx 2.1 you can change their code from using javax.com to gnu.io and it -should- work. But if it does not you can post here and on bugzilla. There has been more interest lately off the list and maybe there will be enough community resources to get what you need going. If you do get a sample program together, we would gladly put it in the contrib directory so the next person can get things going faster. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:12:12 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:12:12 -0600 (MDT) Subject: [Rxtx] does RXTX support Trigerr on parallel port? In-Reply-To: <446792B1.4040905@gmail.com> References: <446792B1.4040905@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > does RXTX support trigger on LPT port ? > if so , how i can use it ? > Hi Legolas As mentioned in the previous post, rxtx parallel support is not very mature. But if you can point to something that describes the trigger feature, we can probably make sure its there and give a quick code example. -- Trent Jarvi tjarvi at qbang.org From jredman at ergotech.com Sun May 14 22:22:48 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 22:22:48 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: References: <446792E8.4000506@ergotech.com> Message-ID: <44680218.4080008@ergotech.com> Trent, Trent Jarvi wrote: > On Sun, 14 May 2006, Jim Redman wrote: > >> Does anyone know of any work to make RXTX work with Ethernet (telent) >> Terminal Servers? >> >> If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 >> Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? >> > > Hi Jim > > It appears the author of NVTCom has decided to release the library into > the public domain. Integration with rxtx is possible but it would be best > to contact the author and find out what his intent is. > > I would suggest contacting the author with a proposal of what you would > like to do and take it from there. We could 'take' public domain software > but its better to show respect to the authors and respect their wishes. > I sent Marco(?), the author of the library, a note before asking the list - I'll let you know the response. If anyone is already working on it, or has an interest and more time and energy than me, I'd hate to duplicate the efforts. If no one is, and no one objects, maybe I'll see what I can do. Jim > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From Christian.Klemke at t-online.de Mon May 15 02:23:06 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Mon, 15 May 2006 10:23:06 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu><004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: <008a01c677f8$cae18590$02fea8c0@NB600> Hi Trent, Hi Paul, I finally found some time to create a simple patch to enable the optional suppression of version output to the console. It is based on a new system property called "gnu.io.rxtx.NoVersionOutput" which can by set to "true" if necessary. I had some problems accessing CVS, therefore I downloaded the rxtx-2.1-7r2 source archive from ftp.qbang.org (which is linked on the rxtx.org download page) and worked with that release. Please find my proposed patch in the attachment ! Regards, Christian ----- Original Message ----- From: "Trent Jarvi" To: "RXTX Developers and Users" Cc: ""Paul Gettings"" Sent: Friday, May 05, 2006 2:09 PM Subject: Re: [Rxtx] RXTX causing stdout messages > On Fri, 5 May 2006, Christian Klemke wrote: > >> Hi Paul, >> >> I was wondering about the same question some days ago and took a look at >> the >> source files. Unfortunately, I found that you can only get rid of that >> messages by altering and recompiling the Java code. There is a final >> static >> boolean variable called "devel" in the file "RXTXCommDriver.java" which >> is >> set to "true". This constellation causes the output after the native >> libraries have been loaded. No mechanism exists to suppress them >> otherwise >> :-(. >> >> Trent, does that mean that 2.1.7 is still officially a "development" >> version >> ? When will this value be changed to "false" by default ? With 2.1.8 ? It >> would be nice to provide a means to suppress such messages besides that >> static flag (maybe by setting a property called >> "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The >> output can indeed by annoying, especially when used with console >> applications, where the message potentially appears "in the middle" of >> your >> own output. Another possibility would be not to use System.out directly, >> but >> instead some PrintStream field which is initially set to System.out but >> can >> programatically be changed. That would allow for any kind of redirection >> or >> suppression by implementing appropriate user-defined PrintStream >> subclasses >> and making RXTX use that stream. What do you think ? >> > > A patch for using properties would be accepted I'm sure. > > The reason the default is to display the message is not related to the > development state of rxtx anymore. The problem is that people first using > rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. > The message prevents a great deal of email thats easily explained by the > message. > > I question if we should support rxtx 2.0 at all anymore. > > If you post a patch in bugzilla, we'll put it into CVS this weekend. > we'll be going through and doing such things anyhow. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_version_output_patch.diff Type: application/octet-stream Size: 991 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060515/3173c2b6/rxtx_version_output_patch-0005.obj From lyon at docjava.com Mon May 15 06:06:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 May 2006 08:06:21 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Joachim makes several good points. Let me see if I can address some of them below: >Hello Douglas, > >Looking at the current code, leaves me with the feeling, that there? >is a lot to do. Yes! >Defining an API that wraps javax.comm to provide what? >you describe is certainly possible, but I wonder how much benefit it? >will actually provide. > >Personally I think the API defined by javax.comm > >"request/lock" a port with: > cp= new CommunicationPort(identifier) >"release" a port with: > cp.close(); > >works quite nice for 99% of the applications. I don't know what percentage of applications turn off locking, the way that I do in my version of the RXTX lib. I do know that this is not safe practice. I also know that it was motivated by the multi-platform nature of my code and that this was the only way I could make things work, at the time. Java does not appear to have a cross-platform standard for locking resources on various platforms. Each OS appears to have its own standard. The question of who breaks deadlocks and how this is done remains open, as this is not an easy question to resolve. Let me continue, below: > >In my experience, the most efficient and elegant implementation is to? >wrap a port/socket/.. into a business object which declares the? >remote operations that are possible. Ie "uploadFile",? >"waitForPrompt", "getSerialNumber", "sendContact", "executeCommand",? >etc Those methods are then either synchronized or guarded by a? >monitor. I do not see how your design pattern applied to the port? >resource would help implementing this. I have no problem with high-level wrappers that are application specific. That is a very good idea, but orthogonal with respect to the issue of deadlocks. More below: > >[details start, skip if you agree to the above] >When I talked about "thread-safe" I didn't mean several independent? >"sessions" accessing the port concurrently. I think this is a very? >rare usage. That is probably why turning locking off works so well! On the other hand, it is not safe and I shouldn't do it. >I believe the most common use case for serial ports today? >is the control of an external device from a PC running a GUI based? >application. To implement a clean Swing/AWT-GUI one needs to pass any? >action that can block to a "worker" thread (else the GUI blocks, the? >application appears dead). While it is possible to use own prespawned? >thread that will accept Runnables which operate on the port, this is? >not very elegant. It is more common to spawn a new thread for every? >action triggered by the user. Additionally the ABORT of a running? >operation is often implemented via a port.close() delegated to a? >different thread. Here lies the heart of serial port concern. An application opens a serial port and then dies. The application is restarted and finds the port locked. How do we clear the lock? Must the application's user reside in the UUCP group? Must installers of the serial port add users to the UUCP group? Should locking be handled at a high-level of abstraction in an operating system independent way? Should the implementation of the locking mechanism be translated into an API that is dependent on the OS convention? Suppose that we restrict the discussion to serial ports. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on inconsistent naming conventions. Hence my feeling that we need to mirror what is done in other API's; we need a locking toolkit that references peer methods, IMHO. >From the Java programming point of view, the locking API is portable across different platforms, but has, as its implementation, a native peer method that uses the conventions of the underlying OS. This enables portable resource locking (in theory!). Consider, for example: org.apache.commons.transaction.locking with: Interface LockManager at: http://jakarta.apache.org/commons/transaction/apidocs/org/apache/commons/transaction/locking/LockManager.html Or, more recently: java.util.concurrent.locks Interface Lock based on Doug Lea's code: http://kickjava.com/src/EDU/oswego/cs/dl/util/concurrent/ReadWriteLock.java.htm Should we incorporate a clean, portable design into serial port use, one that is consistent with current locking APIs? Basically, a comm port is a resource and resources are typically controlled by managers. Thus, I suggest that we make use of a CommPortManager to help control and centralize serial port usage. The question of how this is done remains open, IMHO, but using core API's like: java.util.concurrent.locks might not be amiss. High-level methods (getAllPorts, getAllSerialPorts, getAllParallelPorts, etc...) might be welcome additions. Basic questions like, "what if a port is in use?" remain open, hence my proposal for the new design pattern. Isn't it the CommPortManager's role to break the deadlock? Cheers! - Doug > >- During the lifetime of a port, it will usually be accessed from? >several different threads. Instance variables need to be set/read in? >synchronized regions to guarantee a correct operation based on the? >Java memory model. >- Synchronizing the access is usually handled on the application? >level (synchronizing the reads/writes is usually useless from the? >applications view because it is not a transaction mechanism). >[details end] > >I am very open to learn about other scenarios where your proposed? >design pattern applied to the port resource is beneficial to the? >application implementor. > >Best regards, >Joachim > >On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > >> Dmitry suggests that we acquire an implementation of >> a serial port reference, use it, then release it (i.e., check it? >> back in). >> > > Joachim says that making serial ports thread friendly might be a? >> good idea. >> >> This is a good idea. The design pattern that is close to this idea >> is the "Object Pool Design Pattern". >> # Object Pool > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Mon May 15 06:58:19 2006 From: joachim at buechse.de (Joachim Buechse) Date: Mon, 15 May 2006 14:58:19 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Doug, I agree fully, that locking of the system resource should be abstracted from the user (programmer). Currently this is already the case, but I agree it might be nice to extract the code into a separate class, which uses platform dependent providers to do its job. What I described in my email was not targeted at allocating the system resource, but at handling an already allocated system resource inside the framework. I agree that it may be possible to combine the two - however, I would suggest to do this in phase2. I can contribute a work over of RXTXPort.java which implements clean internal locking and proper close behavior (which I would call phase 1). I could do this this week. However I strongly believe that there is little sense in trying to do this as a series of patches. It will be closer to a rewrite than to a patch. I have already provided a number of suggested patches via Bugzilla, but this is quite inconvenient (for me). My working copy diverges more and more from the master and hence it gets more and more annoying to provide self contained patches. Best regards, Joachim From tjarvi at qbang.org Mon May 15 08:27:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 May 2006 08:27:51 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Mon, 15 May 2006, Joachim Buechse wrote: > Hello Doug, > > I agree fully, that locking of the system resource should be > abstracted from the user (programmer). Currently this is already the > case, but I agree it might be nice to extract the code into a > separate class, which uses platform dependent providers to do its job. > > What I described in my email was not targeted at allocating the > system resource, but at handling an already allocated system resource > inside the framework. I agree that it may be possible to combine the > two - however, I would suggest to do this in phase2. > > I can contribute a work over of RXTXPort.java which implements clean > internal locking and proper close behavior (which I would call phase > 1). I could do this this week. > > However I strongly believe that there is little sense in trying to do > this as a series of patches. It will be closer to a rewrite than to a > patch. I have already provided a number of suggested patches via > Bugzilla, but this is quite inconvenient (for me). My working copy > diverges more and more from the master and hence it gets more and > more annoying to provide self contained patches. > For methodical testing purposes (which does go on) the incremental patches are better. I'm lagging behind in bugzilla but thats soon to change (this week). It has just been rather chaotic up until now. I moved, purchased a house, and jumped into the fire of a feature freeze timeframe at a new job. btw, we see the Solaris close issues on 2.8 also. 9 and 10 are fine. I'll work towards making those test results public and allow others to run new rxtx code through them. We had the OK at one point but setting up the environment is involved. It isn't just a collection of java classes. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Tue May 16 02:01:47 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:01:47 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] Message-ID: <446986EB.209@willicon.de> Hi, any ideas for my problem? Hans -------- Original-Nachricht -------- Betreff: [Rxtx] Problem under Mac OSX 10.3.9 Datum: Mon, 08 May 2006 18:47:20 +0200 Von: WILLICon Antwort an: RXTX Developers and Users An: RXTX Developers and Users Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/b0741c2b/attachment-0005.html From joachim at buechse.de Tue May 16 02:15:08 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 10:15:08 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: Hello Hans, I am using RXTX on OS X for my own project. I do not see the problem you describe. I had some troubles installing it because the current version uses lock files which is non-standard on OS X. I have created a patched version which I currently use. This version does not need to modify user groups and hence does not need an installer. I just pop it in the application directory. If you send me a link where I can download your OSX installer, I will have a quick look. Regards, Joachim On 16.05.2006, at 10:01, WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we > have some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + > spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + > spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always > the value "false". > I can only get the status, while I open the port and catch the > exception. > > Any ideas? > > Hans > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail at willicon.de Tue May 16 02:26:53 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:26:53 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: References: <446986EB.209@willicon.de> Message-ID: <44698CCD.7050709@willicon.de> Joachim, tanks for the answer. I'll send You a mail. Hans Joachim Buechse schrieb: > Hello Hans, > > I am using RXTX on OS X for my own project. I do not see the problem > you describe. > > I had some troubles installing it because the current version uses > lock files which is non-standard on OS X. I have created a patched > version which I currently use. This version does not need to modify > user groups and hence does not need an installer. I just pop it in > the application directory. If you send me a link where I can download > your OSX installer, I will have a quick look. > > Regards, > Joachim > > On 16.05.2006, at 10:01, WILLICon wrote: > > >> Hi, >> >> any ideas for my problem? >> >> Hans >> >> -------- Original-Nachricht -------- >> Betreff: [Rxtx] Problem under Mac OSX 10.3.9 >> Datum: Mon, 08 May 2006 18:47:20 +0200 >> Von: WILLICon >> Antwort an: RXTX Developers and Users >> An: RXTX Developers and Users >> >> >> Hi, >> >> I use for RXTX for communicate with CyclingComputers. >> >> It works good under Win32, Sloaris and Linux but with Mac OSX we >> have some problems. >> >> My users install the Mac OSX serial lib from the actual binary. >> >> After starting the program, they get this error message: >> >> java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while >> loading gnu.io.RXTXCommDriver >> >> Remember, this error comes only under Mac OSX. >> >> That is the code for the error: >> >> Enumeration portList = CommPortIdentifier.getPortIdentifiers(); >> spInUse = getBundleStr("serialPortInUse"); >> spFree = getBundleStr("serialPortFree"); >> while (portList.hasMoreElements()) { >> CommPortIdentifier portId = (CommPortIdentifier) >> portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (osName != null && osName.startsWith("mac")) { >> if (!portId.getName().startsWith("dev/cu.")) { >> continue; >> } >> } >> if (portId.isCurrentlyOwned()) { >> serialPortNames.add(portId.getName() + " - " + >> spInUse); >> } >> else { >> serialPortNames.add(portId.getName() + " - " + >> spFree); >> } >> } >> } >> if (serialPortNames.size() == 0) { >> serialPortNames.add(getBundleStr("serialPortNotFound")); >> } >> >> BTW: The methode isCurrentlyOwned() is not working. I get always >> the value "false". >> I can only get the status, while I open the port and catch the >> exception. >> >> Any ideas? >> >> Hans >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/948333be/attachment-0005.html From jredman at ergotech.com Tue May 16 07:35:52 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 16 May 2006 07:35:52 -0600 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: <4469D538.6070408@ergotech.com> Hans, I have no direct insight, but would note that what you have is a "NoClassDefFoundError" not a "ClassNotFoundException". So the class javax/comm/CommDriver is found, but one of its dependencies is missing. NoClassDefFoundError are a bigger problem to resolve because you get no indication of the real problem. Jim WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we have > some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > * spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always the > value "false". > I can only get the status, while I open the port and catch the exception. > > Any ideas? > > Hans > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.de Tue May 16 08:01:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 16:01:21 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 In-Reply-To: <4469AFC3.6000002@willicon.de> References: <44698EBC.8000008@willicon.de> <8C5680C4-E2BA-42FF-B221-36E1124FA6A4@buechse.de> <4469AFC3.6000002@willicon.de> Message-ID: <9825A602-D6ED-4C28-BF33-9A7C984FACD5@buechse.de> Hallo Hans, you include RXTX 2.17 in your "bikeXexperience.jar" (2.17 uses Interfaces from gnu.io.* not javax.comm.*). Now inspect your error log closely: The class gnu.io.RXTXCommDriver tries to load javax.comm.CommDriver: this is only the case for RXTX 2.07. I assume, that the user has installed Version 2.07 into one of the java.ext.dirs . The VM always tries to load classes from the "system" path first. The current Mac installer distributed with RXTX in fact installs RXTXcomm.jar and librxtxSerial.jnilib into /Library/Java/Extensions. (I wrote some time ago that I consider this as a bad idea because of potential version conflicts-> thanks for delivering the example). For 2.07 it does so without installing the javax.comm classes it seems. I would recommend that you instruct your users to install version 2.17 only. Until RXTX is changed to use TIOCEXCL instead of lock files, you can hardly avoid the installer, as the user needs to be added to a special group and a lockfile directory needs be created. More precisely you are waiting for: http://bugzilla.qbang.org/show_bug.cgi?id=50 [RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL)] Regards, Joachim -------------- next part -------------- A non-text attachment was scrubbed... Name: log.tiff Type: image/tiff Size: 38394 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/e3e52128/log-0005.tiff -------------- next part -------------- > > Ich verwende RXTX 2.17. Das orginal RXTXcomm.jar ist in > CyclingDataManager.jar enthalten. > From tjarvi at qbang.org Wed May 17 23:18:15 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 May 2006 23:18:15 -0600 (MDT) Subject: [Rxtx] update Message-ID: So we have several patches and these have stacked up. I'd like to thank everyone for being patient. Tests for the most intrusive patches look good so far. I still have to get some bits together on my end but it looks like we can catch everything up in CVS this week. I'll try to post a normal list of what went in by whom with links Saturday. But I'm not seeing anything that raises flags yet. I also think I'll be able to submit a patch for nonstandard baud rates. I have to confirm w32 but I think its going to be a one line fix. I don't know if its bugzilla or people tinkering with patch files before submitting but patches are not applying cleanly. So the patches have to be done by hand. This may make things difficult for people hoping to add other patches on top. I'm trying to make that go well but ... -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Thu May 18 02:23:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 May 2006 10:23:47 +0200 Subject: [Rxtx] update In-Reply-To: References: Message-ID: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Hello Trent, in fact I tinkered with the patches (never used this mechanism before, usually I "communicate" via cvs) ... so sorry for any trouble you had applying them. Basicly I edited the patches to make them self contained. Having the tests run with different speeds on different platforms, may well be an effect of caching. I have seen quite interesting propagation delays for the closing flag on my PowerPC system, which makes me doubt, that the propagation of output_buffer_empty_flag works as it should. Maybe the communication mechanism between the two threads should be replaced by something like pthread_cond_*. Could you describe which problems you see on Solaris/SPARC? I'd be interested to see if they exist on OS X (PowerPC) as well... As you seem to work on the stuff at the moment I would like to suggest the following additions (it looks more than it is, I posted some context to make clear where to apply the change). See the comments in braces for what was changed Greetings, Joachim (1) The end of the drain loop could be: --- report("drain_loop: received EINTR in tcdrain\n"); --- (added "in tcdrain" to make debug output clearer) (2) The start of the drain loop should be: --- for(i=0;;i++) { report_verbose("drain_loop: looping\n"); #if defined(__sun__) /* FIXME: No time to test on all OS's for production */ if( eis->eventloop_interrupted ) { goto end; } if (usleep(5000)) { report("drain_loop: received EINTR"); } #else if (usleep(1000000)) { report("drain_loop: received EINTR"); } #endif /* __sun__ */ --- (added a check for "eis->eventloop_interrupted" before the sleep) (3) The end of interrupt_event_loop could (and maybe should) be: --- #if !defined(TIOCSERGETLSR) && !defined(WIN32) /* make sure that the drainloop unblocks from tcdrain */ pthread_kill(index->drain_tid, SIGABRT); /* TODO use wait/join/SIGCHLD/?? instead of sleep? */ usleep(50 * 1000); /* Under normal conditions, SIGABRT will unblock tcdrain. However a non-responding USB device combined with an unclean driver may still block. This is very ugly because it may block the call to close indefinetly. */ if (index->closing != 1) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); index->closing = 1; } #endif report("interruptEventLoop: interrupted\n"); --- (added some comments and pthread_cancel for resisting drain thread) On 18.05.2006, at 07:18, Trent Jarvi wrote: > > So we have several patches and these have stacked up. I'd like to > thank > everyone for being patient. > > Tests for the most intrusive patches look good so far. I still > have to > get some bits together on my end but it looks like we can catch > everything > up in CVS this week. > > I'll try to post a normal list of what went in by whom with links > Saturday. But I'm not seeing anything that raises flags yet. I also > think I'll be able to submit a patch for nonstandard baud rates. > I have > to confirm w32 but I think its going to be a one line fix. > > I don't know if its bugzilla or people tinkering with patch files > before > submitting but patches are not applying cleanly. So the patches > have to > be done by hand. This may make things difficult for people hoping > to add > other patches on top. I'm trying to make that go well but ... > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu May 18 22:28:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 18 May 2006 22:28:00 -0600 (MDT) Subject: [Rxtx] update In-Reply-To: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> References: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Message-ID: On Thu, 18 May 2006, Joachim Buechse wrote: > Hello Trent, > > in fact I tinkered with the patches (never used this mechanism > before, usually I "communicate" via cvs) ... so sorry for any trouble > you had applying them. Basicly I edited the patches to make them self > contained. I think we are close to moving towards that. > > Having the tests run with different speeds on different platforms, > may well be an effect of caching. I have seen quite interesting > propagation delays for the closing flag on my PowerPC system, which > makes me doubt, that the propagation of output_buffer_empty_flag > works as it should. Maybe the communication mechanism between the two > threads should be replaced by something like pthread_cond_*. Could > you describe which problems you see on Solaris/SPARC? I'd be > interested to see if they exist on OS X (PowerPC) as well... This is interesting. I have seen problems with output buffer empty in applications that require it. I'm trying to get a bug list and or test results open for everyone to see but that may take time. But missed output buffer events ... yep. With Sparc, we have seen a few things. One was a kernel race condition that went away when we reimaged and updated 2.8. RXTX was hanging on close, top showed no cpu use but there was 2 second delays just typing on console. The other is our tests now take ~4 times longer on Solaris. Someone is looking at timing just open, close, read, write, ... to see if they can find where the slowdown is. This happened after solaris 2.8. I'll try to share more when/if there is something interesting. This may well not be solvable in userland. > > As you seem to work on the stuff at the moment I would like to > suggest the following additions (it looks more than it is, I posted > some context to make clear where to apply the change). See the > comments in braces for what was changed I'll take a look. This could all come together Saturday but I also have an event to attend that day. I may not wrap this up until Sunday. -- Trent Jarvi tjarvi at qbang.org From andrewlord at internode.on.net Sun May 21 20:10:02 2006 From: andrewlord at internode.on.net (Andrew Lord) Date: Mon, 22 May 2006 11:40:02 +0930 Subject: [Rxtx] Kernel include files do not match kernel Message-ID: <200605221140.03271.andrewlord@internode.on.net> Hi, I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel 2.6.12-18 with the command: ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include However I get the message: ## checking java.version 1.5.0_06 ## checking os.version 2.6.12-18mdk ## ## WARNING: Kernel include files do not match the current kernel ## ## configure: creating ./config.status etc. Is there a problem with the way I'm specifying the 'include' directory ? If not, how else can I specify the correct directory for the include files please ? Cheers, Andrew From tjarvi at qbang.org Sun May 21 20:31:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 May 2006 20:31:31 -0600 (MDT) Subject: [Rxtx] Kernel include files do not match kernel In-Reply-To: <200605221140.03271.andrewlord@internode.on.net> References: <200605221140.03271.andrewlord@internode.on.net> Message-ID: On Mon, 22 May 2006, Andrew Lord wrote: > Hi, > > I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel > 2.6.12-18 with the command: > > ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk > CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include > > However I get the message: > > ## checking java.version 1.5.0_06 > ## checking os.version 2.6.12-18mdk > ## > ## WARNING: Kernel include files do not match the current kernel > ## > ## configure: creating ./config.status > etc. > > Is there a problem with the way I'm specifying the 'include' directory ? If > not, how else can I specify the correct directory for the include files > please ? > Hi Andrew I'm fairly sure your --with-kernel option does nothing. The CPPFLAGS should do what you want. Maybe put an #error message in /usr/src/linux.../incude/linux/version.h But I don't recall a recent problem with version missmatches. It should work. Distros will even ship include files that don't match versions exactly. In theory it should never matter for users. I used to compile new kernels by hand and really didnt have a distro. I didnt have a seperate package of kernel headers for users (myself). When changing a gateway from linux 1.2.12 to 2.1.77, I would worry about such messages. So if you are doing something that weird, the message may be of use to you. If you just see the message on a distro you installed, it is more than likely harmless. -- Trent Jarvi tjarvi at qbang.org From mrogers at spro.net Mon May 22 14:45:39 2006 From: mrogers at spro.net (Mike Rogers) Date: Mon, 22 May 2006 14:45:39 -0600 Subject: [Rxtx] Sun's CommAPI -- think May? Message-ID: <447222F3.9040302@spro.net> Hi, Any word from Sun about progress towards fixing the Java CommAPI v3 "incompatibilities" so RXTX 2.0 can operate within the framework's namespace (javax.comm)? I recall mention of a May time frame. Thanks, Mike From paul.klissner at sun.com Mon May 22 15:09:27 2006 From: paul.klissner at sun.com (Paul Klissner) Date: Mon, 22 May 2006 14:09:27 -0700 Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <447222F3.9040302@spro.net> References: <447222F3.9040302@spro.net> Message-ID: <44722887.8080308@sun.com> Mike Rogers wrote: > Hi, > > Any word from Sun about progress towards fixing the Java CommAPI v3 > "incompatibilities" so RXTX 2.0 can operate within the framework's > namespace (javax.comm)? I recall mention of a May time frame. > > Thanks, > > Mike > We've had a lot of work come in. This hasn't been the only priority. I'm running behind the plan in addressing this, but will be looking at it again soon. Rather than state a new, I'll just say it is in progress, and not off the table. I'll get this fixed as soon as I can. Good timing for asking as we just started discussing javax.comm plans today, and I'll have some cycles to work on it soon. Paul From yhua537 at cse.unsw.edu.au Mon May 22 16:03:05 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Tue, 23 May 2006 08:03:05 +1000 (EST) Subject: [Rxtx] install rxtx in XP Message-ID: Hi Guys, I am new to serial port programming, and have no experience on programming java in xp, but my project require me to builld a communication link between xp and a UART device. Most of the information in the web site seems for linux only. including the commands such as export and chmod. How do I install rxtx in xp? cheers YiQi Huang From mark at mdsh.com Tue May 23 01:24:20 2006 From: mark at mdsh.com (Mark Himsley) Date: Tue, 23 May 2006 08:24:20 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off , it includes DLLs for Windows and the JAR for Java. Follow the Windows instructions in the INSTALL. ie RXTXcomm.jar goes in \jre\lib\ext (under java) rxtxSerial.dll goes in \jre\bin So, assuming a fairly standard Java install, copy RXTXcomm.jar into C:\Program Files\Java\jre1.5.0_06\lib\ext and copy rxtxSerial.dll into C:\Program Files\Java\jre1.5.0_06\bin Yes, it really is that simple. On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > I am new to serial port programming, and have no experience on > programming java in xp, but my project require me to builld a > communication link between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang -- Mark Himsley From joachim at buechse.de Tue May 23 02:51:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 23 May 2006 10:51:47 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) Unless it is absolutely required you should NOT install RXTX in your global Java Runtime Environment. This will for sure create versioning conflicts - if not now, than in the future, if not on your system than at your clients. Instead put the dll in your application directory and include the RXTXcomm.jar in your classpath. This is much safer and not a bit more complicated. Regards, Joachim On 23.05.2006, at 09:24, Mark Himsley wrote: > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR > for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > >> I am new to serial port programming, and have no experience on >> programming java in xp, but my project require me to builld a >> communication link between xp and a UART device. >> >> Most of the information in the web site seems for linux only. >> including >> the commands such as export and chmod. How do I install rxtx in xp? >> >> cheers >> YiQi Huang > > > > -- > Mark Himsley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tod at todbot.com Tue May 23 03:12:22 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 02:12:22 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I totally agree: do not contaminate the Java installation. I put all the RXTX files in a directory and then change my java invocation to be: % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* Alternatively, use Launch4J to create a double-clickable application and keep the RXTX libraries in the directory of the application. -=tod On May 23, 2006, at 1:51 AM, Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > >> Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off >> , it includes DLLs for Windows and the JAR >> for Java. >> >> Follow the Windows instructions in the INSTALL. >> >> ie >> >> RXTXcomm.jar goes in \jre\lib\ext (under java) >> rxtxSerial.dll goes in \jre\bin >> >> So, assuming a fairly standard Java install, copy RXTXcomm.jar into >> C:\Program Files\Java\jre1.5.0_06\lib\ext >> and copy rxtxSerial.dll into >> C:\Program Files\Java\jre1.5.0_06\bin >> >> Yes, it really is that simple. >> >> >> >> On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: >> >>> I am new to serial port programming, and have no experience on >>> programming java in xp, but my project require me to builld a >>> communication link between xp and a UART device. >>> >>> Most of the information in the web site seems for linux only. >>> including >>> the commands such as export and chmod. How do I install rxtx in xp? >>> >>> cheers >>> YiQi Huang >> >> >> >> -- >> Mark Himsley >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From smontgomery at mediaspansoftware.com Tue May 23 08:46:53 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Tue, 23 May 2006 10:46:53 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: Message-ID: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Joachim and Tod mentioned how to keep the files RXTX requires on Windows XP out of the Java installations - thanks gentlemen! Are there similar suggestions for an RXTX install on OS X? The current "canonical" OS X installation instructions "contaminate the Java installation", to use Tod's words. Our app will run fine under 1.4.2 and 5.0 on OS X, and a lot of users will have both. We've already been burned by the recent switch from 1.4.2 to 5.0 as the platform default. Any suggestions welcomed. From tod at todbot.com Tue May 23 13:27:55 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 12:27:55 -0700 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <9BA0F670-A862-42E7-BB2C-130D775ABDF9@todbot.com> Hi Sean, It depends on how you build and deploy your code. If you're using shell scripts, you can do something like this: #!/bin/sh # pick one JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/ Commands/java #JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/ Commands/java $JAVA -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* That both picks which VM to use and uses the RXTX in the directory called 'rxtxlib'. If you want your shell script to be clever, you could test for the existence of the different 'java' executables and go from there (maybe even use different jar files). I am almost positive all OS X systems with Java 1.5 are guaranteed to also have Java 1.4.2. If you're using Jar Builder or XCode, you can specify which JVM to use and add the extra args in the Info.plist file. The paths specified in the 'java' invocation then are based off of the $JAVAROOT variable that the JavaApplicationStub sets for you. For my app, I've have been compiling two sets of jars, one compiled with 1.4.2 and one with 1.5, but they both run under 1.5. So I have a similar shell script that chooses a different 'javac' depending on the need. -=tod On May 23, 2006, at 7:46 AM, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From yhua537 at cse.unsw.edu.au Tue May 23 11:09:37 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 03:09:37 +1000 (EST) Subject: [Rxtx] install rxtx in XP (Mark Himsley, Joachim Buechse, Tod E. Kurt> In-Reply-To: References: Message-ID: > Message: 8 > Date: Tue, 23 May 2006 08:03:05 +1000 (EST) > From: YiQi Huang > Subject: [Rxtx] install rxtx in XP > To: rxtx at qbang.org > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > Hi Guys, > > I am new to serial port programming, and have no experience on programming > java in xp, but my project require me to builld a communication link > between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang > > > ------------------------------ > > Message: 9 > Date: Tue, 23 May 2006 08:24:20 +0100 > From: Mark Himsley > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=us-ascii; format=flowed > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > ------------------------------ > > Message: 10 > Date: Tue, 23 May 2006 10:51:47 +0200 > From: Joachim Buechse > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > > ------------------------------ > > Message: 11 > Date: Tue, 23 May 2006 02:12:22 -0700 > From: "Tod E. Kurt" > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I totally agree: do not contaminate the Java installation. > > I put all the RXTX files in a directory and then change my java > invocation to be: > > % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* > > Alternatively, use Launch4J to create a double-clickable application > and keep the RXTX libraries in the directory of the application. > > -=tod > > Hi, Thanks guys, I don't know if this is the correct way to reply your mecessage, if wrong, please point out. Thank you for Mark to give the detail instructions and Joachim to point out the cons ot installing in the java directory, and specially thanks for Tod to give the instrection in detail. Sorry to ask another stupid question: I have followed Tod's instruction. Now I think i am ready to start hacking. But where is the RXTX API documentation? Is it the same as using normal java comm API? btw, where could i find some examples to start with? Thanks very much cheers YiQi Huang From tjarvi at qbang.org Tue May 23 16:09:32 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 May 2006 16:09:32 -0600 (MDT) Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <44722887.8080308@sun.com> References: <447222F3.9040302@spro.net> <44722887.8080308@sun.com> Message-ID: > Good timing for asking as we just started discussing javax.comm plans > today, and I'll have some cycles to work on it soon. Hi Paul I assume you mean Sun is discussing plans concerning its own internal actions and there is no community involvment at this point. -- Trent Jarvi tjarvi at qbang.org From yhua537 at cse.unsw.edu.au Tue May 23 22:50:01 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 14:50:01 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } From mmester at sps.edu Tue May 23 22:58:21 2006 From: mmester at sps.edu (Michael Mester) Date: Wed, 24 May 2006 00:58:21 -0400 Subject: [Rxtx] install rxtx in XP References: Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below -----Original Message----- From: rxtx-bounces at qbang.org on behalf of YiQi Huang Sent: Wed 5/24/2006 12:50 AM To: RXTX Developers and Users Subject: Re: [Rxtx] install rxtx in XP Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3950 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060523/b36d0c63/attachment-0005.bin From yhua537 at cse.unsw.edu.au Tue May 23 23:05:50 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 15:05:50 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: Yes, Michael you are right, it should be semicolons, But it still can't find the correct library. On Wed, 24 May 2006, Michael Mester wrote: > I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below > > > -----Original Message----- > From: rxtx-bounces at qbang.org on behalf of YiQi Huang > Sent: Wed 5/24/2006 12:50 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] install rxtx in XP > > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > cheers YiQi Huang From tod at todbot.com Wed May 24 00:01:57 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 23:01:57 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Yes, sorry, classpath entries are semicolon-separated on Windows and colon-separated on everything else. Your example code below is importing the wrong set of classes. It should not "import javax.comm.*", instead it should "import gnu.io.*". When I make that change, your example program compiles. The "javax.comm" package is the one released by Sun, the "gnu.io" package is the RXTX one. You might've seen some discussion that the two will be merged or become compatible, but that hasn't happened yet. -=tod On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > > Yes, Michael you are right, it should be semicolons, But it still > can't > find the correct library. > > On Wed, 24 May 2006, Michael Mester wrote: > >> I believe the entries in the classpath need to be seperated with >> semicolons, not a colon as you have in your command below >> >> >> -----Original Message----- >> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >> Sent: Wed 5/24/2006 12:50 AM >> To: RXTX Developers and Users >> Subject: Re: [Rxtx] install rxtx in XP >> >> Hi, >> >> Sorry guys.I follow Tod's instruction, and here is what i did: >> >> put >> RXTXcomm.jar, >> rxtxParallel.dll, >> rxtxSerial.dll >> in >> C:\RXTX_files >> >> and I got a SimpleRead class attached below, compile it with : >> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >> it still saying "cannot find symbol". >> >> Is there anything I did wrong? Do I need the comm.jar from Sun? >> >> Thanks & regards >> YiQi Huang >> >> >> //////////////////////////////////////////////////////// >> // SimpleRead.java >> //////////////////////////////////////////////////////// >> >> import java.io.*; >> import java.util.*; >> import javax.comm.*; >> >> public class SimpleRead >> implements Runnable, SerialPortEventListener { >> static CommPortIdentifier portId; >> static Enumeration portList; >> InputStream inputStream; >> SerialPort serialPort; >> Thread readThread; >> public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == >> CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals("COM1")) { >> //if (portId.getName().equals("/dev/term/a")) { >> SimpleRead reader = new SimpleRead(); >> } >> } >> } >> } >> public SimpleRead() { >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", >> 2000); >> } catch (PortInUseException e) {} >> try { >> inputStream = serialPort.getInputStream(); >> } catch (IOException e) {} >> try { >> serialPort.addEventListener(this); >> } catch (TooManyListenersException e) {} >> serialPort.notifyOnDataAvailable(true); >> try { >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } catch (UnsupportedCommOperationException e) {} >> readThread = new Thread(this); >> readThread.start(); >> } >> public void run() { >> try { >> Thread.sleep(20000); >> } catch (InterruptedException e) {} >> } >> public void serialEvent(SerialPortEvent event) { >> switch(event.getEventType()) { >> case SerialPortEvent.BI: >> case SerialPortEvent.OE: >> case SerialPortEvent.FE: >> case SerialPortEvent.PE: >> case SerialPortEvent.CD: >> case SerialPortEvent.CTS: >> case SerialPortEvent.DSR: >> case SerialPortEvent.RI: >> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >> break; >> case SerialPortEvent.DATA_AVAILABLE: >> byte[] readBuffer = new byte[20]; >> try { >> while (inputStream.available() > 0) { >> int numBytes = inputStream.read(readBuffer); >> } >> System.out.print(new String(readBuffer)); >> } catch (IOException e) {} >> break; >> } >> } >> } >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > cheers > YiQi Huang > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From joachim at buechse.de Wed May 24 00:10:06 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:10:06 +0200 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Hi Sean, my preferred way of dealing with RXTX on OS X is to include the RXTX classes into my application jar and to put the RXTX lib in the same directory as this jar. To make it even more comfortable, you can include the lib in the jar and have some startup code extract it and write it to a temporary file from which you load it with System.load(). Unfortunately the current version of RXTX for OS X requires tinkering with user groups as it is based on lockfiles - and hence it needs the RXTX OS X installer or you need to duplicated this functionality in your own installer. I have created my own native version which is not based on lockfiles but tty locking (the standard way to do it on OSX). I hope that these patches will be integrated soon into the distribution. Regards, Joachim On 23.05.2006, at 16:46, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Wed May 24 00:16:12 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:16:12 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <7017ECFC-B13E-4806-B321-9FFCAC5830F0@buechse.de> I assume you downloaded rxtx-217 (not 207). Instead of importing javax.comm.* you must import gnu.io.* The classes have the same name, but they are not in the same package. On 24.05.2006, at 06:50, YiQi Huang wrote: > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From yhua537 at cse.unsw.edu.au Wed May 24 00:17:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 16:17:45 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Message-ID: Thanks Tod again, i kept reading "gnu.io.*" as "gun.io.*" last few hours after i read some commons from web. Thanks very much Tod. thanks YiQi Huang On Tue, 23 May 2006, Tod E. Kurt wrote: > Yes, sorry, classpath entries are semicolon-separated on Windows and > colon-separated on everything else. > > Your example code below is importing the wrong set of classes. It > should not "import javax.comm.*", instead it should "import > gnu.io.*". When I make that change, your example program compiles. > The "javax.comm" package is the one released by Sun, the "gnu.io" > package is the RXTX one. You might've seen some discussion that the > two will be merged or become compatible, but that hasn't happened yet. > > -=tod > > > On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > >> >> Yes, Michael you are right, it should be semicolons, But it still >> can't >> find the correct library. >> >> On Wed, 24 May 2006, Michael Mester wrote: >> >>> I believe the entries in the classpath need to be seperated with >>> semicolons, not a colon as you have in your command below >>> >>> >>> -----Original Message----- >>> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >>> Sent: Wed 5/24/2006 12:50 AM >>> To: RXTX Developers and Users >>> Subject: Re: [Rxtx] install rxtx in XP >>> >>> Hi, >>> >>> Sorry guys.I follow Tod's instruction, and here is what i did: >>> >>> put >>> RXTXcomm.jar, >>> rxtxParallel.dll, >>> rxtxSerial.dll >>> in >>> C:\RXTX_files >>> >>> and I got a SimpleRead class attached below, compile it with : >>> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >>> it still saying "cannot find symbol". >>> >>> Is there anything I did wrong? Do I need the comm.jar from Sun? >>> >>> Thanks & regards >>> YiQi Huang >>> >>> >>> //////////////////////////////////////////////////////// >>> // SimpleRead.java >>> //////////////////////////////////////////////////////// >>> >>> import java.io.*; >>> import java.util.*; >>> import javax.comm.*; >>> >>> public class SimpleRead >>> implements Runnable, SerialPortEventListener { >>> static CommPortIdentifier portId; >>> static Enumeration portList; >>> InputStream inputStream; >>> SerialPort serialPort; >>> Thread readThread; >>> public static void main(String[] args) { >>> portList = CommPortIdentifier.getPortIdentifiers(); >>> while (portList.hasMoreElements()) { >>> portId = (CommPortIdentifier) portList.nextElement(); >>> if (portId.getPortType() == >>> CommPortIdentifier.PORT_SERIAL) { >>> if (portId.getName().equals("COM1")) { >>> //if (portId.getName().equals("/dev/term/a")) { >>> SimpleRead reader = new SimpleRead(); >>> } >>> } >>> } >>> } >>> public SimpleRead() { >>> try { >>> serialPort = (SerialPort) portId.open("SimpleReadApp", >>> 2000); >>> } catch (PortInUseException e) {} >>> try { >>> inputStream = serialPort.getInputStream(); >>> } catch (IOException e) {} >>> try { >>> serialPort.addEventListener(this); >>> } catch (TooManyListenersException e) {} >>> serialPort.notifyOnDataAvailable(true); >>> try { >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, >>> SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> } catch (UnsupportedCommOperationException e) {} >>> readThread = new Thread(this); >>> readThread.start(); >>> } >>> public void run() { >>> try { >>> Thread.sleep(20000); >>> } catch (InterruptedException e) {} >>> } >>> public void serialEvent(SerialPortEvent event) { >>> switch(event.getEventType()) { >>> case SerialPortEvent.BI: >>> case SerialPortEvent.OE: >>> case SerialPortEvent.FE: >>> case SerialPortEvent.PE: >>> case SerialPortEvent.CD: >>> case SerialPortEvent.CTS: >>> case SerialPortEvent.DSR: >>> case SerialPortEvent.RI: >>> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >>> break; >>> case SerialPortEvent.DATA_AVAILABLE: >>> byte[] readBuffer = new byte[20]; >>> try { >>> while (inputStream.available() > 0) { >>> int numBytes = inputStream.read(readBuffer); >>> } >>> System.out.print(new String(readBuffer)); >>> } catch (IOException e) {} >>> break; >>> } >>> } >>> } >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> >> cheers >> YiQi Huang >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From smontgomery at mediaspansoftware.com Wed May 24 10:24:13 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 12:24:13 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: Tod & Joachim, Thanks for the info, that's very helpful. I'll give that a whirl when I move to rxtx 2.1. I'm still using the older 2.0.7 version for now (don't ask), which probably requires the Sun comm.jar, javax.comm.properties and librxtxSerial.jnilib to be in very specific places in each jvm's file hierarchy. From tjarvi at qbang.org Wed May 24 11:59:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 11:59:16 -0600 (MDT) Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: On Wed, 24 May 2006, Sean Montgomery wrote: > Tod & Joachim, > > Thanks for the info, that's very helpful. I'll give that a whirl > when I move to rxtx 2.1. I'm still using the older 2.0.7 version for > now (don't ask), which probably requires the Sun comm.jar, > javax.comm.properties and librxtxSerial.jnilib to be in very specific > places in each jvm's file hierarchy. > You will need comm.jar from Sun then. It must be Sun's version 2.* or older for Linux or Solaris. I assume they have this in download archives. The default offering from Sun is version 3.0. This version currently does not support rxtx. The older version will probably be fine for your needs. -- Trent Jarvi tjarvi at qbang.org From smontgomery at mediaspansoftware.com Wed May 24 12:19:06 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 14:19:06 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: <3939EFB8-11E1-4E3E-A684-5B3C525577CD@mediaspansoftware.com> Yup, that's right, thanks Trent. I've been using these files for quite a while now. Thanks for bringing it up. I almost didn't mention using 2.0.7 because I didn't want to give any new members of the list the wrong idea! :-) On May 24, 2006, at 1:59 PM, Trent Jarvi wrote: > On Wed, 24 May 2006, Sean Montgomery wrote: > >> Tod & Joachim, >> >> Thanks for the info, that's very helpful. I'll give that a whirl >> when I move to rxtx 2.1. I'm still using the older 2.0.7 version for >> now (don't ask), which probably requires the Sun comm.jar, >> javax.comm.properties and librxtxSerial.jnilib to be in very specific >> places in each jvm's file hierarchy. >> > > You will need comm.jar from Sun then. It must be Sun's version 2.* or > older for Linux or Solaris. I assume they have this in download > archives. > > The default offering from Sun is version 3.0. This version > currently does > not support rxtx. > > The older version will probably be fine for your needs. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mark at mdsh.com Wed May 24 15:55:46 2006 From: mark at mdsh.com (Mark Himsley) Date: Wed, 24 May 2006 22:55:46 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <37B0FC4B1F3237321F093ABE@MacMini.local> On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) That's no problem. BUT, do note that the instructions I elaborated on are in the INSTALL file within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone please update the INSTALL file? > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > > , it includes DLLs for Windows and the JAR > > for Java. > > > > Follow the Windows instructions in the INSTALL. > > > > ie > > > > RXTXcomm.jar goes in \jre\lib\ext (under java) > > rxtxSerial.dll goes in \jre\bin > > > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > > C:\Program Files\Java\jre1.5.0_06\lib\ext > > and copy rxtxSerial.dll into > > C:\Program Files\Java\jre1.5.0_06\bin > > > > Yes, it really is that simple. > > > > > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > > > >> I am new to serial port programming, and have no experience on > >> programming java in xp, but my project require me to builld a > >> communication link between xp and a UART device. > >> > >> Most of the information in the web site seems for linux only. > >> including > >> the commands such as export and chmod. How do I install rxtx in xp? > >> > >> cheers > >> YiQi Huang > > > > > > > > -- > > Mark Himsley > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Mark Himsley From tjarvi at qbang.org Wed May 24 16:41:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 16:41:46 -0600 (MDT) Subject: [Rxtx] install rxtx in XP In-Reply-To: <37B0FC4B1F3237321F093ABE@MacMini.local> References: <37B0FC4B1F3237321F093ABE@MacMini.local> Message-ID: On Wed, 24 May 2006, Mark Himsley wrote: > > > On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > >> I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > That's no problem. > > BUT, do note that the instructions I elaborated on are in the INSTALL file > within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone > please update the INSTALL file? > > The INSTALL file may be updated by anyone at anytime. http://rxtx.qbang.org/wiki/index.php/Installation We are moving it to the wiki so end users may put the type of answers they would like to see in. Sometimes it's best if developers don't give what appears to be cryptic answers. You can even put in that jre/lib/ext is not the right place but you don't understand the classpath solution mentioned on the mail-list and then we know what to add. -- Trent Jarvi tjarvi at qbang.org From stramit at gmail.com Wed May 24 21:45:31 2006 From: stramit at gmail.com (Tim Cooper) Date: Thu, 25 May 2006 13:45:31 +1000 Subject: [Rxtx] Accessing Virtual Com Port Message-ID: Hi, I have to develop an application that talks to a virtual com port (in this case com3) which translates any messages sent across a USB cable to a micro. Using C++ I can talk to this com port and I know that it is configured, present, and working. For the application that I am trying to write I want to use RXTX for the communication. My problem is that the configured virtual port (in windows) is not showing up when I do an enumeration over the available ports. The output I get is (com 3 is not present) : Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 PORT FOUND: COM1 PORT FOUND: LPT1 Is there anything that I need to do to make com3 available to RXTX and my application? Timothy Cooper -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060524/c5591648/attachment-0005.html From antonio.luis at iscte.pt Thu May 25 01:39:13 2006 From: antonio.luis at iscte.pt (=?ISO-8859-1?Q?Ant=F3nio_Lopes?=) Date: Thu, 25 May 2006 08:39:13 +0100 Subject: [Rxtx] RXTX on Pocket PC Message-ID: <44755F21.8060103@iscte.pt> Hello everyone, I've been using RXTX to communicate with serial ports in Windows and it's been quite successful. However, I'm now considering porting my application from Windows to Pocket PC but I can't seem to find the RXTX binaries (*.jar and *.dll) to use in Pocket PC. I've been "digging" on the mailing list's archives and also on the web and I can't find these anywhere. Can anyone in this mailing list give me some pointers on this? Where can I find the necessary files and basic installation instructions? Thanks very much for your help. I very much appreciate any help that you can provide me. Regards, -- Ant?nio Lopes @contact: antonio.luis at iscte.pt @work: ADETTI - ISCTE @web: http://antonio.lopes.googlepages.com/home From doug at dupreeinc.com Fri May 26 15:45:50 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Fri, 26 May 2006 14:45:50 -0700 Subject: [Rxtx] rxtx slow startup Message-ID: <4477770E.9010400@dupreeinc.com> Hello, I hope there are people still reading this mailing list. The archive appeared to not have anything new after 4/2005. I was using the commapi from sun for a project where a java application reads data from test equipment connected to the serial port. I had to upgrade the ftdi vcp driver on my pc and the old sun commapi no longer works with hardware flow control. as an experiment I replaced the javax.com with gnu.io in the SerialDemo.java project that was included with the commapi. This compiled fine using JBuilder 2006 and JRE 1.5.0_05. RXTX also works with the latest ftdi drivers so life is wonderful again... almost... When using the commapi jar the SerialDemo program starts in about 1 second on my system. Using the RXTX jar it takes over 56 seconds to start. Has anyone else seen this problem? Is there a workaround to get the startup performance close to the old commapi? The last thing printed to the console before this delay is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks for your time! Doug From yhua537 at cse.unsw.edu.au Sat May 27 05:46:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 21:46:45 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <4477770E.9010400@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> Message-ID: hi Doug The archive hasn't been update for a long time, But people certainly still reading the list. I don't have enough experience to help on your problem, but without any detail about what your problem doing during that 56 seconds, it is hard to target the your question, I think. cheers YiQi On Fri, 26 May 2006, Doug Thistlethwaite wrote: > Hello, > > I hope there are people still reading this mailing list. The archive > appeared to not have anything new after 4/2005. > > I was using the commapi from sun for a project where a java application > reads data from test equipment connected to the serial port. I had to > upgrade the ftdi vcp driver on my pc and the old sun commapi no longer > works with hardware flow control. as an experiment I replaced the > javax.com with gnu.io in the SerialDemo.java project that was included > with the commapi. This compiled fine using JBuilder 2006 and JRE > 1.5.0_05. RXTX also works with the latest ftdi drivers so life is > wonderful again... almost... > > When using the commapi jar the SerialDemo program starts in about 1 > second on my system. Using the RXTX jar it takes over 56 seconds to > start. Has anyone else seen this problem? Is there a workaround to get > the startup performance close to the old commapi? > > The last thing printed to the console before this delay is: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Thanks for your time! > > Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------- Just a student, Still a student ------------------------------- From yhua537 at cse.unsw.edu.au Sat May 27 06:04:26 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 22:04:26 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: Sorry, I don't think you could understand what I mean .I mean this: Without any detail about what your program is doing during that 56 seconds, it is hard for anyone to target the problem. On Sat, 27 May 2006, YiQi Huang wrote: > hi Doug > > The archive hasn't been update for a long time, But people certainly still > reading the list. > > I don't have enough experience to help on your problem, but without any > detail about what your problem doing during that 56 seconds, it is hard to > target the your question, I think. > > cheers > YiQi > > On Fri, 26 May 2006, Doug Thistlethwaite wrote: > >> Hello, >> >> I hope there are people still reading this mailing list. The archive >> appeared to not have anything new after 4/2005. >> >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From jredman at ergotech.com Sat May 27 08:32:02 2006 From: jredman at ergotech.com (Jim Redman) Date: Sat, 27 May 2006 08:32:02 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: <447862E2.4080506@ergotech.com> Doug, Since you mentioned it, we have a system that is also seems slow. From memory (I don't have one of the slow systems around), I'm not sure that it's consistent, it seems that sometimes it may take longer than others. Since it's part of the bootup it hasn't raised a flag and I haven't researched it. The same code runs much faster on other systems, so now you've got me wondering what's different. The slow system boots DSL (http://www.damnsmalllinux.org/) from a compact flash. FC4 is on my desktop where I haven't noticed a slow down. I think that the rxtx code is the same in both cases with lock files disabled. The slow system has a bunch of serial ports defined, including 4 USB serial ports that do not exist - they are not plugged in. Any clues in there? Jim > On Fri, 26 May 2006, Doug Thistlethwaite wrote: >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Sat May 27 10:41:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 May 2006 10:41:54 -0600 (MDT) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447862E2.4080506@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: On Sat, 27 May 2006, Jim Redman wrote: > Doug, > > Since you mentioned it, we have a system that is also seems slow. From > memory (I don't have one of the slow systems around), I'm not sure that > it's consistent, it seems that sometimes it may take longer than others. > Since it's part of the bootup it hasn't raised a flag and I haven't > researched it. > > The same code runs much faster on other systems, so now you've got me > wondering what's different. > > The slow system boots DSL (http://www.damnsmalllinux.org/) from a > compact flash. FC4 is on my desktop where I haven't noticed a slow > down. I think that the rxtx code is the same in both cases with lock > files disabled. > > The slow system has a bunch of serial ports defined, including 4 USB > serial ports that do not exist - they are not plugged in. > > Any clues in there? > rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. When it does this, it will try to open each port and do a timed out read. most systems will not have entries in device if the port is not there. But some minimal systems will just put all the device files there in case hardware is added. The list of devices scanned used to be ~10-20 times longer than it is today. That was getting very slow. I suspect moving the device files not used to a backup directory would increase the enumeration. I'll look into why the mail-list archive is not updating. The last update was about when I thought I 'fixed' the cron jobs. I probably didn't actually fix it but rather moved the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon May 29 19:46:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 May 2006 19:46:47 -0600 (MDT) Subject: [Rxtx] Mail-List Archives are updating. Message-ID: It was pointed out earlier that the archive is dated. This was a missing crontab entry. The list is currently archived by the week on the web page. It is updated once a day. So every 7 days it starts a new link and updates it daily. I've been limited in what I could do while my cable modem was disconnected this last week. rxtx.org is something I do on my own time. The patches and credits will be comming next. Many of these can be seen in bugzilla right now. -- Trent Jarvi tjarvi at qbang.org From doug at dupreeinc.com Tue May 30 11:18:41 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 10:18:41 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: <447C7E71.4080204@dupreeinc.com> Trent, YiQi, and Jim: Thanks to all for the replies and information! I am just back from a long weekend and I am now trying to figure out what I was doing! :) As for more information. First off, this example is being run under windows XP. I am developing test equipment that communicates with a java application via a serial port. I have been using the commapi for several years and have not had a problem. Recently, I have started a design modification that will replace the RS232 connection with a USB port. I am using the ftdi module for prototyping and I discovered that their virtual com port driver was not compatible with the commapi that Sun released. It turns out that it has problems with hardware flow control ( it works on incoming but not outgoing communications). The way I figured this out was by experimenting with the SerialDemo that was included with the Sum commapi. One nice thing about this example is it has the ability to set incoming and outgoing flow control independently. After I installed RXTX into my JBuilder 2006 IDE, I just replaced all all instances of javax.comm with gnu.io and it compiled and runs without a hitch (except for the slow startup). I Paused the JBuilder IDE during this long pause and the last few entries in the stack trace are: testRead() : -1, gnu.io.RXTXCommDriver registerValidPorts() : 255, gnu.io.RXTXCommDriver registerScannedPorts() : 777, gnu.io.RXTXCommDriver This was all initiated by the following call in the programs init routine: Enumeration en = CommPortIdentifier.getPortIdentifiers(); After looking at this, My guess is that Trent is correct in that the delay is in scanning for ports. I guess one solution would be to not scan for ports, though it would be nice to detect what is available on the system. Is there any way to reduce the number of ports scanned by this function in windows XP? Thanks again for your time, Doug Trent Jarvi wrote: >On Sat, 27 May 2006, Jim Redman wrote: > > > >>Doug, >> >>Since you mentioned it, we have a system that is also seems slow. From >>memory (I don't have one of the slow systems around), I'm not sure that >>it's consistent, it seems that sometimes it may take longer than others. >>Since it's part of the bootup it hasn't raised a flag and I haven't >>researched it. >> >>The same code runs much faster on other systems, so now you've got me >>wondering what's different. >> >>The slow system boots DSL (http://www.damnsmalllinux.org/) from a >>compact flash. FC4 is on my desktop where I haven't noticed a slow >>down. I think that the rxtx code is the same in both cases with lock >>files disabled. >> >>The slow system has a bunch of serial ports defined, including 4 USB >>serial ports that do not exist - they are not plugged in. >> >>Any clues in there? >> >> >> > >rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. > >When it does this, it will try to open each port and do a timed out read. >most systems will not have entries in device if the port is not there. >But some minimal systems will just put all the device files there in case >hardware is added. > >The list of devices scanned used to be ~10-20 times longer than it is >today. That was getting very slow. > >I suspect moving the device files not used to a backup directory would >increase the enumeration. > >I'll look into why the mail-list archive is not updating. The last update >was about when I thought I 'fixed' the cron jobs. I probably didn't >actually fix it but rather moved the problem. > >-- >Trent Jarvi >tjarvi at qbang.org > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/86796453/attachment-0005.html From doug at dupreeinc.com Tue May 30 14:36:09 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 13:36:09 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447C7E71.4080204@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com> Message-ID: <447CACB9.1000801@dupreeinc.com> Hello all, I also notice this pause (not as long however) when I call: CommPortIdentifier.getPortIdentifier(PortName); I would think that if I supply the name of the port, it would not have to go through the same discovery process. If you have any ideas of how to get rid of this startup delay, I would really appreciate it. Thanks, Doug Doug Thistlethwaite wrote: > Trent, YiQi, and Jim: > > Thanks to all for the replies and information! I am just back from a > long weekend and I am now trying to figure out what I was doing! :) > > As for more information. First off, this example is being run under > windows XP. I am developing test equipment that communicates with a > java application via a serial port. I have been using the commapi for > several years and have not had a problem. Recently, I have started a > design modification that will replace the RS232 connection with a USB > port. I am using the ftdi module for prototyping and I discovered > that their virtual com port driver was not compatible with the commapi > that Sun released. It turns out that it has problems with hardware > flow control ( it works on incoming but not outgoing communications). > The way I figured this out was by experimenting with the SerialDemo > that was included with the Sum commapi. One nice thing about this > example is it has the ability to set incoming and outgoing flow > control independently. > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup). > > I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are: > > testRead() : -1, gnu.io.RXTXCommDriver > registerValidPorts() : 255, gnu.io.RXTXCommDriver > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > This was all initiated by the following call in the programs init routine: > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > After looking at this, My guess is that Trent is correct in that the > delay is in scanning for ports. I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system. Is there any way to reduce the number of ports scanned by > this function in windows XP? > > Thanks again for your time, > > Doug > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/edaa5c3c/attachment-0005.html From lynn at swcp.com Tue May 30 15:07:18 2006 From: lynn at swcp.com (lynn@swcp.com) Date: Tue, 30 May 2006 21:07:18 -0000 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CACB9.1000801@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: *IF* the name of the port is supplied, we might want to use the preferences mechanism (java.util.prefs) where we could have previously saved the info for the port. We could do a quick check to see that things have not changed before using it. If things have changed (or never been defined) we would do a full port scan and save detected ports in the preferences. This way if the hardware is not changed, you only pay the time penalty one time. just an idea... Lynn Doug Thistlethwaite said: > This is a multi-part message in MIME format. > --------------070808020900080005070500 > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > Content-Transfer-Encoding: 7bit > > Hello all, > > I also notice this pause (not as long however) when I call: > > CommPortIdentifier.getPortIdentifier(PortName); > > I would think that if I supply the name of the port, it would not have > to go through the same discovery process. If you have any ideas of how > to get rid of this startup delay, I would really appreciate it. > > Thanks, > > Doug > > Doug Thistlethwaite wrote: > > > Trent, YiQi, and Jim: > > > > Thanks to all for the replies and information! I am just back from a > > long weekend and I am now trying to figure out what I was doing! :) > > > > As for more information. First off, this example is being run under > > windows XP. I am developing test equipment that communicates with a > > java application via a serial port. I have been using the commapi for > > several years and have not had a problem. Recently, I have started a > > design modification that will replace the RS232 connection with a USB > > port. I am using the ftdi module for prototyping and I discovered > > that their virtual com port driver was not compatible with the commapi > > that Sun released. It turns out that it has problems with hardware > > flow control ( it works on incoming but not outgoing communications). > > The way I figured this out was by experimenting with the SerialDemo > > that was included with the Sum commapi. One nice thing about this > > example is it has the ability to set incoming and outgoing flow > > control independently. > > > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > > all instances of javax.comm with gnu.io and it compiled and runs > > without a hitch (except for the slow startup). > > > > I Paused the JBuilder IDE during this long pause and the last few > > entries in the stack trace are: > > > > testRead() : -1, gnu.io.RXTXCommDriver > > registerValidPorts() : 255, gnu.io.RXTXCommDriver > > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > > > This was all initiated by the following call in the programs init routine: > > > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > > > After looking at this, My guess is that Trent is correct in that the > > delay is in scanning for ports. I guess one solution would be to not > > scan for ports, though it would be nice to detect what is available on > > the system. Is there any way to reduce the number of ports scanned by > > this function in windows XP? > > > > Thanks again for your time, > > > > Doug > > > > --------------070808020900080005070500 > Content-Type: text/html; charset=ISO-8859-1 > Content-Transfer-Encoding: 7bit > > > > > > > > > Hello all,
>
> I also notice this pause (not as long however) when I call:
>
>          CommPortIdentifier.getPortIdentifier(PortName);
>
> I would think that if I supply the name of the port, it would not have > to go through the same discovery process.  If you have any ideas of how > to get rid of this startup delay, I would really appreciate it.
>
> Thanks,
>
> Doug
>
> Doug Thistlethwaite wrote: >
> > Trent, YiQi, and Jim:
>
> Thanks to all for the replies and information!  I am just back from a > long weekend and I am now trying to figure out what I was doing! :)
>
> As for more information.  First off, this example is being run under > windows XP.  I am developing test equipment that communicates with a > java application via a serial port.  I have been using the commapi for > several years and have not had a problem.  Recently, I have started a > design modification that will replace the RS232 connection with a USB > port.  I am using the ftdi module for prototyping and I discovered that > their virtual com port driver was not compatible with the commapi that > Sun released.  It turns out that it has problems with hardware flow > control ( it works on incoming but not outgoing communications).  The > way I figured this out was by experimenting with the SerialDemo that > was included with the Sum commapi.  One nice thing about this example > is it has the ability to set incoming and outgoing flow control > independently.
>
> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup).
>
> I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are:
>
> testRead() : -1, gnu.io.RXTXCommDriver
> registerValidPorts() : 255, gnu.io.RXTXCommDriver
> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>
> This was all initiated by the following call in the programs init > routine:
>
> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>
> After looking at this,  My guess is that Trent is correct in that the > delay is in scanning for ports.  I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system.  Is there any way to reduce the number of ports scanned by > this function in windows XP? 
>
> Thanks again for your time,
>
> Doug
>
>
> > > > --------------070808020900080005070500-- > -- From jredman at ergotech.com Tue May 30 15:42:35 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 30 May 2006 15:42:35 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: <447CBC4B.2080206@ergotech.com> Lynn, If I understand your idea correctly, I don't think that this would work well for, say, USB ports since these can be easily added/removed by the end user. Jim lynn at swcp.com wrote: > *IF* the name of the port is supplied, we might want to use the preferences > mechanism (java.util.prefs) where we could have previously saved the info for > the port. We could do a quick check to see that things have not changed > before using it. If things have changed (or never been defined) we would do a > full port scan and save detected ports in the preferences. > > This way if the hardware is not changed, you only pay the time penalty one time. > > just an idea... > Lynn > > > Doug Thistlethwaite said: > >> This is a multi-part message in MIME format. >> --------------070808020900080005070500 >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >> Content-Transfer-Encoding: 7bit >> >> Hello all, >> >> I also notice this pause (not as long however) when I call: >> >> CommPortIdentifier.getPortIdentifier(PortName); >> >> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process. If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it. >> >> Thanks, >> >> Doug >> >> Doug Thistlethwaite wrote: >> >>> Trent, YiQi, and Jim: >>> >>> Thanks to all for the replies and information! I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :) >>> >>> As for more information. First off, this example is being run under >>> windows XP. I am developing test equipment that communicates with a >>> java application via a serial port. I have been using the commapi for >>> several years and have not had a problem. Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port. I am using the ftdi module for prototyping and I discovered >>> that their virtual com port driver was not compatible with the commapi >>> that Sun released. It turns out that it has problems with hardware >>> flow control ( it works on incoming but not outgoing communications). >>> The way I figured this out was by experimenting with the SerialDemo >>> that was included with the Sum commapi. One nice thing about this >>> example is it has the ability to set incoming and outgoing flow >>> control independently. >>> >>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup). >>> >>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are: >>> >>> testRead() : -1, gnu.io.RXTXCommDriver >>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>> >>> This was all initiated by the following call in the programs init routine: >>> >>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>> >>> After looking at this, My guess is that Trent is correct in that the >>> delay is in scanning for ports. I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system. Is there any way to reduce the number of ports scanned by >>> this function in windows XP? >>> >>> Thanks again for your time, >>> >>> Doug >>> >> --------------070808020900080005070500 >> Content-Type: text/html; charset=ISO-8859-1 >> Content-Transfer-Encoding: 7bit >> >> >> >> >> >> >> >> >> Hello all,
>>
>> I also notice this pause (not as long however) when I call:
>>
>>         >  CommPortIdentifier.getPortIdentifier(PortName);
>>
>> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process.  If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it.
>>
>> Thanks,
>>
>> Doug
>>
>> Doug Thistlethwaite wrote: >>
>> >> Trent, YiQi, and Jim:
>>
>> Thanks to all for the replies and information!  I am just back from a >> long weekend and I am now trying to figure out what I was doing! :)
>>
>> As for more information.  First off, this example is being run under >> windows XP.  I am developing test equipment that communicates with a >> java application via a serial port.  I have been using the commapi for >> several years and have not had a problem.  Recently, I have started a >> design modification that will replace the RS232 connection with a USB >> port.  I am using the ftdi module for prototyping and I discovered that >> their virtual com port driver was not compatible with the commapi that >> Sun released.  It turns out that it has problems with hardware flow >> control ( it works on incoming but not outgoing communications).  The >> way I figured this out was by experimenting with the SerialDemo that >> was included with the Sum commapi.  One nice thing about this example >> is it has the ability to set incoming and outgoing flow control >> independently.
>>
>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >> all instances of javax.comm with gnu.io and it compiled and runs >> without a hitch (except for the slow startup).
>>
>> I Paused the JBuilder IDE during this long pause and the last few >> entries in the stack trace are:
>>
>> testRead() : -1, gnu.io.RXTXCommDriver
>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>
>> This was all initiated by the following call in the programs init >> routine:
>>
>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>
>> After looking at this,  My guess is that Trent is correct in that the >> delay is in scanning for ports.  I guess one solution would be to not >> scan for ports, though it would be nice to detect what is available on >> the system.  Is there any way to reduce the number of ports scanned by >> this function in windows XP? 
>>
>> Thanks again for your time,
>>
>> Doug
>>
>>
>> >> >> >> --------------070808020900080005070500-- >> > > > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From yhua537 at cse.unsw.edu.au Tue May 30 18:10:23 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 31 May 2006 10:10:23 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CBC4B.2080206@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: Doug, In the SerialDemo, it allow us to save the parameters into a file, and use it when your program start up. Would this help? YiQi On Tue, 30 May 2006, Jim Redman wrote: > Lynn, > > If I understand your idea correctly, I don't think that this would work > well for, say, USB ports since these can be easily added/removed by the > end user. > > Jim > > lynn at swcp.com wrote: >> *IF* the name of the port is supplied, we might want to use the preferences >> mechanism (java.util.prefs) where we could have previously saved the info for >> the port. We could do a quick check to see that things have not changed >> before using it. If things have changed (or never been defined) we would do a >> full port scan and save detected ports in the preferences. >> >> This way if the hardware is not changed, you only pay the time penalty one time. >> >> just an idea... >> Lynn >> >> >> Doug Thistlethwaite said: >> >>> This is a multi-part message in MIME format. >>> --------------070808020900080005070500 >>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>> Content-Transfer-Encoding: 7bit >>> >>> Hello all, >>> >>> I also notice this pause (not as long however) when I call: >>> >>> CommPortIdentifier.getPortIdentifier(PortName); >>> >>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process. If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it. >>> >>> Thanks, >>> >>> Doug >>> >>> Doug Thistlethwaite wrote: >>> >>>> Trent, YiQi, and Jim: >>>> >>>> Thanks to all for the replies and information! I am just back from a >>>> long weekend and I am now trying to figure out what I was doing! :) >>>> >>>> As for more information. First off, this example is being run under >>>> windows XP. I am developing test equipment that communicates with a >>>> java application via a serial port. I have been using the commapi for >>>> several years and have not had a problem. Recently, I have started a >>>> design modification that will replace the RS232 connection with a USB >>>> port. I am using the ftdi module for prototyping and I discovered >>>> that their virtual com port driver was not compatible with the commapi >>>> that Sun released. It turns out that it has problems with hardware >>>> flow control ( it works on incoming but not outgoing communications). >>>> The way I figured this out was by experimenting with the SerialDemo >>>> that was included with the Sum commapi. One nice thing about this >>>> example is it has the ability to set incoming and outgoing flow >>>> control independently. >>>> >>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>> all instances of javax.comm with gnu.io and it compiled and runs >>>> without a hitch (except for the slow startup). >>>> >>>> I Paused the JBuilder IDE during this long pause and the last few >>>> entries in the stack trace are: >>>> >>>> testRead() : -1, gnu.io.RXTXCommDriver >>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>> >>>> This was all initiated by the following call in the programs init routine: >>>> >>>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>> >>>> After looking at this, My guess is that Trent is correct in that the >>>> delay is in scanning for ports. I guess one solution would be to not >>>> scan for ports, though it would be nice to detect what is available on >>>> the system. Is there any way to reduce the number of ports scanned by >>>> this function in windows XP? >>>> >>>> Thanks again for your time, >>>> >>>> Doug >>>> >>> --------------070808020900080005070500 >>> Content-Type: text/html; charset=ISO-8859-1 >>> Content-Transfer-Encoding: 7bit >>> >>> >>> >>> >>> >>> >>> >>> >>> Hello all,
>>>
>>> I also notice this pause (not as long however) when I call:
>>>
>>>         >>  CommPortIdentifier.getPortIdentifier(PortName);
>>>
>>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process.  If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it.
>>>
>>> Thanks,
>>>
>>> Doug
>>>
>>> Doug Thistlethwaite wrote: >>>
>>> >>> Trent, YiQi, and Jim:
>>>
>>> Thanks to all for the replies and information!  I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :)
>>>
>>> As for more information.  First off, this example is being run under >>> windows XP.  I am developing test equipment that communicates with a >>> java application via a serial port.  I have been using the commapi for >>> several years and have not had a problem.  Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port.  I am using the ftdi module for prototyping and I discovered that >>> their virtual com port driver was not compatible with the commapi that >>> Sun released.  It turns out that it has problems with hardware flow >>> control ( it works on incoming but not outgoing communications).  The >>> way I figured this out was by experimenting with the SerialDemo that >>> was included with the Sum commapi.  One nice thing about this example >>> is it has the ability to set incoming and outgoing flow control >>> independently.
>>>
>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup).
>>>
>>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are:
>>>
>>> testRead() : -1, gnu.io.RXTXCommDriver
>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>
>>> This was all initiated by the following call in the programs init >>> routine:
>>>
>>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>
>>> After looking at this,  My guess is that Trent is correct in that the >>> delay is in scanning for ports.  I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system.  Is there any way to reduce the number of ports scanned by >>> this function in windows XP? 
>>>
>>> Thanks again for your time,
>>>
>>> Doug
>>>
>>>
>>> >>> >>> >>> --------------070808020900080005070500-- >>> >> >> >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From halbleib at rechnerbetriebsgruppe.de Wed May 31 02:06:16 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 10:06:16 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp Message-ID: <447D4E78.30302@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, I getting an error while reloading my app in tomcat. At the first start everything runs well, but if i reload mit webapp by tomcat manager i get the following error. java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader Is there a possibility to unload the native library rxtxSerial.dll? thx for all help! regards tom -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 b8FT80HQ1xlbDLnRecDANCc= =heb1 -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 02:52:17 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 10:52:17 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D4E78.30302@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> Message-ID: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Hello Tom, To the best of my knowledge it is impossible to unload native libraries once loaded into the JVM. The exception you see stems from the fact, that Tomcat creates a new classloader when you "reload" the weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar is loaded from the session class loader. Try to add RXTXComm.jar to your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. Regards, Joachim On 31.05.2006, at 10:06, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 > b8FT80HQ1xlbDLnRecDANCc= > =heb1 > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From halbleib at rechnerbetriebsgruppe.de Wed May 31 03:28:35 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 11:28:35 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Message-ID: <447D61C3.1030807@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Joachim, I'm still not getting it. How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml-file? Perhaps web.xml? Regards, Tom Joachim Buechse schrieb: > Hello Tom, > > To the best of my knowledge it is impossible to unload native > libraries once loaded into the JVM. The exception you see stems from > the fact, that Tomcat creates a new classloader when you "reload" the > weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar > is loaded from the session class loader. Try to add RXTXComm.jar to > your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. > > Regards, > Joachim > > On 31.05.2006, at 10:06, Tom Halbleib wrote: > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL tzNy+/0iIUfkYYgt1+UT1ko= =pkpY -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 04:03:42 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 12:03:42 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D61C3.1030807@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> <447D61C3.1030807@rechnerbetriebsgruppe.de> Message-ID: -Xbootclasspath/a: is a start option to the java vm. Google is your friend in finding how to modfiy it and what it means: tomcat modifying bootclasspath Regards, Joachim On 31.05.2006, at 11:28, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Joachim, > > I'm still not getting it. > How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml- > file? > Perhaps web.xml? > > Regards, > Tom > > Joachim Buechse schrieb: >> Hello Tom, >> >> To the best of my knowledge it is impossible to unload native >> libraries once loaded into the JVM. The exception you see stems from >> the fact, that Tomcat creates a new classloader when you "reload" the >> weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar >> is loaded from the session class loader. Try to add RXTXComm.jar to >> your bootlclasspath (-Xbootclasspath/a:) and the problem should go >> away. >> >> Regards, >> Joachim >> >> On 31.05.2006, at 10:06, Tom Halbleib wrote: >> >> Hi all, >> >> I getting an error while reloading my app in tomcat. At the first >> start >> everything runs well, but if i reload mit webapp by tomcat manager >> i get >> the following error. >> >> java.lang.UnsatisfiedLinkError: Native Library >> C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in >> another classloader thrown while loading gnu.io.RXTXCommDriver >> Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: >> Native >> Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already >> loaded >> in another classloader >> >> >> Is there a possibility to unload the native library rxtxSerial.dll? >> >> thx for all help! >> >> regards >> >> tom > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL > tzNy+/0iIUfkYYgt1+UT1ko= > =pkpY > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From impakt01 at optusnet.com.au Wed May 31 06:55:42 2006 From: impakt01 at optusnet.com.au (Daren) Date: Wed, 31 May 2006 22:55:42 +1000 Subject: [Rxtx] (no subject) Message-ID: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/ade7ad37/attachment-0005.html From doug at dupreeinc.com Wed May 31 10:19:19 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 31 May 2006 09:19:19 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: <447DC207.3070702@dupreeinc.com> I am not sure what you are saying. The Save parameters menu option saves the current settings (baud, data bits, etc.). The long pause (~60 seconds) is when the application first starts (before loading the saved parameters). This does bring up a question, though I hate this type of kludge approach to getting this library to work... What exactly is a PortIdentifier? Is it always the same? If I stored the results from "CommPortIdentifier.getPortIdentifier(PortName);" in a file, could I use this the next time the program is executed? In this case I am using a virtual com port driver to connect to the device through a USB port. Doug YiQi Huang wrote: >Doug, > >In the SerialDemo, it allow us to save the parameters into a file, and use >it when your program start up. Would this help? > >YiQi > >On Tue, 30 May 2006, Jim Redman wrote: > > > >>Lynn, >> >>If I understand your idea correctly, I don't think that this would work >>well for, say, USB ports since these can be easily added/removed by the >>end user. >> >>Jim >> >>lynn at swcp.com wrote: >> >> >>>*IF* the name of the port is supplied, we might want to use the preferences >>>mechanism (java.util.prefs) where we could have previously saved the info for >>>the port. We could do a quick check to see that things have not changed >>>before using it. If things have changed (or never been defined) we would do a >>>full port scan and save detected ports in the preferences. >>> >>>This way if the hardware is not changed, you only pay the time penalty one time. >>> >>>just an idea... >>>Lynn >>> >>> >>>Doug Thistlethwaite said: >>> >>> >>> >>>>This is a multi-part message in MIME format. >>>>--------------070808020900080005070500 >>>>Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>>>Content-Transfer-Encoding: 7bit >>>> >>>>Hello all, >>>> >>>>I also notice this pause (not as long however) when I call: >>>> >>>> CommPortIdentifier.getPortIdentifier(PortName); >>>> >>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process. If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it. >>>> >>>>Thanks, >>>> >>>>Doug >>>> >>>>Doug Thistlethwaite wrote: >>>> >>>> >>>> >>>>>Trent, YiQi, and Jim: >>>>> >>>>>Thanks to all for the replies and information! I am just back from a >>>>>long weekend and I am now trying to figure out what I was doing! :) >>>>> >>>>>As for more information. First off, this example is being run under >>>>>windows XP. I am developing test equipment that communicates with a >>>>>java application via a serial port. I have been using the commapi for >>>>>several years and have not had a problem. Recently, I have started a >>>>>design modification that will replace the RS232 connection with a USB >>>>>port. I am using the ftdi module for prototyping and I discovered >>>>>that their virtual com port driver was not compatible with the commapi >>>>>that Sun released. It turns out that it has problems with hardware >>>>>flow control ( it works on incoming but not outgoing communications). >>>>>The way I figured this out was by experimenting with the SerialDemo >>>>>that was included with the Sum commapi. One nice thing about this >>>>>example is it has the ability to set incoming and outgoing flow >>>>>control independently. >>>>> >>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>>without a hitch (except for the slow startup). >>>>> >>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>>entries in the stack trace are: >>>>> >>>>>testRead() : -1, gnu.io.RXTXCommDriver >>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>>> >>>>>This was all initiated by the following call in the programs init routine: >>>>> >>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>>> >>>>>After looking at this, My guess is that Trent is correct in that the >>>>>delay is in scanning for ports. I guess one solution would be to not >>>>>scan for ports, though it would be nice to detect what is available on >>>>>the system. Is there any way to reduce the number of ports scanned by >>>>>this function in windows XP? >>>>> >>>>>Thanks again for your time, >>>>> >>>>>Doug >>>>> >>>>> >>>>> >>>>--------------070808020900080005070500 >>>>Content-Type: text/html; charset=ISO-8859-1 >>>>Content-Transfer-Encoding: 7bit >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>>Hello all,
>>>>
>>>>I also notice this pause (not as long however) when I call:
>>>>
>>>>        >>>> >>>> >>> CommPortIdentifier.getPortIdentifier(PortName);
>>> >>> >>>>
>>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process.  If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it.
>>>>
>>>>Thanks,
>>>>
>>>>Doug
>>>>
>>>>Doug Thistlethwaite wrote: >>>>
>>>> >>>>Trent, YiQi, and Jim:
>>>>
>>>>Thanks to all for the replies and information!  I am just back from a >>>>long weekend and I am now trying to figure out what I was doing! :)
>>>>
>>>>As for more information.  First off, this example is being run under >>>>windows XP.  I am developing test equipment that communicates with a >>>>java application via a serial port.  I have been using the commapi for >>>>several years and have not had a problem.  Recently, I have started a >>>>design modification that will replace the RS232 connection with a USB >>>>port.  I am using the ftdi module for prototyping and I discovered that >>>>their virtual com port driver was not compatible with the commapi that >>>>Sun released.  It turns out that it has problems with hardware flow >>>>control ( it works on incoming but not outgoing communications).  The >>>>way I figured this out was by experimenting with the SerialDemo that >>>>was included with the Sum commapi.  One nice thing about this example >>>>is it has the ability to set incoming and outgoing flow control >>>>independently.
>>>>
>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>without a hitch (except for the slow startup).
>>>>
>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>entries in the stack trace are:
>>>>
>>>>testRead() : -1, gnu.io.RXTXCommDriver
>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>>
>>>>This was all initiated by the following call in the programs init >>>>routine:
>>>>
>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>>
>>>>After looking at this,  My guess is that Trent is correct in that the >>>>delay is in scanning for ports.  I guess one solution would be to not >>>>scan for ports, though it would be nice to detect what is available on >>>>the system.  Is there any way to reduce the number of ports scanned by >>>>this function in windows XP? 
>>>>
>>>>Thanks again for your time,
>>>>
>>>>Doug
>>>>
>>>>
>>>> >>>> >>>> >>>>--------------070808020900080005070500-- >>>> >>>> >>>> >>> >>> >>> >>-- >>Jim Redman >>(505) 662 5156 x85 >>http://www.ergotech.com >>_______________________________________________ >>Rxtx mailing list >>Rxtx at qbang.org >>http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > >cheers >YiQi Huang >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/61d4d4c9/attachment-0005.html From impakt01 at optusnet.com.au Wed May 31 17:02:54 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 09:02:54 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Message-ID: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Hi all, I downloaded 2.1.7-pre16 and managed to build it and get it going. I made the changes as suggested by Peter Smith in an old post, by adding his code to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. Still not working, it opens the port at 9600 according to portmon.exe . Has anyone managed to get this going at a custom rate? Here is the post I'm referring to: http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 Thanks, Daren ________________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Daren Sent: Wednesday, 31 May 2006 10:56 PM To: rxtx at qbang.org Subject: [Rxtx] (no subject) Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren From tjarvi at qbang.org Wed May 31 21:44:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 May 2006 21:44:01 -0600 (MDT) Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> References: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Message-ID: On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org From impakt01 at optusnet.com.au Wed May 31 22:06:04 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 14:06:04 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: Message-ID: <200606010406.k51464X2010447@mail03.syd.optusnet.com.au> Trent, I have managed to successfully open the port at this speed using Realterm (available on sourceforge). From memory this uses DLPortIO. Using portmon.exe with realterm, even there it says that the port has opened at 1953. I changed termios.c:560 to dcb->BaudRate = 1953 ; and it still opens the port at 9600. Daren -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Thursday, 1 June 2006 1:44 PM To: RXTX Developers and Users Subject: Re: [Rxtx] custom baud rate win32 On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From smontgomery at mediaspansoftware.com Mon May 1 09:52:28 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 11:52:28 -0400 Subject: [Rxtx] RXTX, Java COMM and Windows Server 2003 on x64 experiences? Message-ID: Just wondering if anybody here has had to deploy RXTX or the javax.comm on Windows Server 2003 machines running on x64 (i.e. Xeon EM64T) and would like to relate how things went. From Sun's site, the Supported System Configurations pages give the options for that system: Java 5.0: - 32-bit Java 5.0 running on the OS in the 32-bit mode - 64-bit Java 5.0 running on the OS in the 64-bit native mode Java 1.4.2: - no options listed for EM64T processors, but potentially the standard 32-bit Java 1.4.2 could run on the OS in 32-bit mode? I guess the two main points of failure would be 1) the JVM itself and 2) the jni components. Make that three: there's gotta be hardware vendor driver support for the OS in the various modes, too. Guess I better go look at Keyspan's website... Thanks in advance for any info anyone might be able to provide. From smontgomery at mediaspansoftware.com Mon May 1 10:18:33 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 12:18:33 -0400 Subject: [Rxtx] Mailing list archive out of date? Message-ID: The mailing list archive at: http://mailman.qbang.org/pipermail/rxtx/ only shows emails through the end of March. Is there a new archive somewhere else? Didn't see anything mentioned on the wiki. From p.cain at phasefale.com.au Mon May 1 22:33:09 2006 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 02 May 2006 14:33:09 +1000 Subject: [Rxtx] RXTX and the Linux kernel. Message-ID: <4456E105.5080106@phasefale.com.au> Hi, First off the problem I am having isn't caused by RXTX itself but I'm hoping someone out there may have some knowledge that may help me. Background: I have an application monitoring a control system through a standard PC serial port which I talk to with rxtx-2.0.5. The application runs on RedHat7.3 kernel version 2.4.18 using Java 1.4. This configuration has been in use for several years and has proved to be stable. But it has become necessary for me to upgrade the OS but I'm running into problems with the serial communications. Its not that the comms don't work on the new OS (its never that simple) the comms work for a variable period of time (sometimes several hours) and then just stop, nothing on the data lines and control lines all indicate that data could flow. The new OS is Ubuntu 5.10 running kernel version 2.6.12. I have installed the OS and software on a PC and had it perform ok, then install the new OS and same software on the very same hardware and experienced the problems of them comms stopping. In the new OS I'm using Java5 to run the app but since I have experience the problem I reverted back to Java1.4 which didn't fix the problem. I've moved the app to a different system RedHat FC3 running 2.6.14 had experienced the problem. Not wanting to go through all the thing I have tried but I have established that it seems to be the 2.6 versions of the kernel that seem to be the problem and not an individual distribution of Linux. I should point out that I am using the same jar and library files for each java and OS combination. So I'm just wondering if anyone has had or heard of problems similar to these ? Or perhaps might know of what changed in the Linux serial driver (something I'm having a hard time establishing). I'm starting to run low on ideas of what to try so any help would be much appreciated. -- Peter Cain Senior Programmer Phasefale Pty Ltd From tjarvi at qbang.org Wed May 3 07:31:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 May 2006 07:31:00 -0600 (MDT) Subject: [Rxtx] Re: Concering ircomm and RXTX In-Reply-To: References: Message-ID: On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From legolas.w at gmail.com Wed May 3 08:46:23 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 19:16:23 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <4458C23F.2000003@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From legolas.w at gmail.com Wed May 3 13:10:57 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 23:40:57 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <44590041.80706@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From Lars.Hennig at wow-portal.com Thu May 4 00:39:15 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Thu, 4 May 2006 08:39:15 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: Message-ID: Hi, I could not find any solution. I therefore decided to to my own native implementation. Allthough it only supports the functions I need, it works pretty well now for me. I think the main problem there is the use of a wrong Windows API function and not setting an timeout. Regards, Lars Hennig W?rth Online World GmbH Tel. (0049)7181-258183 Mob. (0049)160-3522889 Fax. (0049)7940-153299 Lars.Hennig at wow-portal.com Gesendet von: rxtx-bounces at qbang.org 09.04.2006 10:42 Bitte antworten zu RXTX Developers and Users An d.herwald at dsh-elektronik.de, RXTX Developers and Users Kopie Thema Re: [Rxtx] USB Serialport - disconnection problems WV Proj./Teilpr.: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/7b39f374/attachment-0006.html From Pawan.Kharbanda at dot.state.co.us Thu May 4 11:00:58 2006 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Thu, 4 May 2006 11:00:58 -0600 Subject: [Rxtx] Dangling Lock Files Message-ID: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Hi, I have been using RXTX API's for the Serial Communication for quite some time now and for some of the devices we are opening and closing the connection every 2 minutes. This works great for few days and then suddenly I start seeing some "Port in Use Exception" and I see that the Lock files are still in the /var/lock folder after manually removing the lock files it works good for few hours and I see the same problem again. Can somebody explain me the scenarios why I am seeing the dangling Lock files? I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise Servers. Thanks Pawan Kharbanda -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/ba0e9261/attachment-0006.html From tjarvi at qbang.org Thu May 4 14:10:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:10:30 -0600 (MDT) Subject: [Rxtx] Dangling Lock Files In-Reply-To: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> References: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Message-ID: On Thu, 4 May 2006, Kharbanda, Pawan wrote: > Hi, > I have been using RXTX API's for the Serial Communication for quite > some time now and for some of the devices we are opening and closing the > connection every 2 minutes. This works great for few days and then > suddenly I start seeing some "Port in Use Exception" and I see that the > Lock files are still in the /var/lock folder after manually removing the > lock files it works good for few hours and I see the same problem again. > Can somebody explain me the scenarios why I am seeing the dangling Lock > files? > > I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise > Servers. Hi Pawan The next time it happens, look in the lockfile. There will be a pid. ps aux |grep 'pid' I think you will see that the application is still running for some reason. RXTX does a kill -0 on the pid to see if its alive. If not, it will remove the lockfile. So I suspect the previous program did not exit as you expected. -- Trent Jarvi tjarvi at qbang.org From Scott.Hughes at dalsemi.com Thu May 4 14:23:11 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 4 May 2006 15:23:11 -0500 Subject: [Rxtx] Wiki instructions... Message-ID: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire demo apps, when I stumbled across this tip on the wiki to add yourself to the uucp group: It may be simpler to just run usermod -G uucp jarvi Taken from: http://rxtx.qbang.org/wiki/index.php/Installation This does not work as advertised. I should have read the man page for usermod before I tried that out. If there are any groups which are not listed after the -G switch, the user is removed from those groups. On Ubuntu, this is bad... I removed myself from the Admin group, which removed my sudo priviledges. Ubuntu has no root account, so I've disabled the only account which could fix it. Anyone know of a good workaround? Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor From tjarvi at qbang.org Thu May 4 14:32:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:32:09 -0600 (MDT) Subject: [Rxtx] Wiki instructions... In-Reply-To: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> Message-ID: On Thu, 4 May 2006, Scott Hughes wrote: > I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire > demo apps, when I stumbled across this tip on the wiki to add yourself to > the uucp group: > > It may be simpler to just run > > usermod -G uucp jarvi > > Taken from: > http://rxtx.qbang.org/wiki/index.php/Installation > > This does not work as advertised. I should have read the man page for > usermod before I tried that out. If there are any groups which are not > listed after the -G switch, the user is removed from those groups. On > Ubuntu, this is bad... I removed myself from the Admin group, which removed > my sudo priviledges. Ubuntu has no root account, so I've disabled the only > account which could fix it. > > Anyone know of a good workaround? > Yikes This will get your permissions back: in grub/lilo/.. pass the following option to the kernel init=/bin/sh You are now root. when it boots, mount -o remount,rw / add yourself to the groups, reboot to get normal init going. Thats about all I can think of without sudo/root. -- Trent Jarvi tjarvi at qbang.org From Gettings at earth.utah.edu Thu May 4 14:41:22 2006 From: Gettings at earth.utah.edu (Paul Gettings) Date: Thu, 4 May 2006 14:41:22 -0600 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <20060504204122.GA6534@earth.utah.edu> When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get messages on stdout from the JVM: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 As the only change was the version of RXTX (from 2.1.6), I am unsure why the messages suddenly appeared. Anyone know how to get rid of them? Thanks. -- 101 USES FOR A DEAD MICROPROCESSOR (23) Dead cat brush From mmester at sps.edu Mon May 1 21:22:28 2006 From: mmester at sps.edu (Michael Mester) Date: Mon, 1 May 2006 23:22:28 -0400 Subject: [Rxtx] Windows PortInUseException Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> I'm trying to get simple serial communication going with RxTx under Windows XP. I can enumerate the ports fine, but I always run into problems when I try to open one. I get a PortInUseException, but the owner application is "Unknown" and the port is never open. I've tried this on several different systems and all of them give the same behavior. The only thing I can thiunk of that might be causing the problem is that fact that I had to put the serial .dll file in system32 instead of the reccommended folder, because it didn't work in the folder the documentation gives. The library loads fine, though, so I'm not sure whether that makes sense, and I don't know how to fix it anyway. Any help is greatly appreciated. Below is the output of the program, right up to the PortInUseException and the NullPointerException it causes (because the serial port object is not instantiated). C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI Starting GPSTalkerGUI... Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 gnu.io.PortInUseException: Unknown Application Exception in thread "main" java.lang.NullPointerException at GPSTalkerGUI.(GPSTalkerGUI.java:102) at GPSTalkerGUI.main(GPSTalkerGUI.java:161) Again, thank you very much for any help you can give. From lshellman at qwest.net Wed May 3 01:38:34 2006 From: lshellman at qwest.net (Lucious Shellman) Date: Wed, 03 May 2006 01:38:34 -0600 Subject: [Rxtx] Help needed: Project using parallel port Message-ID: <1146641914.8337.14.camel@localhost.localdomain> I was looking for a way to access the parallel port on a PC using Java. Searching the Internet, I came across this site (rxtx.org). What I am trying to do is detect logic levels from a TTL logic IC on the parallel port. I am not trying to do classic parallel port communication. I just want to detect whether a line(s) is (are) high or low. I am using Windows 98. Can rxtx be used to do this? If yes, is there a tutorial for using rxtx posted on the Internet that someone can direct me to. If you need more information, feel free to e-mail me. Unfortunately for me, I need the information ASAP. Thanks. lshellman at qwest.net From webmaster at egyhelp.com Wed May 3 18:43:39 2006 From: webmaster at egyhelp.com (Mohamed Samy) Date: Thu, 4 May 2006 02:43:39 +0200 Subject: [Rxtx] RE: Concering ircomm and RXTX In-Reply-To: Message-ID: <20060503184362.SM01044@Geek> Hey, I issue the command "modprobe ircomm-tty" yet no ttyircomm appears, while the ircomm appear by "modprobe ircomm" so forgive me but I am bit lost. Even searching google for the keyword "ttyircomm" only returns 3 matches. So any way I can start the ttyircomm???? Thanks a lot. -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Wednesday, May 03, 2006 3:31 PM To: Mohamed Samy; rxtx at qbang.org Cc: taj at www.linux.org.uk Subject: Re: Concering ircomm and RXTX On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 4 15:49:49 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 15:49:49 -0600 (MDT) Subject: [Rxtx] Windows PortInUseException In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> Message-ID: On Mon, 1 May 2006, Michael Mester wrote: > > I'm trying to get simple serial communication going with RxTx under > Windows XP. I can enumerate the ports fine, but I always run into > problems when I try to open one. I get a PortInUseException, but the > owner application is "Unknown" and the port is never open. I've tried > this on several different systems and all of them give the same > behavior. The only thing I can thiunk of that might be causing the > problem is that fact that I had to put the serial .dll file in system32 > instead of the reccommended folder, because it didn't work in the folder > the documentation gives. The library loads fine, though, so I'm not sure > whether that makes sense, and I don't know how to fix it anyway. Any > help is greatly appreciated. Below is the output of the program, right > up to the PortInUseException and the NullPointerException it causes > (because the serial port object is not instantiated). > > C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI > Starting GPSTalkerGUI... > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > gnu.io.PortInUseException: Unknown Application > Exception in thread "main" java.lang.NullPointerException > at GPSTalkerGUI.(GPSTalkerGUI.java:102) > at GPSTalkerGUI.main(GPSTalkerGUI.java:161) > Perhaps you are trying to open the port twice in your code? rxtx does open the ports, do a timed out read and then close the ports during enumeration. I think the port is being opened fine. The Unknown Application is always reported. On linux, there is some code that finds the actual application but on windows, its always unknown. If the port enumeration is returning the ports you expect, rxtx has opened the port and closed it with success. The port should open. There is also example code in the contrib directory that comes with rxtx source that has examples you can modify to work. -- Trent Jarvi tjarvi at qbang.org From Christian.Klemke at t-online.de Thu May 4 23:37:23 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Fri, 5 May 2006 07:37:23 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu> Message-ID: <004f01c67005$fc72fee0$016a10ac@NB600> Hi Paul, I was wondering about the same question some days ago and took a look at the source files. Unfortunately, I found that you can only get rid of that messages by altering and recompiling the Java code. There is a final static boolean variable called "devel" in the file "RXTXCommDriver.java" which is set to "true". This constellation causes the output after the native libraries have been loaded. No mechanism exists to suppress them otherwise :-(. Trent, does that mean that 2.1.7 is still officially a "development" version ? When will this value be changed to "false" by default ? With 2.1.8 ? It would be nice to provide a means to suppress such messages besides that static flag (maybe by setting a property called "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The output can indeed by annoying, especially when used with console applications, where the message potentially appears "in the middle" of your own output. Another possibility would be not to use System.out directly, but instead some PrintStream field which is initially set to System.out but can programatically be changed. That would allow for any kind of redirection or suppression by implementing appropriate user-defined PrintStream subclasses and making RXTX use that stream. What do you think ? Best regards, Christian ----- Original Message ----- From: "Paul Gettings" To: Sent: Thursday, May 04, 2006 10:41 PM Subject: [Rxtx] RXTX causing stdout messages > When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get > messages on stdout from the JVM: > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > As the only change was the version of RXTX (from 2.1.6), I am unsure > why the messages suddenly appeared. Anyone know how to get rid of > them? > > Thanks. > > -- > 101 USES FOR A DEAD MICROPROCESSOR > (23) Dead cat brush > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri May 5 06:09:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 06:09:46 -0600 (MDT) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <004f01c67005$fc72fee0$016a10ac@NB600> References: <20060504204122.GA6534@earth.utah.edu> <004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: On Fri, 5 May 2006, Christian Klemke wrote: > Hi Paul, > > I was wondering about the same question some days ago and took a look at the > source files. Unfortunately, I found that you can only get rid of that > messages by altering and recompiling the Java code. There is a final static > boolean variable called "devel" in the file "RXTXCommDriver.java" which is > set to "true". This constellation causes the output after the native > libraries have been loaded. No mechanism exists to suppress them otherwise > :-(. > > Trent, does that mean that 2.1.7 is still officially a "development" version > ? When will this value be changed to "false" by default ? With 2.1.8 ? It > would be nice to provide a means to suppress such messages besides that > static flag (maybe by setting a property called > "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The > output can indeed by annoying, especially when used with console > applications, where the message potentially appears "in the middle" of your > own output. Another possibility would be not to use System.out directly, but > instead some PrintStream field which is initially set to System.out but can > programatically be changed. That would allow for any kind of redirection or > suppression by implementing appropriate user-defined PrintStream subclasses > and making RXTX use that stream. What do you think ? > A patch for using properties would be accepted I'm sure. The reason the default is to display the message is not related to the development state of rxtx anymore. The problem is that people first using rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. The message prevents a great deal of email thats easily explained by the message. I question if we should support rxtx 2.0 at all anymore. If you post a patch in bugzilla, we'll put it into CVS this weekend. we'll be going through and doing such things anyhow. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri May 5 13:23:56 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 13:23:56 -0600 (MDT) Subject: [Rxtx] How to read from RxTx parallel port in Win XP In-Reply-To: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> References: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> Message-ID: On Thu, 27 Apr 2006, Worsley, Bob (Development Engineer) wrote: > I'm sorry if this is a dumb question, but I didn't find the answer in > the archives. > > I'm using the RxTx binaries for Windows on a reasonably current notebook > PC running Windows XP. I can send stuff to a printer on the parallel > port (LPT1), but I can't get anything back. > > I wrote a class that has the methods listed below. I write some data to > the printer with the "write" method and then try to read a response > using the "read" method, but I never get any data. I'd greatly > appreciate any help you can give! > > Bob Worsley > bobwoyid2 at yahoo.com > > > > > private ParallelPort parallelPort = null; > private RXTXCommDriver parallelPortDriver = null; > > > public boolean initialize() throws IOException { > if (parallelPort != null) { > return false; // Already initialized > } > > // Create the parallel port; > parallelPortDriver = new RXTXCommDriver(); > parallelPort = > (ParallelPort)parallelPortDriver.getCommPort(address, > CommPortIdentifier.PORT_PARALLEL); > > // Set the parallel port parameters. > try { > parallelPort.enableReceiveTimeout(READ_TIMEOUT); > parallelPort.disableReceiveFraming(); > parallelPort.disableReceiveThreshold(); > //parallelPort.setMode(mode); !!!!errors > } catch (UnsupportedCommOperationException e) { > throw (new IOException("Parallel port with address '" + > address > + "' cannot be configured as specified")); > } > > return true; > } > > > > public void write(final byte[] bytes) throws IOException { > initialize(); > while (busyReading) { > Thread.yield(); > } > busyWriting = true; > if (bytes.length < 1) { > return; > } > OutputStream outputStream = parallelPort.getOutputStream(); > outputStream.write(bytes); > outputStream.flush(); > outputStream.close(); > Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); > busyWriting = false; > } > > > public byte[] read() throws IOException { > > // Read up to MAX_BYTES bytes. > initialize(); > while (busyWriting) { > Thread.yield(); > } > busyReading = true; > byte[] buff = new byte[MAX_BYTES_READ]; > InputStream inputStream = parallelPort.getInputStream(); > // This read blocks until input data is available > int bytesRead = inputStream.read(buff); > inputStream.close(); > // If no data read, create empty array > if (bytesRead == -1) { > bytesRead = 0; > } > byte[] deviceBytes = new byte[bytesRead]; > System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); > if (bytesRead > 0) { > Debug.p("PPIOP.read - got data: '" + new > String(deviceBytes) + "'"); > } > busyReading = false; > return deviceBytes; > } > Hi Bob I've only used rxtx to test a hello world page printing but there are others that have used it. PPIOP? hmm what is this? :) The rxtx parallel support is behind the serial support but should be OK. As you note, the setting of modes is not supported. rxtx uses what is provided when the port is open. Are your asserting the pin for the printer being online? I suspect what often happens is people try to just use the data pins but the C API rxtx uses wants the printer to be online. There should be some posts relating to this in the rxtx mail-list archive. Some APIs are probably reading and writing from the port address (also suggested in your code as something you are looking at). RXTX currently uses a higher level C/C++ API for port access. This can still work if the API thinks the 'printer' is there. -- Trent Jarvi tjarvi at qbang.org From agrodellic at gmail.com Sat May 6 08:39:40 2006 From: agrodellic at gmail.com (Leigh Stewart) Date: Sat, 6 May 2006 10:39:40 -0400 Subject: [Rxtx] sun commapi 3 Message-ID: I think I read here: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html that rxtx-2.0 is basically fracked for now? Does anyone know of a workaround? ie can i somehow get an older version of sun's comm api and use that (not easy to find)? i mean 2.0 must be working for someone...how is it being tested. 2.1 isnt working for me....im getting nasty native exceptions etc, which is why im so set on 2.0... any ideas? From tjarvi at qbang.org Sun May 7 15:40:27 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 7 May 2006 15:40:27 -0600 (MDT) Subject: [Rxtx] sun commapi 3 In-Reply-To: References: Message-ID: On Sat, 6 May 2006, Leigh Stewart wrote: > > 2.1 isnt working for me....im getting nasty native exceptions etc, > which is why im so set on 2.0... any ideas? > Hi Leigh What native exceptions are you seeing? Which OS? The native code is almost identical between rxtx 2.0 and 2.1. Only the names have been changed to protect the inocent. :) ie: javax_comm_... vs gnu_io_... So the odds are very likely that even if you do find commapi 2.0 and get it installed, you will run into the same error. It would be better to just find and fix the problem. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Mon May 8 10:47:20 2006 From: mail at willicon.de (WILLICon) Date: Mon, 08 May 2006 18:47:20 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 Message-ID: <445F7618.3070303@willicon.de> Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/ef37e8ec/attachment-0006.html From tjarvi at qbang.org Mon May 8 16:14:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 May 2006 16:14:51 -0600 (MDT) Subject: [Rxtx] Screenshot of Application using RXTX (fwd) Message-ID: Just though someone may end up searching for 0x0D and 0x0A. Here are the details from his system. SuSE Linux 10.0 (x86_64) Kernel 2.6.13-15.8 j2se 1.4.2_11 (i586) Sun: comm3.0_u1 rxtx: rxtx-2.1-7 ---------- Forwarded message ---------- Date: Sat, 6 May 2006 20:01:46 +0200 From: Michael Poppitz To: taj at www.linux.org.uk Subject: Screenshot of Application using RXTX Hi Trent, the rxtx package works like a charm. Sun's package seemed to replace all 0x0D with 0x0A in received data on my Linux box, which is really annoying when transfering binary data. But rxtx came and saved the day - and turned out to be a lot more convenient as it does not require a configuration file. I use it for connecting to a home made logic analyzer. (http://www.sump.org/projects/analyzer/) Thanks for your great job, Michael -------------- next part -------------- A non-text attachment was scrubbed... Name: la_client.png Type: image/png Size: 16592 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/45494fbb/la_client-0006.png From tjarvi at qbang.org Tue May 9 14:56:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 May 2006 14:56:05 -0600 (MDT) Subject: [Rxtx] RXTX javax.comm: which one to install? In-Reply-To: <20060509161742.43547.qmail@web53814.mail.yahoo.com> References: <20060509161742.43547.qmail@web53814.mail.yahoo.com> Message-ID: On Tue, 9 May 2006, Adenilson Cavalcanti wrote: > Dear Trent Jarvi > > I'm trying to write a small Java app running in linux that interfaces with a device connected to serial port. > > I do have some questions about RXTX and javax.comm state of affairs, since I'm new to Java programming (used to program in plain old C writting to devices using termios and open/write/read syscalls, but this is another story). > > I ask you the favor to clarify this issues (if possible...): > > a) Sun offers to download a file (comm3.0_u1_PUTAUNIXVERSION.zip) which does contain .so files. Does it work out of box? > > b) Case negative, its there that we should use 'librxtx*.so' provided by your site? > > c) Sun's comm3 API version does work with which version of rxtx? > > I already searched google and read documentation available in rxtx site ("Java Comm Serial API How-to") but still have this issues unsolved. Any help will be appreciated. > > Best regards > > Adenilson Hi Adenilson, RXTX does not currently support javax.comm in Sun's CommAPI 3.0. I would recommend using package gnu.io provided by rxtx 2.1. -- Trent Jarvi tjarvi at qbang.org From chris.develder at intec.ugent.be Wed May 10 08:45:40 2006 From: chris.develder at intec.ugent.be (Chris Develder) Date: Wed, 10 May 2006 16:45:40 +0200 Subject: [Rxtx] rxtx troubles on ARM Message-ID: <4461FC94.6040909@intec.ugent.be> Hi all, Sorry to bother you, but I don't seem to get RXTX working on an ARM processor (xscale ixp 425, big endian). I managed to crosscompile the rxtx libs and moved it over to the ARM. Using jamvm (which is the only open source java VM we got working on the ARM), I get the following error result when running SimpleRead from Sun's javax.comm examples (commapi\examples\Simple\SimpleRead) -- see bottom of mail for complete output: "java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver" However, output shows that the RXTXCommDriver code is accessible (cf. debug and devel output of lib versions). So it doesn't seem to be a missing lib/jar issue. The error happens before RXTXCommDriver.initialize() is called, since the first line there is System.out.println("RXTXCommDriver:initialize()"); Any ideas? Cheers, Chris ---------------------------- [root at xxx(ttyp1) /work/cdvelder/xscale/test]# jamvm -Djava.library.path=/work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/jre/lib/arm -classpath /work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/lib/ext/RXTXcomm.jar:./comm.jar:. SimpleRead RXTXCommDriver {} Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTXCommDriver: Jar version = RXTX-2.1-7 native lib Version = RXTX-2.1-7 java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver gnu/io/RXTXCommDriver at javax.comm.CommPortIdentifier.loadDriver (CommPortIdentifier.java:239) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:109) at SimpleRead.main (Unknown Source) java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive (Native Method) at com.sun.comm.Portmapping.registerCommPorts (Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase (Portmapping.java:100) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:138) at SimpleRead.main (Unknown Source) From joachim at buechse.de Fri May 12 00:44:48 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 08:44:48 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) Message-ID: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Good day, I guess that only a selected few (hi Trent) will be able to answer this question, but the answer might be interesting for anyone trying to debug or understand the code. Apparently the MonitorThread is started and stopped in RXTXPort.addEventListener and RXTXPort.removeEventListener. This would indicate that (originally?) the MonitorThread is only required when there is an EventListener. However the MonitorThread is also started in the RXTXPort constructor, which could mean that RXTX won't work at all if it isn't there. It seems to me, that if anyone would add an event listener and later on remove it, he could potentially wreak the port. Because the second action would kill the MonitorThread. For the moment I am only trying to understand the role of and idea behind the MonitorThread. But of course there is a deeper reason thor my question: If the MonitorThread needs to exist anyway, it could be the thread that cleans up the port (ie calls nativeClose) - this would eliminate (a further) problem I am seeing with some USB drivers on Mac OSX. (Close blocks (after releasing the tty, but still) in the USB driver if the device is "not responding"). Greetings, Joachim From tjarvi at qbang.org Fri May 12 07:10:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 12 May 2006 07:10:59 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Fri, 12 May 2006, Joachim Buechse wrote: > Good day, > > I guess that only a selected few (hi Trent) will be able to answer > this question, but the answer might be interesting for anyone trying > to debug or understand the code. > > Apparently the MonitorThread is started and stopped in > RXTXPort.addEventListener and RXTXPort.removeEventListener. This > would indicate that (originally?) the MonitorThread is only required > when there is an EventListener. However the MonitorThread is also > started in the RXTXPort constructor, which could mean that RXTX won't > work at all if it isn't there. > > It seems to me, that if anyone would add an event listener and later > on remove it, he could potentially wreak the port. Because the second > action would kill the MonitorThread. > > > For the moment I am only trying to understand the role of and idea > behind the MonitorThread. But of course there is a deeper reason thor > my question: > > If the MonitorThread needs to exist anyway, it could be the thread > that cleans up the port (ie calls nativeClose) - this would eliminate > (a further) problem I am seeing with some USB drivers on Mac OSX. > (Close blocks (after releasing the tty, but still) in the USB driver > if the device is "not responding"). > Hi Jaochim Before commapi, rxtx did not support events. You could read, write and change port settings. The MonitorThread was added as an afterthought to support commapi events. So the way things are now his historical spaghetti not a well devised plan. It is my opinion that the MonitorThread should exist as long as the port is open. The odd starting of the thread in the constructor and addEventListener was just to get past the obvious problem of people using the port without adding listeners. -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Fri May 12 07:59:50 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 15:59:50 +0200 Subject: [Rxtx] MonitorThread -> ChangeRequest In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: <2B1E508C-8CEE-4AB7-914D-E7BA25C871A2@buechse.de> In this case I suggest removing the starting/stopping of MonitorThread in addEventListener / removeEventListener. This should not affect existing projects. On 12.05.2006, at 15:10, Trent Jarvi wrote: > It is my opinion that the MonitorThread should exist as long as the > port > is open. The odd starting of the thread in the constructor and > addEventListener was just to get past the obvious problem of people > using > the port without adding listeners. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Fri May 12 11:43:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 19:43:21 +0200 Subject: [Rxtx] Spring Cleaning - some suggestions Message-ID: The current implementation of RXTX contains quite a lot of code that will break if it is used from several threads (especially on a multi processor machine). I think it would be nice to clean this up. I suggest the following changes (which keep the current semantics and should not influence existing projects in a negative way): - InterruptedException will never be ignored or reset - read methods will be protected with a Monitor - write methods will be protected with a (separate) Monitor - close() sets the read and write monitors into a "closed" state which will lead to IOExceptions for any following call to RXTXPort.read/write. - close() will wait a finite amount of time (maybe 500ms) for the release of the read and write monitors after that, it will trigger the closing of the file descriptor to abort any pending read or write. - close() will not call close(file_desc). Instead it will "interrupt" (ie set a flag and then, pthread_kill(ABRT)) the MonitorThread, the MonitorThread will call close(file_desc). - the monitors are properly released in a finally block the try of which starts directly after obtaining the monitor. - finally will not call close(file_desc) it will only "interrupt" the MonitorThread (see above) - the native-code (esp read) does not use SA_RESTART but checks Thread.interrupted() when it receives a SIGNAL (ie system call returns with EINTR or other signalling method). The read/write monitors will be allocated from a factory whose mode can be set to fast/normal/advanced. In fast-mode it will create "non thread safe, non synchronized" pseudo-monitors. In default mode, the monitors will store the owning thread. In "advanced" mode setting the monitors into closed state will "interrupt()" threads which are blocked in a native read/write. {Reasoning close behaviour: Calling close on a file descriptor in Windows unblocks any read() or write() on the same file descriptor with an error. On Solaris < 2.7 and MacOS X however the close() will/ can block - until the read or write have finished:-(( Even the JDK people have trouble with this. I dont know how Linux reacts in this case. The best practice for BSD/Solaris is to send a signal to the thread which will usually unblock the read/write with an EINTR - this however is not guarenteed as it also depends on the device driver. So the only resolution that will certainly not block the thread calling RXTXPort.close() (which will often enough be the AWT event dispatcher or the VM finalizer thread) is to call close(fd) from another thread.} {Reasoning read behaviour: It is rather uncommon to receive a signal while reading or writing - it will happen, but checking Thread.interrupted() when it happens will not degrade performance. The checking of Thread.interrupted() can be handled by returning to Java and potententially reentering into the native code if the thread was not interrupted or by calling back into the VM from the native code. On top of this, many functions like read(byte[]) or read(byte [], int, int) are allowed to return less than the requested amount of data. Only int read() is a bit more tricky. } [Trent: From the code I can tell, that you experimented quite a bit with signals. Do you know if the Java Thread.interrupt() triggers a unix signal on Linux/Solaris? If so, which one?? References: - http://java.sun.com/docs/hotspot/VMOptions.html - http://www.hp.com/products1/unix/java/infolibrary/prog_guide/ signals.html ] On OS X (hotspot client jdk-1.4.2) I did not see any signal propagated to the SELECT of the event_loop/MonitorThread (ie no EINTR) when I call monThread.interrupt(). This is a pitty, but thats the way it is. I simply assume this is true for most system calls. How to handle this? Of course it would be possible to install/ deinstall a specific signal handler before/after every native read and to natively send an ABRT signal if RXTXPort.close is called. A more elegant solution might be to have an additional "signaling" socket which is always included in the SELECT. Or the simplest solution: cap the timeout of the select to 500 ms (the loop around it exists already) after every timeout check the Thread.interrupted() flag. From a performance perspective this should be completely invisible... On the other hand, all write() calls need to be preceeded by a SELECT as well, to avoid running into a blocking write. Best regards, Joachim From lyon at docjava.com Sat May 13 05:54:52 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 13 May 2006 07:54:52 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Dmitry suggests that we acquire an implementation of a serial port reference, use it, then release it (i.e., check it back in). Joachim says that making serial ports thread friendly might be a good idea. This is a good idea. The design pattern that is close to this idea is the "Object Pool Design Pattern". # Object Pool Manage the reuse of objects for a type of object that is expensive to create or only a limited number of a kind of object can be created. It has been described at: http://www.developer.com/java/ent/article.php/626171 and in Marks' book, Patterns in Java, Volume 1. However, the Object Pool is intended to pool objects so that each object is just like every other object. The intent of the Parametric Singleton is to enable others to access the same resource at the same time (as long as the same parameters were used in construction). It sounds like we need a NEW Design Pattern (Oh no, Doug is doing it again!). Yes friends, you got me on a role (roll) :) If you like design patterns, you can thank me later. If you don't like design patterns, blame Dmitry, it was his idea ;) And Dave, thanks for the feedback on Singleton abuse. It has led me to change the way I think about application contexts, which we will see, below. We need (drum roll please): The Parametric Object Pool Design Pattern (POP) By Douglas A. Lyon ABSTRACT The goal of the Parametric Singleton design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values, in a given context. In comparison, the goal of the POP design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values and that only one reference to the class is checked out at a time, in a given context. A context is a namespace for holding identifiers during execution. In Java, A context can be changed in any of several ways. For example, creation of a new class loader, the deserialization of an old POP or the creation of a new process all create a new namespace. The POP Design Pattern combines the Parametric Singleton Design Pattern with the check out mechanism of the Object Pool Design Pattern. This enables unique creation of instances of a class. These instances are cached in a table. When a clients asks for an instance with these parameters, the cache is checked. If the instance is not in the cache it is created. If the instance is available, the clients checks out the instance. A reference is left to the clients that checked out the instance. The POP has the role of creating objects uniquely, from parameters. It also has the role of keeping track of which clients has checked out a given object. This is just like a library keeping track of who borrowed a book. If a resource is left unavailable in a system, a deadlock can occur. Deadlock debugging is facilitated by mapping a resource to the clients that have checked it out. We apply our POP Design Pattern to the retrieval of serial ports. The goal of our system is to make sure that serial ports are checked out to only one client at a time, and that they be checked back in when the client is done. The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. Users are discouraged from calling this the Parametric Object Oriented Pool (POOP). Introduction The intent of the POP Design Pattern is to ensure that a class has only one instance for a given set of parameter values. It also provides a point of access that is global to a given context. The POP uses the Singleton Design Pattern to ensure that there is only one POP, in the given context. The POP DP is responsible for checking out a reference to a given instance, and keeping track of that instance. The instance is responsible for sharing that instance. POP requires that users of the DP implement an interface that enables a recall facility. Thus, if there is a contention for a consumed resource, the deadlock can be resolved in an orderly fashion. Motivation A system cannot tolerate multiple instances of some classes with identical parameters used by different instances at the same time. For example, you cannot have two instances use the same serial port, at the same time. You cannot have two instances that are trying to listen to the same socket connection. You cannot have two instances writing to the same file structure at the same time. Further, once a serial port is checked out by a client, it is assigned to the client. This is like the spin-lock service provided by the operating system, only in the application layer. Naturally, deadlock will occur if a resource is not released, therefore the client of the resource is tracked. Recalling a resource is required for the POP DP by virtue of the implementation of an interface. The policy on how to break a deadlock (by honoring the recall) is application specific. As the operating system is often thought of as the arbiter of consumed resources (i.e., tape drives, serial ports, etc.) we frequently leave it to an operating system implementation to resolve these contention issues. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on naming conventions (which are not well standardized). The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. The POP Design Pattern can take on the role of the peer method mapper that homogenizes the API for different operating environments. That is, it can wrapper the different locking mechanisms used in different operating systems. POP that is responsible for keeping track of the instances created and the client that has checked them out. The POP Design Pattern is implemented using the Singleton Design Pattern. In Java, the POP implementation is declared final, so that it cannot be subclassed. The class also has a private constructor, so that other classes cannot instance it. The new design pattern is called the POP design pattern and it provides a way to check out and create instances with given parameters. Applicability Use the POP Design Pattern when: 1. There must be exactly one instance of a class with the given parameters in a given context. 2. The instances must be accessible to clients from a well-known access point. 3. The instances are reusable. 4. Only one client can check out an instance at a time. Structure Insert UML diagram here. Participants The POP Clients that need instances 1. The POP defines an instance upon request from a client, if, and only if, the instance does not already exist. 2. The POP returns the instance to the client. 3. The POP is responsible for creating unique instances from given parameters. 4. The POP is responsible to recalling instances from clients. Collaborations Clients obtain a reference to a POP instance only through the singleton design pattern. If the POP instance is left in an improper state (e.g., the serial port was left open) it is NOT the role of the POP to close the IO port. However, the POP can be requested to get the instance released. Nor is it the role of the POP Design Pattern to open the port. That role is delegate to some other part of the system. Further, it is the role of the POP Design Pattern to check out resources. However, it is still possible to have, multiple threads that have multiple references to the same resource at the same time. Checkout and resource requests are MUTEX locked (i.e., synchronized). Consequences The POP Design Pattern has several benefits: 1. Controlled access to parametrically defined instances. Since the POP encapsulates its instances, there is some limited control over how and when clients access it. 2. Reduced name space. The POP pattern avoids global variables that store instances created from the same parameter. Implementation Here are implementation issues to consider when using the POP pattern: 1. Unique mapping of parameters. The POP pattern requires that there be a mean to isomorphically map the parameter space into the instance space and back again. 2. Ensure unique instances. The POP pattern makes unique instances from parameters, and it does so only once. 3. Cache instances for fast retrieval. The POP must be able to look up instances, given some set of parameters, and do so from some data structure. That is, there must be enough space to hold references to all the instances the program will need. Also, a mechanism is needed to look up and retrieve the instances quickly enough to satisfy the clients. Sample Code To be written....any volunteers? Thanks! - Doug >I don't think I get it > >On Mar 22, 2006, at 9:36 AM, David Garnier wrote: >>Using the singleton pattern in this case is >>just convenient for the programmer. Problems >>arises >>pretty quickly, especially if you attempt to unit-test your classes. > > >so you're saying that something isn't so good >because you can not test it in the convenient >way? >if that's true, I'm totally disagree >change your test, debug whatever, but if >software is efficient at runtime, works fine and >only problem is some unit test >(which is some kind of framework for testing) >then dump that unit test , dump that unit >framework and make something appropriate to the >software >you're testing > >so if Douglas want to use singletons, what's the problem? >and what do you mean by abusing of singleton usage? > >of course singleton doesn't prevent concurrent >access to the resource across the processes >unless >you're using some OS facility to prevent it, besides >singleton as it was introduced is relevant only >and only inside of the same process >otherwise it's not singleton it's something else >(let's say network singleton: so you have remote >invocation facility >and some factory method that return object created by that facility) > >I don't have any problem with using any kind of singletons. > Parametric Singleton idea (if I understand it >right) could be easily implemented in the >following way: >use a map >populate map with instances of some class and key is your parameter >(you can use lazy population too) > >if somebody ask the key check the value if it's null so resource is taken >if somebody returns the resource put it back to the map > >public synchronized static Object getSomeResource(Object parameter); >public synchronized static void returnResource(Object parameter); > >getSomeResource (inside of the same process) could return null in 2 cases >1. if somebody (from other thread for example) already took that resource >2. if OS API said that resource corresponded to >that parameter (serial port with parameter = 1 >(port #)) >is locked and unavailable; >I'm not sure that in case of serial ports we >even need those Parametric Singletons >(unless lock checking is a very expensive operation) >just ask the OS about availability of that >resource and if it's available give it away >and then OS will lock it and therefore in next >time somebody ask it just answer that resource >is locked >and return null > >for example system has 2 serial ports available >so I ask getResource("tty"); >or I ask getResource("Bluetooth-Modem"); > >and if OS is ok you can give tty or Bluetooth-Modem or both > >no need for any additional pattern I think > >back to the problem >mac os x doesn't recognize locking via files, so >it handles locking via some API >an instance of the singleton in each process >should recognize that resource is locked >(by using that API) that's all >we don't have to make things more complicate >then they are just because there is some nice >design pattern or nice unit test framework or whatever >keep things simple, make them work fast, don't introduce middle layers >unless you have really good reason to do so > >of course I could be entirely wrong, so sorry about that in advance > >thanks > > >Dmitry Markman > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx >Good day, > >I guess that only a selected few (hi Trent) will be able to answer? >this question, but the answer might be interesting for anyone trying? >to debug or understand the code. > >Apparently the MonitorThread is started and stopped in? >RXTXPort.addEventListener and RXTXPort.removeEventListener. This? >would indicate that (originally?) the MonitorThread is only required? >when there is an EventListener. However the MonitorThread is also? >started in the RXTXPort constructor, which could mean that RXTX won't? >work at all if it isn't there. > >It seems to me, that if anyone would add an event listener and later? >on remove it, he could potentially wreak the port. Because the second? >action would kill the MonitorThread. > > >For the moment I am only trying to understand the role of and idea? >behind the MonitorThread. But of course there is a deeper reason thor? >my question: > >If the MonitorThread needs to exist anyway, it could be the thread? >that cleans up the port (ie calls nativeClose) - this would eliminate? >(a further) problem I am seeing with some USB drivers on Mac OSX.? >(Close blocks (after releasing the tty, but still) in the USB driver? >if the device is "not responding"). > >Greetings, >Joachim > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Sat May 13 10:07:37 2006 From: joachim at buechse.de (Joachim Buechse) Date: Sat, 13 May 2006 18:07:37 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Douglas, Looking at the current code, leaves me with the feeling, that there is a lot to do. Defining an API that wraps javax.comm to provide what you describe is certainly possible, but I wonder how much benefit it will actually provide. Personally I think the API defined by javax.comm "request/lock" a port with: cp= new CommunicationPort(identifier) "release" a port with: cp.close(); works quite nice for 99% of the applications. In my experience, the most efficient and elegant implementation is to wrap a port/socket/.. into a business object which declares the remote operations that are possible. Ie "uploadFile", "waitForPrompt", "getSerialNumber", "sendContact", "executeCommand", etc Those methods are then either synchronized or guarded by a monitor. I do not see how your design pattern applied to the port resource would help implementing this. [details start, skip if you agree to the above] When I talked about "thread-safe" I didn't mean several independent "sessions" accessing the port concurrently. I think this is a very rare usage. I believe the most common use case for serial ports today is the control of an external device from a PC running a GUI based application. To implement a clean Swing/AWT-GUI one needs to pass any action that can block to a "worker" thread (else the GUI blocks, the application appears dead). While it is possible to use own prespawned thread that will accept Runnables which operate on the port, this is not very elegant. It is more common to spawn a new thread for every action triggered by the user. Additionally the ABORT of a running operation is often implemented via a port.close() delegated to a different thread. - During the lifetime of a port, it will usually be accessed from several different threads. Instance variables need to be set/read in synchronized regions to guarantee a correct operation based on the Java memory model. - Synchronizing the access is usually handled on the application level (synchronizing the reads/writes is usually useless from the applications view because it is not a transaction mechanism). [details end] I am very open to learn about other scenarios where your proposed design pattern applied to the port resource is beneficial to the application implementor. Best regards, Joachim On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > Dmitry suggests that we acquire an implementation of > a serial port reference, use it, then release it (i.e., check it > back in). > > Joachim says that making serial ports thread friendly might be a > good idea. > > This is a good idea. The design pattern that is close to this idea > is the "Object Pool Design Pattern". > # Object Pool From jredman at ergotech.com Sun May 14 14:28:24 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 14:28:24 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers Message-ID: <446792E8.4000506@ergotech.com> Does anyone know of any work to make RXTX work with Ethernet (telent) Terminal Servers? If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? We've used RXTX with upwards of 100 virtual COM ports on Windows and it works well. Linux is more problematic. It would be good to have an OS independent solution to accesses remote Ethernet serial ports. Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From legolas.w at gmail.com Sun May 14 14:26:34 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:56:34 +0430 Subject: [Rxtx] does any one have a working sample of RXTX and LPT port Message-ID: <4467927A.4000008@gmail.com> Hi Thank you for reading my post does any one has a working sample for RXTX and LPT port ? Thanks From legolas.w at gmail.com Sun May 14 14:27:29 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:57:29 +0430 Subject: [Rxtx] does RXTX support Trigerr on parallel port? Message-ID: <446792B1.4040905@gmail.com> Hi does RXTX support trigger on LPT port ? if so , how i can use it ? Thanks From tjarvi at qbang.org Sun May 14 17:40:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 17:40:59 -0600 (MDT) Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: <446792E8.4000506@ergotech.com> References: <446792E8.4000506@ergotech.com> Message-ID: On Sun, 14 May 2006, Jim Redman wrote: > Does anyone know of any work to make RXTX work with Ethernet (telent) > Terminal Servers? > > If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 > Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? > Hi Jim It appears the author of NVTCom has decided to release the library into the public domain. Integration with rxtx is possible but it would be best to contact the author and find out what his intent is. I would suggest contacting the author with a proposal of what you would like to do and take it from there. We could 'take' public domain software but its better to show respect to the authors and respect their wishes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:10:23 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:10:23 -0600 (MDT) Subject: [Rxtx] does any one have a working sample of RXTX and LPT port In-Reply-To: <4467927A.4000008@gmail.com> References: <4467927A.4000008@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > Thank you for reading my post > does any one has a working sample for RXTX and LPT port ? > Thanks Hi Legolas LPT port support in rxtx is spotty. That means some people have sent in patches for what they do and it works well for them. The original code was not very good. It may have been 3 hours work :/ To get started, Sun has some demo programs with their commapi. With rxtx 2.1 you can change their code from using javax.com to gnu.io and it -should- work. But if it does not you can post here and on bugzilla. There has been more interest lately off the list and maybe there will be enough community resources to get what you need going. If you do get a sample program together, we would gladly put it in the contrib directory so the next person can get things going faster. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:12:12 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:12:12 -0600 (MDT) Subject: [Rxtx] does RXTX support Trigerr on parallel port? In-Reply-To: <446792B1.4040905@gmail.com> References: <446792B1.4040905@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > does RXTX support trigger on LPT port ? > if so , how i can use it ? > Hi Legolas As mentioned in the previous post, rxtx parallel support is not very mature. But if you can point to something that describes the trigger feature, we can probably make sure its there and give a quick code example. -- Trent Jarvi tjarvi at qbang.org From jredman at ergotech.com Sun May 14 22:22:48 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 22:22:48 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: References: <446792E8.4000506@ergotech.com> Message-ID: <44680218.4080008@ergotech.com> Trent, Trent Jarvi wrote: > On Sun, 14 May 2006, Jim Redman wrote: > >> Does anyone know of any work to make RXTX work with Ethernet (telent) >> Terminal Servers? >> >> If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 >> Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? >> > > Hi Jim > > It appears the author of NVTCom has decided to release the library into > the public domain. Integration with rxtx is possible but it would be best > to contact the author and find out what his intent is. > > I would suggest contacting the author with a proposal of what you would > like to do and take it from there. We could 'take' public domain software > but its better to show respect to the authors and respect their wishes. > I sent Marco(?), the author of the library, a note before asking the list - I'll let you know the response. If anyone is already working on it, or has an interest and more time and energy than me, I'd hate to duplicate the efforts. If no one is, and no one objects, maybe I'll see what I can do. Jim > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From Christian.Klemke at t-online.de Mon May 15 02:23:06 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Mon, 15 May 2006 10:23:06 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu><004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: <008a01c677f8$cae18590$02fea8c0@NB600> Hi Trent, Hi Paul, I finally found some time to create a simple patch to enable the optional suppression of version output to the console. It is based on a new system property called "gnu.io.rxtx.NoVersionOutput" which can by set to "true" if necessary. I had some problems accessing CVS, therefore I downloaded the rxtx-2.1-7r2 source archive from ftp.qbang.org (which is linked on the rxtx.org download page) and worked with that release. Please find my proposed patch in the attachment ! Regards, Christian ----- Original Message ----- From: "Trent Jarvi" To: "RXTX Developers and Users" Cc: ""Paul Gettings"" Sent: Friday, May 05, 2006 2:09 PM Subject: Re: [Rxtx] RXTX causing stdout messages > On Fri, 5 May 2006, Christian Klemke wrote: > >> Hi Paul, >> >> I was wondering about the same question some days ago and took a look at >> the >> source files. Unfortunately, I found that you can only get rid of that >> messages by altering and recompiling the Java code. There is a final >> static >> boolean variable called "devel" in the file "RXTXCommDriver.java" which >> is >> set to "true". This constellation causes the output after the native >> libraries have been loaded. No mechanism exists to suppress them >> otherwise >> :-(. >> >> Trent, does that mean that 2.1.7 is still officially a "development" >> version >> ? When will this value be changed to "false" by default ? With 2.1.8 ? It >> would be nice to provide a means to suppress such messages besides that >> static flag (maybe by setting a property called >> "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The >> output can indeed by annoying, especially when used with console >> applications, where the message potentially appears "in the middle" of >> your >> own output. Another possibility would be not to use System.out directly, >> but >> instead some PrintStream field which is initially set to System.out but >> can >> programatically be changed. That would allow for any kind of redirection >> or >> suppression by implementing appropriate user-defined PrintStream >> subclasses >> and making RXTX use that stream. What do you think ? >> > > A patch for using properties would be accepted I'm sure. > > The reason the default is to display the message is not related to the > development state of rxtx anymore. The problem is that people first using > rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. > The message prevents a great deal of email thats easily explained by the > message. > > I question if we should support rxtx 2.0 at all anymore. > > If you post a patch in bugzilla, we'll put it into CVS this weekend. > we'll be going through and doing such things anyhow. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_version_output_patch.diff Type: application/octet-stream Size: 991 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060515/3173c2b6/rxtx_version_output_patch-0006.obj From lyon at docjava.com Mon May 15 06:06:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 May 2006 08:06:21 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Joachim makes several good points. Let me see if I can address some of them below: >Hello Douglas, > >Looking at the current code, leaves me with the feeling, that there? >is a lot to do. Yes! >Defining an API that wraps javax.comm to provide what? >you describe is certainly possible, but I wonder how much benefit it? >will actually provide. > >Personally I think the API defined by javax.comm > >"request/lock" a port with: > cp= new CommunicationPort(identifier) >"release" a port with: > cp.close(); > >works quite nice for 99% of the applications. I don't know what percentage of applications turn off locking, the way that I do in my version of the RXTX lib. I do know that this is not safe practice. I also know that it was motivated by the multi-platform nature of my code and that this was the only way I could make things work, at the time. Java does not appear to have a cross-platform standard for locking resources on various platforms. Each OS appears to have its own standard. The question of who breaks deadlocks and how this is done remains open, as this is not an easy question to resolve. Let me continue, below: > >In my experience, the most efficient and elegant implementation is to? >wrap a port/socket/.. into a business object which declares the? >remote operations that are possible. Ie "uploadFile",? >"waitForPrompt", "getSerialNumber", "sendContact", "executeCommand",? >etc Those methods are then either synchronized or guarded by a? >monitor. I do not see how your design pattern applied to the port? >resource would help implementing this. I have no problem with high-level wrappers that are application specific. That is a very good idea, but orthogonal with respect to the issue of deadlocks. More below: > >[details start, skip if you agree to the above] >When I talked about "thread-safe" I didn't mean several independent? >"sessions" accessing the port concurrently. I think this is a very? >rare usage. That is probably why turning locking off works so well! On the other hand, it is not safe and I shouldn't do it. >I believe the most common use case for serial ports today? >is the control of an external device from a PC running a GUI based? >application. To implement a clean Swing/AWT-GUI one needs to pass any? >action that can block to a "worker" thread (else the GUI blocks, the? >application appears dead). While it is possible to use own prespawned? >thread that will accept Runnables which operate on the port, this is? >not very elegant. It is more common to spawn a new thread for every? >action triggered by the user. Additionally the ABORT of a running? >operation is often implemented via a port.close() delegated to a? >different thread. Here lies the heart of serial port concern. An application opens a serial port and then dies. The application is restarted and finds the port locked. How do we clear the lock? Must the application's user reside in the UUCP group? Must installers of the serial port add users to the UUCP group? Should locking be handled at a high-level of abstraction in an operating system independent way? Should the implementation of the locking mechanism be translated into an API that is dependent on the OS convention? Suppose that we restrict the discussion to serial ports. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on inconsistent naming conventions. Hence my feeling that we need to mirror what is done in other API's; we need a locking toolkit that references peer methods, IMHO. >From the Java programming point of view, the locking API is portable across different platforms, but has, as its implementation, a native peer method that uses the conventions of the underlying OS. This enables portable resource locking (in theory!). Consider, for example: org.apache.commons.transaction.locking with: Interface LockManager at: http://jakarta.apache.org/commons/transaction/apidocs/org/apache/commons/transaction/locking/LockManager.html Or, more recently: java.util.concurrent.locks Interface Lock based on Doug Lea's code: http://kickjava.com/src/EDU/oswego/cs/dl/util/concurrent/ReadWriteLock.java.htm Should we incorporate a clean, portable design into serial port use, one that is consistent with current locking APIs? Basically, a comm port is a resource and resources are typically controlled by managers. Thus, I suggest that we make use of a CommPortManager to help control and centralize serial port usage. The question of how this is done remains open, IMHO, but using core API's like: java.util.concurrent.locks might not be amiss. High-level methods (getAllPorts, getAllSerialPorts, getAllParallelPorts, etc...) might be welcome additions. Basic questions like, "what if a port is in use?" remain open, hence my proposal for the new design pattern. Isn't it the CommPortManager's role to break the deadlock? Cheers! - Doug > >- During the lifetime of a port, it will usually be accessed from? >several different threads. Instance variables need to be set/read in? >synchronized regions to guarantee a correct operation based on the? >Java memory model. >- Synchronizing the access is usually handled on the application? >level (synchronizing the reads/writes is usually useless from the? >applications view because it is not a transaction mechanism). >[details end] > >I am very open to learn about other scenarios where your proposed? >design pattern applied to the port resource is beneficial to the? >application implementor. > >Best regards, >Joachim > >On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > >> Dmitry suggests that we acquire an implementation of >> a serial port reference, use it, then release it (i.e., check it? >> back in). >> > > Joachim says that making serial ports thread friendly might be a? >> good idea. >> >> This is a good idea. The design pattern that is close to this idea >> is the "Object Pool Design Pattern". >> # Object Pool > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Mon May 15 06:58:19 2006 From: joachim at buechse.de (Joachim Buechse) Date: Mon, 15 May 2006 14:58:19 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Doug, I agree fully, that locking of the system resource should be abstracted from the user (programmer). Currently this is already the case, but I agree it might be nice to extract the code into a separate class, which uses platform dependent providers to do its job. What I described in my email was not targeted at allocating the system resource, but at handling an already allocated system resource inside the framework. I agree that it may be possible to combine the two - however, I would suggest to do this in phase2. I can contribute a work over of RXTXPort.java which implements clean internal locking and proper close behavior (which I would call phase 1). I could do this this week. However I strongly believe that there is little sense in trying to do this as a series of patches. It will be closer to a rewrite than to a patch. I have already provided a number of suggested patches via Bugzilla, but this is quite inconvenient (for me). My working copy diverges more and more from the master and hence it gets more and more annoying to provide self contained patches. Best regards, Joachim From tjarvi at qbang.org Mon May 15 08:27:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 May 2006 08:27:51 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Mon, 15 May 2006, Joachim Buechse wrote: > Hello Doug, > > I agree fully, that locking of the system resource should be > abstracted from the user (programmer). Currently this is already the > case, but I agree it might be nice to extract the code into a > separate class, which uses platform dependent providers to do its job. > > What I described in my email was not targeted at allocating the > system resource, but at handling an already allocated system resource > inside the framework. I agree that it may be possible to combine the > two - however, I would suggest to do this in phase2. > > I can contribute a work over of RXTXPort.java which implements clean > internal locking and proper close behavior (which I would call phase > 1). I could do this this week. > > However I strongly believe that there is little sense in trying to do > this as a series of patches. It will be closer to a rewrite than to a > patch. I have already provided a number of suggested patches via > Bugzilla, but this is quite inconvenient (for me). My working copy > diverges more and more from the master and hence it gets more and > more annoying to provide self contained patches. > For methodical testing purposes (which does go on) the incremental patches are better. I'm lagging behind in bugzilla but thats soon to change (this week). It has just been rather chaotic up until now. I moved, purchased a house, and jumped into the fire of a feature freeze timeframe at a new job. btw, we see the Solaris close issues on 2.8 also. 9 and 10 are fine. I'll work towards making those test results public and allow others to run new rxtx code through them. We had the OK at one point but setting up the environment is involved. It isn't just a collection of java classes. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Tue May 16 02:01:47 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:01:47 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] Message-ID: <446986EB.209@willicon.de> Hi, any ideas for my problem? Hans -------- Original-Nachricht -------- Betreff: [Rxtx] Problem under Mac OSX 10.3.9 Datum: Mon, 08 May 2006 18:47:20 +0200 Von: WILLICon Antwort an: RXTX Developers and Users An: RXTX Developers and Users Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/b0741c2b/attachment-0006.html From joachim at buechse.de Tue May 16 02:15:08 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 10:15:08 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: Hello Hans, I am using RXTX on OS X for my own project. I do not see the problem you describe. I had some troubles installing it because the current version uses lock files which is non-standard on OS X. I have created a patched version which I currently use. This version does not need to modify user groups and hence does not need an installer. I just pop it in the application directory. If you send me a link where I can download your OSX installer, I will have a quick look. Regards, Joachim On 16.05.2006, at 10:01, WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we > have some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + > spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + > spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always > the value "false". > I can only get the status, while I open the port and catch the > exception. > > Any ideas? > > Hans > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail at willicon.de Tue May 16 02:26:53 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:26:53 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: References: <446986EB.209@willicon.de> Message-ID: <44698CCD.7050709@willicon.de> Joachim, tanks for the answer. I'll send You a mail. Hans Joachim Buechse schrieb: > Hello Hans, > > I am using RXTX on OS X for my own project. I do not see the problem > you describe. > > I had some troubles installing it because the current version uses > lock files which is non-standard on OS X. I have created a patched > version which I currently use. This version does not need to modify > user groups and hence does not need an installer. I just pop it in > the application directory. If you send me a link where I can download > your OSX installer, I will have a quick look. > > Regards, > Joachim > > On 16.05.2006, at 10:01, WILLICon wrote: > > >> Hi, >> >> any ideas for my problem? >> >> Hans >> >> -------- Original-Nachricht -------- >> Betreff: [Rxtx] Problem under Mac OSX 10.3.9 >> Datum: Mon, 08 May 2006 18:47:20 +0200 >> Von: WILLICon >> Antwort an: RXTX Developers and Users >> An: RXTX Developers and Users >> >> >> Hi, >> >> I use for RXTX for communicate with CyclingComputers. >> >> It works good under Win32, Sloaris and Linux but with Mac OSX we >> have some problems. >> >> My users install the Mac OSX serial lib from the actual binary. >> >> After starting the program, they get this error message: >> >> java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while >> loading gnu.io.RXTXCommDriver >> >> Remember, this error comes only under Mac OSX. >> >> That is the code for the error: >> >> Enumeration portList = CommPortIdentifier.getPortIdentifiers(); >> spInUse = getBundleStr("serialPortInUse"); >> spFree = getBundleStr("serialPortFree"); >> while (portList.hasMoreElements()) { >> CommPortIdentifier portId = (CommPortIdentifier) >> portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (osName != null && osName.startsWith("mac")) { >> if (!portId.getName().startsWith("dev/cu.")) { >> continue; >> } >> } >> if (portId.isCurrentlyOwned()) { >> serialPortNames.add(portId.getName() + " - " + >> spInUse); >> } >> else { >> serialPortNames.add(portId.getName() + " - " + >> spFree); >> } >> } >> } >> if (serialPortNames.size() == 0) { >> serialPortNames.add(getBundleStr("serialPortNotFound")); >> } >> >> BTW: The methode isCurrentlyOwned() is not working. I get always >> the value "false". >> I can only get the status, while I open the port and catch the >> exception. >> >> Any ideas? >> >> Hans >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/948333be/attachment-0006.html From jredman at ergotech.com Tue May 16 07:35:52 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 16 May 2006 07:35:52 -0600 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: <4469D538.6070408@ergotech.com> Hans, I have no direct insight, but would note that what you have is a "NoClassDefFoundError" not a "ClassNotFoundException". So the class javax/comm/CommDriver is found, but one of its dependencies is missing. NoClassDefFoundError are a bigger problem to resolve because you get no indication of the real problem. Jim WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we have > some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > * spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always the > value "false". > I can only get the status, while I open the port and catch the exception. > > Any ideas? > > Hans > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.de Tue May 16 08:01:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 16:01:21 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 In-Reply-To: <4469AFC3.6000002@willicon.de> References: <44698EBC.8000008@willicon.de> <8C5680C4-E2BA-42FF-B221-36E1124FA6A4@buechse.de> <4469AFC3.6000002@willicon.de> Message-ID: <9825A602-D6ED-4C28-BF33-9A7C984FACD5@buechse.de> Hallo Hans, you include RXTX 2.17 in your "bikeXexperience.jar" (2.17 uses Interfaces from gnu.io.* not javax.comm.*). Now inspect your error log closely: The class gnu.io.RXTXCommDriver tries to load javax.comm.CommDriver: this is only the case for RXTX 2.07. I assume, that the user has installed Version 2.07 into one of the java.ext.dirs . The VM always tries to load classes from the "system" path first. The current Mac installer distributed with RXTX in fact installs RXTXcomm.jar and librxtxSerial.jnilib into /Library/Java/Extensions. (I wrote some time ago that I consider this as a bad idea because of potential version conflicts-> thanks for delivering the example). For 2.07 it does so without installing the javax.comm classes it seems. I would recommend that you instruct your users to install version 2.17 only. Until RXTX is changed to use TIOCEXCL instead of lock files, you can hardly avoid the installer, as the user needs to be added to a special group and a lockfile directory needs be created. More precisely you are waiting for: http://bugzilla.qbang.org/show_bug.cgi?id=50 [RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL)] Regards, Joachim -------------- next part -------------- A non-text attachment was scrubbed... Name: log.tiff Type: image/tiff Size: 38394 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/e3e52128/log-0006.tiff -------------- next part -------------- > > Ich verwende RXTX 2.17. Das orginal RXTXcomm.jar ist in > CyclingDataManager.jar enthalten. > From tjarvi at qbang.org Wed May 17 23:18:15 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 May 2006 23:18:15 -0600 (MDT) Subject: [Rxtx] update Message-ID: So we have several patches and these have stacked up. I'd like to thank everyone for being patient. Tests for the most intrusive patches look good so far. I still have to get some bits together on my end but it looks like we can catch everything up in CVS this week. I'll try to post a normal list of what went in by whom with links Saturday. But I'm not seeing anything that raises flags yet. I also think I'll be able to submit a patch for nonstandard baud rates. I have to confirm w32 but I think its going to be a one line fix. I don't know if its bugzilla or people tinkering with patch files before submitting but patches are not applying cleanly. So the patches have to be done by hand. This may make things difficult for people hoping to add other patches on top. I'm trying to make that go well but ... -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Thu May 18 02:23:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 May 2006 10:23:47 +0200 Subject: [Rxtx] update In-Reply-To: References: Message-ID: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Hello Trent, in fact I tinkered with the patches (never used this mechanism before, usually I "communicate" via cvs) ... so sorry for any trouble you had applying them. Basicly I edited the patches to make them self contained. Having the tests run with different speeds on different platforms, may well be an effect of caching. I have seen quite interesting propagation delays for the closing flag on my PowerPC system, which makes me doubt, that the propagation of output_buffer_empty_flag works as it should. Maybe the communication mechanism between the two threads should be replaced by something like pthread_cond_*. Could you describe which problems you see on Solaris/SPARC? I'd be interested to see if they exist on OS X (PowerPC) as well... As you seem to work on the stuff at the moment I would like to suggest the following additions (it looks more than it is, I posted some context to make clear where to apply the change). See the comments in braces for what was changed Greetings, Joachim (1) The end of the drain loop could be: --- report("drain_loop: received EINTR in tcdrain\n"); --- (added "in tcdrain" to make debug output clearer) (2) The start of the drain loop should be: --- for(i=0;;i++) { report_verbose("drain_loop: looping\n"); #if defined(__sun__) /* FIXME: No time to test on all OS's for production */ if( eis->eventloop_interrupted ) { goto end; } if (usleep(5000)) { report("drain_loop: received EINTR"); } #else if (usleep(1000000)) { report("drain_loop: received EINTR"); } #endif /* __sun__ */ --- (added a check for "eis->eventloop_interrupted" before the sleep) (3) The end of interrupt_event_loop could (and maybe should) be: --- #if !defined(TIOCSERGETLSR) && !defined(WIN32) /* make sure that the drainloop unblocks from tcdrain */ pthread_kill(index->drain_tid, SIGABRT); /* TODO use wait/join/SIGCHLD/?? instead of sleep? */ usleep(50 * 1000); /* Under normal conditions, SIGABRT will unblock tcdrain. However a non-responding USB device combined with an unclean driver may still block. This is very ugly because it may block the call to close indefinetly. */ if (index->closing != 1) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); index->closing = 1; } #endif report("interruptEventLoop: interrupted\n"); --- (added some comments and pthread_cancel for resisting drain thread) On 18.05.2006, at 07:18, Trent Jarvi wrote: > > So we have several patches and these have stacked up. I'd like to > thank > everyone for being patient. > > Tests for the most intrusive patches look good so far. I still > have to > get some bits together on my end but it looks like we can catch > everything > up in CVS this week. > > I'll try to post a normal list of what went in by whom with links > Saturday. But I'm not seeing anything that raises flags yet. I also > think I'll be able to submit a patch for nonstandard baud rates. > I have > to confirm w32 but I think its going to be a one line fix. > > I don't know if its bugzilla or people tinkering with patch files > before > submitting but patches are not applying cleanly. So the patches > have to > be done by hand. This may make things difficult for people hoping > to add > other patches on top. I'm trying to make that go well but ... > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu May 18 22:28:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 18 May 2006 22:28:00 -0600 (MDT) Subject: [Rxtx] update In-Reply-To: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> References: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Message-ID: On Thu, 18 May 2006, Joachim Buechse wrote: > Hello Trent, > > in fact I tinkered with the patches (never used this mechanism > before, usually I "communicate" via cvs) ... so sorry for any trouble > you had applying them. Basicly I edited the patches to make them self > contained. I think we are close to moving towards that. > > Having the tests run with different speeds on different platforms, > may well be an effect of caching. I have seen quite interesting > propagation delays for the closing flag on my PowerPC system, which > makes me doubt, that the propagation of output_buffer_empty_flag > works as it should. Maybe the communication mechanism between the two > threads should be replaced by something like pthread_cond_*. Could > you describe which problems you see on Solaris/SPARC? I'd be > interested to see if they exist on OS X (PowerPC) as well... This is interesting. I have seen problems with output buffer empty in applications that require it. I'm trying to get a bug list and or test results open for everyone to see but that may take time. But missed output buffer events ... yep. With Sparc, we have seen a few things. One was a kernel race condition that went away when we reimaged and updated 2.8. RXTX was hanging on close, top showed no cpu use but there was 2 second delays just typing on console. The other is our tests now take ~4 times longer on Solaris. Someone is looking at timing just open, close, read, write, ... to see if they can find where the slowdown is. This happened after solaris 2.8. I'll try to share more when/if there is something interesting. This may well not be solvable in userland. > > As you seem to work on the stuff at the moment I would like to > suggest the following additions (it looks more than it is, I posted > some context to make clear where to apply the change). See the > comments in braces for what was changed I'll take a look. This could all come together Saturday but I also have an event to attend that day. I may not wrap this up until Sunday. -- Trent Jarvi tjarvi at qbang.org From andrewlord at internode.on.net Sun May 21 20:10:02 2006 From: andrewlord at internode.on.net (Andrew Lord) Date: Mon, 22 May 2006 11:40:02 +0930 Subject: [Rxtx] Kernel include files do not match kernel Message-ID: <200605221140.03271.andrewlord@internode.on.net> Hi, I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel 2.6.12-18 with the command: ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include However I get the message: ## checking java.version 1.5.0_06 ## checking os.version 2.6.12-18mdk ## ## WARNING: Kernel include files do not match the current kernel ## ## configure: creating ./config.status etc. Is there a problem with the way I'm specifying the 'include' directory ? If not, how else can I specify the correct directory for the include files please ? Cheers, Andrew From tjarvi at qbang.org Sun May 21 20:31:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 May 2006 20:31:31 -0600 (MDT) Subject: [Rxtx] Kernel include files do not match kernel In-Reply-To: <200605221140.03271.andrewlord@internode.on.net> References: <200605221140.03271.andrewlord@internode.on.net> Message-ID: On Mon, 22 May 2006, Andrew Lord wrote: > Hi, > > I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel > 2.6.12-18 with the command: > > ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk > CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include > > However I get the message: > > ## checking java.version 1.5.0_06 > ## checking os.version 2.6.12-18mdk > ## > ## WARNING: Kernel include files do not match the current kernel > ## > ## configure: creating ./config.status > etc. > > Is there a problem with the way I'm specifying the 'include' directory ? If > not, how else can I specify the correct directory for the include files > please ? > Hi Andrew I'm fairly sure your --with-kernel option does nothing. The CPPFLAGS should do what you want. Maybe put an #error message in /usr/src/linux.../incude/linux/version.h But I don't recall a recent problem with version missmatches. It should work. Distros will even ship include files that don't match versions exactly. In theory it should never matter for users. I used to compile new kernels by hand and really didnt have a distro. I didnt have a seperate package of kernel headers for users (myself). When changing a gateway from linux 1.2.12 to 2.1.77, I would worry about such messages. So if you are doing something that weird, the message may be of use to you. If you just see the message on a distro you installed, it is more than likely harmless. -- Trent Jarvi tjarvi at qbang.org From mrogers at spro.net Mon May 22 14:45:39 2006 From: mrogers at spro.net (Mike Rogers) Date: Mon, 22 May 2006 14:45:39 -0600 Subject: [Rxtx] Sun's CommAPI -- think May? Message-ID: <447222F3.9040302@spro.net> Hi, Any word from Sun about progress towards fixing the Java CommAPI v3 "incompatibilities" so RXTX 2.0 can operate within the framework's namespace (javax.comm)? I recall mention of a May time frame. Thanks, Mike From paul.klissner at sun.com Mon May 22 15:09:27 2006 From: paul.klissner at sun.com (Paul Klissner) Date: Mon, 22 May 2006 14:09:27 -0700 Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <447222F3.9040302@spro.net> References: <447222F3.9040302@spro.net> Message-ID: <44722887.8080308@sun.com> Mike Rogers wrote: > Hi, > > Any word from Sun about progress towards fixing the Java CommAPI v3 > "incompatibilities" so RXTX 2.0 can operate within the framework's > namespace (javax.comm)? I recall mention of a May time frame. > > Thanks, > > Mike > We've had a lot of work come in. This hasn't been the only priority. I'm running behind the plan in addressing this, but will be looking at it again soon. Rather than state a new, I'll just say it is in progress, and not off the table. I'll get this fixed as soon as I can. Good timing for asking as we just started discussing javax.comm plans today, and I'll have some cycles to work on it soon. Paul From yhua537 at cse.unsw.edu.au Mon May 22 16:03:05 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Tue, 23 May 2006 08:03:05 +1000 (EST) Subject: [Rxtx] install rxtx in XP Message-ID: Hi Guys, I am new to serial port programming, and have no experience on programming java in xp, but my project require me to builld a communication link between xp and a UART device. Most of the information in the web site seems for linux only. including the commands such as export and chmod. How do I install rxtx in xp? cheers YiQi Huang From mark at mdsh.com Tue May 23 01:24:20 2006 From: mark at mdsh.com (Mark Himsley) Date: Tue, 23 May 2006 08:24:20 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off , it includes DLLs for Windows and the JAR for Java. Follow the Windows instructions in the INSTALL. ie RXTXcomm.jar goes in \jre\lib\ext (under java) rxtxSerial.dll goes in \jre\bin So, assuming a fairly standard Java install, copy RXTXcomm.jar into C:\Program Files\Java\jre1.5.0_06\lib\ext and copy rxtxSerial.dll into C:\Program Files\Java\jre1.5.0_06\bin Yes, it really is that simple. On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > I am new to serial port programming, and have no experience on > programming java in xp, but my project require me to builld a > communication link between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang -- Mark Himsley From joachim at buechse.de Tue May 23 02:51:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 23 May 2006 10:51:47 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) Unless it is absolutely required you should NOT install RXTX in your global Java Runtime Environment. This will for sure create versioning conflicts - if not now, than in the future, if not on your system than at your clients. Instead put the dll in your application directory and include the RXTXcomm.jar in your classpath. This is much safer and not a bit more complicated. Regards, Joachim On 23.05.2006, at 09:24, Mark Himsley wrote: > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR > for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > >> I am new to serial port programming, and have no experience on >> programming java in xp, but my project require me to builld a >> communication link between xp and a UART device. >> >> Most of the information in the web site seems for linux only. >> including >> the commands such as export and chmod. How do I install rxtx in xp? >> >> cheers >> YiQi Huang > > > > -- > Mark Himsley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tod at todbot.com Tue May 23 03:12:22 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 02:12:22 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I totally agree: do not contaminate the Java installation. I put all the RXTX files in a directory and then change my java invocation to be: % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* Alternatively, use Launch4J to create a double-clickable application and keep the RXTX libraries in the directory of the application. -=tod On May 23, 2006, at 1:51 AM, Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > >> Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off >> , it includes DLLs for Windows and the JAR >> for Java. >> >> Follow the Windows instructions in the INSTALL. >> >> ie >> >> RXTXcomm.jar goes in \jre\lib\ext (under java) >> rxtxSerial.dll goes in \jre\bin >> >> So, assuming a fairly standard Java install, copy RXTXcomm.jar into >> C:\Program Files\Java\jre1.5.0_06\lib\ext >> and copy rxtxSerial.dll into >> C:\Program Files\Java\jre1.5.0_06\bin >> >> Yes, it really is that simple. >> >> >> >> On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: >> >>> I am new to serial port programming, and have no experience on >>> programming java in xp, but my project require me to builld a >>> communication link between xp and a UART device. >>> >>> Most of the information in the web site seems for linux only. >>> including >>> the commands such as export and chmod. How do I install rxtx in xp? >>> >>> cheers >>> YiQi Huang >> >> >> >> -- >> Mark Himsley >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From smontgomery at mediaspansoftware.com Tue May 23 08:46:53 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Tue, 23 May 2006 10:46:53 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: Message-ID: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Joachim and Tod mentioned how to keep the files RXTX requires on Windows XP out of the Java installations - thanks gentlemen! Are there similar suggestions for an RXTX install on OS X? The current "canonical" OS X installation instructions "contaminate the Java installation", to use Tod's words. Our app will run fine under 1.4.2 and 5.0 on OS X, and a lot of users will have both. We've already been burned by the recent switch from 1.4.2 to 5.0 as the platform default. Any suggestions welcomed. From tod at todbot.com Tue May 23 13:27:55 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 12:27:55 -0700 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <9BA0F670-A862-42E7-BB2C-130D775ABDF9@todbot.com> Hi Sean, It depends on how you build and deploy your code. If you're using shell scripts, you can do something like this: #!/bin/sh # pick one JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/ Commands/java #JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/ Commands/java $JAVA -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* That both picks which VM to use and uses the RXTX in the directory called 'rxtxlib'. If you want your shell script to be clever, you could test for the existence of the different 'java' executables and go from there (maybe even use different jar files). I am almost positive all OS X systems with Java 1.5 are guaranteed to also have Java 1.4.2. If you're using Jar Builder or XCode, you can specify which JVM to use and add the extra args in the Info.plist file. The paths specified in the 'java' invocation then are based off of the $JAVAROOT variable that the JavaApplicationStub sets for you. For my app, I've have been compiling two sets of jars, one compiled with 1.4.2 and one with 1.5, but they both run under 1.5. So I have a similar shell script that chooses a different 'javac' depending on the need. -=tod On May 23, 2006, at 7:46 AM, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From yhua537 at cse.unsw.edu.au Tue May 23 11:09:37 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 03:09:37 +1000 (EST) Subject: [Rxtx] install rxtx in XP (Mark Himsley, Joachim Buechse, Tod E. Kurt> In-Reply-To: References: Message-ID: > Message: 8 > Date: Tue, 23 May 2006 08:03:05 +1000 (EST) > From: YiQi Huang > Subject: [Rxtx] install rxtx in XP > To: rxtx at qbang.org > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > Hi Guys, > > I am new to serial port programming, and have no experience on programming > java in xp, but my project require me to builld a communication link > between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang > > > ------------------------------ > > Message: 9 > Date: Tue, 23 May 2006 08:24:20 +0100 > From: Mark Himsley > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=us-ascii; format=flowed > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > ------------------------------ > > Message: 10 > Date: Tue, 23 May 2006 10:51:47 +0200 > From: Joachim Buechse > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > > ------------------------------ > > Message: 11 > Date: Tue, 23 May 2006 02:12:22 -0700 > From: "Tod E. Kurt" > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I totally agree: do not contaminate the Java installation. > > I put all the RXTX files in a directory and then change my java > invocation to be: > > % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* > > Alternatively, use Launch4J to create a double-clickable application > and keep the RXTX libraries in the directory of the application. > > -=tod > > Hi, Thanks guys, I don't know if this is the correct way to reply your mecessage, if wrong, please point out. Thank you for Mark to give the detail instructions and Joachim to point out the cons ot installing in the java directory, and specially thanks for Tod to give the instrection in detail. Sorry to ask another stupid question: I have followed Tod's instruction. Now I think i am ready to start hacking. But where is the RXTX API documentation? Is it the same as using normal java comm API? btw, where could i find some examples to start with? Thanks very much cheers YiQi Huang From tjarvi at qbang.org Tue May 23 16:09:32 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 May 2006 16:09:32 -0600 (MDT) Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <44722887.8080308@sun.com> References: <447222F3.9040302@spro.net> <44722887.8080308@sun.com> Message-ID: > Good timing for asking as we just started discussing javax.comm plans > today, and I'll have some cycles to work on it soon. Hi Paul I assume you mean Sun is discussing plans concerning its own internal actions and there is no community involvment at this point. -- Trent Jarvi tjarvi at qbang.org From yhua537 at cse.unsw.edu.au Tue May 23 22:50:01 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 14:50:01 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } From mmester at sps.edu Tue May 23 22:58:21 2006 From: mmester at sps.edu (Michael Mester) Date: Wed, 24 May 2006 00:58:21 -0400 Subject: [Rxtx] install rxtx in XP References: Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below -----Original Message----- From: rxtx-bounces at qbang.org on behalf of YiQi Huang Sent: Wed 5/24/2006 12:50 AM To: RXTX Developers and Users Subject: Re: [Rxtx] install rxtx in XP Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3950 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060523/b36d0c63/attachment-0006.bin From yhua537 at cse.unsw.edu.au Tue May 23 23:05:50 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 15:05:50 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: Yes, Michael you are right, it should be semicolons, But it still can't find the correct library. On Wed, 24 May 2006, Michael Mester wrote: > I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below > > > -----Original Message----- > From: rxtx-bounces at qbang.org on behalf of YiQi Huang > Sent: Wed 5/24/2006 12:50 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] install rxtx in XP > > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > cheers YiQi Huang From tod at todbot.com Wed May 24 00:01:57 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 23:01:57 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Yes, sorry, classpath entries are semicolon-separated on Windows and colon-separated on everything else. Your example code below is importing the wrong set of classes. It should not "import javax.comm.*", instead it should "import gnu.io.*". When I make that change, your example program compiles. The "javax.comm" package is the one released by Sun, the "gnu.io" package is the RXTX one. You might've seen some discussion that the two will be merged or become compatible, but that hasn't happened yet. -=tod On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > > Yes, Michael you are right, it should be semicolons, But it still > can't > find the correct library. > > On Wed, 24 May 2006, Michael Mester wrote: > >> I believe the entries in the classpath need to be seperated with >> semicolons, not a colon as you have in your command below >> >> >> -----Original Message----- >> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >> Sent: Wed 5/24/2006 12:50 AM >> To: RXTX Developers and Users >> Subject: Re: [Rxtx] install rxtx in XP >> >> Hi, >> >> Sorry guys.I follow Tod's instruction, and here is what i did: >> >> put >> RXTXcomm.jar, >> rxtxParallel.dll, >> rxtxSerial.dll >> in >> C:\RXTX_files >> >> and I got a SimpleRead class attached below, compile it with : >> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >> it still saying "cannot find symbol". >> >> Is there anything I did wrong? Do I need the comm.jar from Sun? >> >> Thanks & regards >> YiQi Huang >> >> >> //////////////////////////////////////////////////////// >> // SimpleRead.java >> //////////////////////////////////////////////////////// >> >> import java.io.*; >> import java.util.*; >> import javax.comm.*; >> >> public class SimpleRead >> implements Runnable, SerialPortEventListener { >> static CommPortIdentifier portId; >> static Enumeration portList; >> InputStream inputStream; >> SerialPort serialPort; >> Thread readThread; >> public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == >> CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals("COM1")) { >> //if (portId.getName().equals("/dev/term/a")) { >> SimpleRead reader = new SimpleRead(); >> } >> } >> } >> } >> public SimpleRead() { >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", >> 2000); >> } catch (PortInUseException e) {} >> try { >> inputStream = serialPort.getInputStream(); >> } catch (IOException e) {} >> try { >> serialPort.addEventListener(this); >> } catch (TooManyListenersException e) {} >> serialPort.notifyOnDataAvailable(true); >> try { >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } catch (UnsupportedCommOperationException e) {} >> readThread = new Thread(this); >> readThread.start(); >> } >> public void run() { >> try { >> Thread.sleep(20000); >> } catch (InterruptedException e) {} >> } >> public void serialEvent(SerialPortEvent event) { >> switch(event.getEventType()) { >> case SerialPortEvent.BI: >> case SerialPortEvent.OE: >> case SerialPortEvent.FE: >> case SerialPortEvent.PE: >> case SerialPortEvent.CD: >> case SerialPortEvent.CTS: >> case SerialPortEvent.DSR: >> case SerialPortEvent.RI: >> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >> break; >> case SerialPortEvent.DATA_AVAILABLE: >> byte[] readBuffer = new byte[20]; >> try { >> while (inputStream.available() > 0) { >> int numBytes = inputStream.read(readBuffer); >> } >> System.out.print(new String(readBuffer)); >> } catch (IOException e) {} >> break; >> } >> } >> } >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > cheers > YiQi Huang > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From joachim at buechse.de Wed May 24 00:10:06 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:10:06 +0200 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Hi Sean, my preferred way of dealing with RXTX on OS X is to include the RXTX classes into my application jar and to put the RXTX lib in the same directory as this jar. To make it even more comfortable, you can include the lib in the jar and have some startup code extract it and write it to a temporary file from which you load it with System.load(). Unfortunately the current version of RXTX for OS X requires tinkering with user groups as it is based on lockfiles - and hence it needs the RXTX OS X installer or you need to duplicated this functionality in your own installer. I have created my own native version which is not based on lockfiles but tty locking (the standard way to do it on OSX). I hope that these patches will be integrated soon into the distribution. Regards, Joachim On 23.05.2006, at 16:46, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Wed May 24 00:16:12 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:16:12 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <7017ECFC-B13E-4806-B321-9FFCAC5830F0@buechse.de> I assume you downloaded rxtx-217 (not 207). Instead of importing javax.comm.* you must import gnu.io.* The classes have the same name, but they are not in the same package. On 24.05.2006, at 06:50, YiQi Huang wrote: > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From yhua537 at cse.unsw.edu.au Wed May 24 00:17:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 16:17:45 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Message-ID: Thanks Tod again, i kept reading "gnu.io.*" as "gun.io.*" last few hours after i read some commons from web. Thanks very much Tod. thanks YiQi Huang On Tue, 23 May 2006, Tod E. Kurt wrote: > Yes, sorry, classpath entries are semicolon-separated on Windows and > colon-separated on everything else. > > Your example code below is importing the wrong set of classes. It > should not "import javax.comm.*", instead it should "import > gnu.io.*". When I make that change, your example program compiles. > The "javax.comm" package is the one released by Sun, the "gnu.io" > package is the RXTX one. You might've seen some discussion that the > two will be merged or become compatible, but that hasn't happened yet. > > -=tod > > > On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > >> >> Yes, Michael you are right, it should be semicolons, But it still >> can't >> find the correct library. >> >> On Wed, 24 May 2006, Michael Mester wrote: >> >>> I believe the entries in the classpath need to be seperated with >>> semicolons, not a colon as you have in your command below >>> >>> >>> -----Original Message----- >>> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >>> Sent: Wed 5/24/2006 12:50 AM >>> To: RXTX Developers and Users >>> Subject: Re: [Rxtx] install rxtx in XP >>> >>> Hi, >>> >>> Sorry guys.I follow Tod's instruction, and here is what i did: >>> >>> put >>> RXTXcomm.jar, >>> rxtxParallel.dll, >>> rxtxSerial.dll >>> in >>> C:\RXTX_files >>> >>> and I got a SimpleRead class attached below, compile it with : >>> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >>> it still saying "cannot find symbol". >>> >>> Is there anything I did wrong? Do I need the comm.jar from Sun? >>> >>> Thanks & regards >>> YiQi Huang >>> >>> >>> //////////////////////////////////////////////////////// >>> // SimpleRead.java >>> //////////////////////////////////////////////////////// >>> >>> import java.io.*; >>> import java.util.*; >>> import javax.comm.*; >>> >>> public class SimpleRead >>> implements Runnable, SerialPortEventListener { >>> static CommPortIdentifier portId; >>> static Enumeration portList; >>> InputStream inputStream; >>> SerialPort serialPort; >>> Thread readThread; >>> public static void main(String[] args) { >>> portList = CommPortIdentifier.getPortIdentifiers(); >>> while (portList.hasMoreElements()) { >>> portId = (CommPortIdentifier) portList.nextElement(); >>> if (portId.getPortType() == >>> CommPortIdentifier.PORT_SERIAL) { >>> if (portId.getName().equals("COM1")) { >>> //if (portId.getName().equals("/dev/term/a")) { >>> SimpleRead reader = new SimpleRead(); >>> } >>> } >>> } >>> } >>> public SimpleRead() { >>> try { >>> serialPort = (SerialPort) portId.open("SimpleReadApp", >>> 2000); >>> } catch (PortInUseException e) {} >>> try { >>> inputStream = serialPort.getInputStream(); >>> } catch (IOException e) {} >>> try { >>> serialPort.addEventListener(this); >>> } catch (TooManyListenersException e) {} >>> serialPort.notifyOnDataAvailable(true); >>> try { >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, >>> SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> } catch (UnsupportedCommOperationException e) {} >>> readThread = new Thread(this); >>> readThread.start(); >>> } >>> public void run() { >>> try { >>> Thread.sleep(20000); >>> } catch (InterruptedException e) {} >>> } >>> public void serialEvent(SerialPortEvent event) { >>> switch(event.getEventType()) { >>> case SerialPortEvent.BI: >>> case SerialPortEvent.OE: >>> case SerialPortEvent.FE: >>> case SerialPortEvent.PE: >>> case SerialPortEvent.CD: >>> case SerialPortEvent.CTS: >>> case SerialPortEvent.DSR: >>> case SerialPortEvent.RI: >>> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >>> break; >>> case SerialPortEvent.DATA_AVAILABLE: >>> byte[] readBuffer = new byte[20]; >>> try { >>> while (inputStream.available() > 0) { >>> int numBytes = inputStream.read(readBuffer); >>> } >>> System.out.print(new String(readBuffer)); >>> } catch (IOException e) {} >>> break; >>> } >>> } >>> } >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> >> cheers >> YiQi Huang >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From smontgomery at mediaspansoftware.com Wed May 24 10:24:13 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 12:24:13 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: Tod & Joachim, Thanks for the info, that's very helpful. I'll give that a whirl when I move to rxtx 2.1. I'm still using the older 2.0.7 version for now (don't ask), which probably requires the Sun comm.jar, javax.comm.properties and librxtxSerial.jnilib to be in very specific places in each jvm's file hierarchy. From tjarvi at qbang.org Wed May 24 11:59:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 11:59:16 -0600 (MDT) Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: On Wed, 24 May 2006, Sean Montgomery wrote: > Tod & Joachim, > > Thanks for the info, that's very helpful. I'll give that a whirl > when I move to rxtx 2.1. I'm still using the older 2.0.7 version for > now (don't ask), which probably requires the Sun comm.jar, > javax.comm.properties and librxtxSerial.jnilib to be in very specific > places in each jvm's file hierarchy. > You will need comm.jar from Sun then. It must be Sun's version 2.* or older for Linux or Solaris. I assume they have this in download archives. The default offering from Sun is version 3.0. This version currently does not support rxtx. The older version will probably be fine for your needs. -- Trent Jarvi tjarvi at qbang.org From smontgomery at mediaspansoftware.com Wed May 24 12:19:06 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 14:19:06 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: <3939EFB8-11E1-4E3E-A684-5B3C525577CD@mediaspansoftware.com> Yup, that's right, thanks Trent. I've been using these files for quite a while now. Thanks for bringing it up. I almost didn't mention using 2.0.7 because I didn't want to give any new members of the list the wrong idea! :-) On May 24, 2006, at 1:59 PM, Trent Jarvi wrote: > On Wed, 24 May 2006, Sean Montgomery wrote: > >> Tod & Joachim, >> >> Thanks for the info, that's very helpful. I'll give that a whirl >> when I move to rxtx 2.1. I'm still using the older 2.0.7 version for >> now (don't ask), which probably requires the Sun comm.jar, >> javax.comm.properties and librxtxSerial.jnilib to be in very specific >> places in each jvm's file hierarchy. >> > > You will need comm.jar from Sun then. It must be Sun's version 2.* or > older for Linux or Solaris. I assume they have this in download > archives. > > The default offering from Sun is version 3.0. This version > currently does > not support rxtx. > > The older version will probably be fine for your needs. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mark at mdsh.com Wed May 24 15:55:46 2006 From: mark at mdsh.com (Mark Himsley) Date: Wed, 24 May 2006 22:55:46 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <37B0FC4B1F3237321F093ABE@MacMini.local> On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) That's no problem. BUT, do note that the instructions I elaborated on are in the INSTALL file within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone please update the INSTALL file? > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > > , it includes DLLs for Windows and the JAR > > for Java. > > > > Follow the Windows instructions in the INSTALL. > > > > ie > > > > RXTXcomm.jar goes in \jre\lib\ext (under java) > > rxtxSerial.dll goes in \jre\bin > > > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > > C:\Program Files\Java\jre1.5.0_06\lib\ext > > and copy rxtxSerial.dll into > > C:\Program Files\Java\jre1.5.0_06\bin > > > > Yes, it really is that simple. > > > > > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > > > >> I am new to serial port programming, and have no experience on > >> programming java in xp, but my project require me to builld a > >> communication link between xp and a UART device. > >> > >> Most of the information in the web site seems for linux only. > >> including > >> the commands such as export and chmod. How do I install rxtx in xp? > >> > >> cheers > >> YiQi Huang > > > > > > > > -- > > Mark Himsley > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Mark Himsley From tjarvi at qbang.org Wed May 24 16:41:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 16:41:46 -0600 (MDT) Subject: [Rxtx] install rxtx in XP In-Reply-To: <37B0FC4B1F3237321F093ABE@MacMini.local> References: <37B0FC4B1F3237321F093ABE@MacMini.local> Message-ID: On Wed, 24 May 2006, Mark Himsley wrote: > > > On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > >> I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > That's no problem. > > BUT, do note that the instructions I elaborated on are in the INSTALL file > within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone > please update the INSTALL file? > > The INSTALL file may be updated by anyone at anytime. http://rxtx.qbang.org/wiki/index.php/Installation We are moving it to the wiki so end users may put the type of answers they would like to see in. Sometimes it's best if developers don't give what appears to be cryptic answers. You can even put in that jre/lib/ext is not the right place but you don't understand the classpath solution mentioned on the mail-list and then we know what to add. -- Trent Jarvi tjarvi at qbang.org From stramit at gmail.com Wed May 24 21:45:31 2006 From: stramit at gmail.com (Tim Cooper) Date: Thu, 25 May 2006 13:45:31 +1000 Subject: [Rxtx] Accessing Virtual Com Port Message-ID: Hi, I have to develop an application that talks to a virtual com port (in this case com3) which translates any messages sent across a USB cable to a micro. Using C++ I can talk to this com port and I know that it is configured, present, and working. For the application that I am trying to write I want to use RXTX for the communication. My problem is that the configured virtual port (in windows) is not showing up when I do an enumeration over the available ports. The output I get is (com 3 is not present) : Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 PORT FOUND: COM1 PORT FOUND: LPT1 Is there anything that I need to do to make com3 available to RXTX and my application? Timothy Cooper -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060524/c5591648/attachment-0006.html From antonio.luis at iscte.pt Thu May 25 01:39:13 2006 From: antonio.luis at iscte.pt (=?ISO-8859-1?Q?Ant=F3nio_Lopes?=) Date: Thu, 25 May 2006 08:39:13 +0100 Subject: [Rxtx] RXTX on Pocket PC Message-ID: <44755F21.8060103@iscte.pt> Hello everyone, I've been using RXTX to communicate with serial ports in Windows and it's been quite successful. However, I'm now considering porting my application from Windows to Pocket PC but I can't seem to find the RXTX binaries (*.jar and *.dll) to use in Pocket PC. I've been "digging" on the mailing list's archives and also on the web and I can't find these anywhere. Can anyone in this mailing list give me some pointers on this? Where can I find the necessary files and basic installation instructions? Thanks very much for your help. I very much appreciate any help that you can provide me. Regards, -- Ant?nio Lopes @contact: antonio.luis at iscte.pt @work: ADETTI - ISCTE @web: http://antonio.lopes.googlepages.com/home From doug at dupreeinc.com Fri May 26 15:45:50 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Fri, 26 May 2006 14:45:50 -0700 Subject: [Rxtx] rxtx slow startup Message-ID: <4477770E.9010400@dupreeinc.com> Hello, I hope there are people still reading this mailing list. The archive appeared to not have anything new after 4/2005. I was using the commapi from sun for a project where a java application reads data from test equipment connected to the serial port. I had to upgrade the ftdi vcp driver on my pc and the old sun commapi no longer works with hardware flow control. as an experiment I replaced the javax.com with gnu.io in the SerialDemo.java project that was included with the commapi. This compiled fine using JBuilder 2006 and JRE 1.5.0_05. RXTX also works with the latest ftdi drivers so life is wonderful again... almost... When using the commapi jar the SerialDemo program starts in about 1 second on my system. Using the RXTX jar it takes over 56 seconds to start. Has anyone else seen this problem? Is there a workaround to get the startup performance close to the old commapi? The last thing printed to the console before this delay is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks for your time! Doug From yhua537 at cse.unsw.edu.au Sat May 27 05:46:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 21:46:45 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <4477770E.9010400@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> Message-ID: hi Doug The archive hasn't been update for a long time, But people certainly still reading the list. I don't have enough experience to help on your problem, but without any detail about what your problem doing during that 56 seconds, it is hard to target the your question, I think. cheers YiQi On Fri, 26 May 2006, Doug Thistlethwaite wrote: > Hello, > > I hope there are people still reading this mailing list. The archive > appeared to not have anything new after 4/2005. > > I was using the commapi from sun for a project where a java application > reads data from test equipment connected to the serial port. I had to > upgrade the ftdi vcp driver on my pc and the old sun commapi no longer > works with hardware flow control. as an experiment I replaced the > javax.com with gnu.io in the SerialDemo.java project that was included > with the commapi. This compiled fine using JBuilder 2006 and JRE > 1.5.0_05. RXTX also works with the latest ftdi drivers so life is > wonderful again... almost... > > When using the commapi jar the SerialDemo program starts in about 1 > second on my system. Using the RXTX jar it takes over 56 seconds to > start. Has anyone else seen this problem? Is there a workaround to get > the startup performance close to the old commapi? > > The last thing printed to the console before this delay is: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Thanks for your time! > > Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------- Just a student, Still a student ------------------------------- From yhua537 at cse.unsw.edu.au Sat May 27 06:04:26 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 22:04:26 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: Sorry, I don't think you could understand what I mean .I mean this: Without any detail about what your program is doing during that 56 seconds, it is hard for anyone to target the problem. On Sat, 27 May 2006, YiQi Huang wrote: > hi Doug > > The archive hasn't been update for a long time, But people certainly still > reading the list. > > I don't have enough experience to help on your problem, but without any > detail about what your problem doing during that 56 seconds, it is hard to > target the your question, I think. > > cheers > YiQi > > On Fri, 26 May 2006, Doug Thistlethwaite wrote: > >> Hello, >> >> I hope there are people still reading this mailing list. The archive >> appeared to not have anything new after 4/2005. >> >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From jredman at ergotech.com Sat May 27 08:32:02 2006 From: jredman at ergotech.com (Jim Redman) Date: Sat, 27 May 2006 08:32:02 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: <447862E2.4080506@ergotech.com> Doug, Since you mentioned it, we have a system that is also seems slow. From memory (I don't have one of the slow systems around), I'm not sure that it's consistent, it seems that sometimes it may take longer than others. Since it's part of the bootup it hasn't raised a flag and I haven't researched it. The same code runs much faster on other systems, so now you've got me wondering what's different. The slow system boots DSL (http://www.damnsmalllinux.org/) from a compact flash. FC4 is on my desktop where I haven't noticed a slow down. I think that the rxtx code is the same in both cases with lock files disabled. The slow system has a bunch of serial ports defined, including 4 USB serial ports that do not exist - they are not plugged in. Any clues in there? Jim > On Fri, 26 May 2006, Doug Thistlethwaite wrote: >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Sat May 27 10:41:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 May 2006 10:41:54 -0600 (MDT) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447862E2.4080506@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: On Sat, 27 May 2006, Jim Redman wrote: > Doug, > > Since you mentioned it, we have a system that is also seems slow. From > memory (I don't have one of the slow systems around), I'm not sure that > it's consistent, it seems that sometimes it may take longer than others. > Since it's part of the bootup it hasn't raised a flag and I haven't > researched it. > > The same code runs much faster on other systems, so now you've got me > wondering what's different. > > The slow system boots DSL (http://www.damnsmalllinux.org/) from a > compact flash. FC4 is on my desktop where I haven't noticed a slow > down. I think that the rxtx code is the same in both cases with lock > files disabled. > > The slow system has a bunch of serial ports defined, including 4 USB > serial ports that do not exist - they are not plugged in. > > Any clues in there? > rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. When it does this, it will try to open each port and do a timed out read. most systems will not have entries in device if the port is not there. But some minimal systems will just put all the device files there in case hardware is added. The list of devices scanned used to be ~10-20 times longer than it is today. That was getting very slow. I suspect moving the device files not used to a backup directory would increase the enumeration. I'll look into why the mail-list archive is not updating. The last update was about when I thought I 'fixed' the cron jobs. I probably didn't actually fix it but rather moved the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon May 29 19:46:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 May 2006 19:46:47 -0600 (MDT) Subject: [Rxtx] Mail-List Archives are updating. Message-ID: It was pointed out earlier that the archive is dated. This was a missing crontab entry. The list is currently archived by the week on the web page. It is updated once a day. So every 7 days it starts a new link and updates it daily. I've been limited in what I could do while my cable modem was disconnected this last week. rxtx.org is something I do on my own time. The patches and credits will be comming next. Many of these can be seen in bugzilla right now. -- Trent Jarvi tjarvi at qbang.org From doug at dupreeinc.com Tue May 30 11:18:41 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 10:18:41 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: <447C7E71.4080204@dupreeinc.com> Trent, YiQi, and Jim: Thanks to all for the replies and information! I am just back from a long weekend and I am now trying to figure out what I was doing! :) As for more information. First off, this example is being run under windows XP. I am developing test equipment that communicates with a java application via a serial port. I have been using the commapi for several years and have not had a problem. Recently, I have started a design modification that will replace the RS232 connection with a USB port. I am using the ftdi module for prototyping and I discovered that their virtual com port driver was not compatible with the commapi that Sun released. It turns out that it has problems with hardware flow control ( it works on incoming but not outgoing communications). The way I figured this out was by experimenting with the SerialDemo that was included with the Sum commapi. One nice thing about this example is it has the ability to set incoming and outgoing flow control independently. After I installed RXTX into my JBuilder 2006 IDE, I just replaced all all instances of javax.comm with gnu.io and it compiled and runs without a hitch (except for the slow startup). I Paused the JBuilder IDE during this long pause and the last few entries in the stack trace are: testRead() : -1, gnu.io.RXTXCommDriver registerValidPorts() : 255, gnu.io.RXTXCommDriver registerScannedPorts() : 777, gnu.io.RXTXCommDriver This was all initiated by the following call in the programs init routine: Enumeration en = CommPortIdentifier.getPortIdentifiers(); After looking at this, My guess is that Trent is correct in that the delay is in scanning for ports. I guess one solution would be to not scan for ports, though it would be nice to detect what is available on the system. Is there any way to reduce the number of ports scanned by this function in windows XP? Thanks again for your time, Doug Trent Jarvi wrote: >On Sat, 27 May 2006, Jim Redman wrote: > > > >>Doug, >> >>Since you mentioned it, we have a system that is also seems slow. From >>memory (I don't have one of the slow systems around), I'm not sure that >>it's consistent, it seems that sometimes it may take longer than others. >>Since it's part of the bootup it hasn't raised a flag and I haven't >>researched it. >> >>The same code runs much faster on other systems, so now you've got me >>wondering what's different. >> >>The slow system boots DSL (http://www.damnsmalllinux.org/) from a >>compact flash. FC4 is on my desktop where I haven't noticed a slow >>down. I think that the rxtx code is the same in both cases with lock >>files disabled. >> >>The slow system has a bunch of serial ports defined, including 4 USB >>serial ports that do not exist - they are not plugged in. >> >>Any clues in there? >> >> >> > >rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. > >When it does this, it will try to open each port and do a timed out read. >most systems will not have entries in device if the port is not there. >But some minimal systems will just put all the device files there in case >hardware is added. > >The list of devices scanned used to be ~10-20 times longer than it is >today. That was getting very slow. > >I suspect moving the device files not used to a backup directory would >increase the enumeration. > >I'll look into why the mail-list archive is not updating. The last update >was about when I thought I 'fixed' the cron jobs. I probably didn't >actually fix it but rather moved the problem. > >-- >Trent Jarvi >tjarvi at qbang.org > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/86796453/attachment-0006.html From doug at dupreeinc.com Tue May 30 14:36:09 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 13:36:09 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447C7E71.4080204@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com> Message-ID: <447CACB9.1000801@dupreeinc.com> Hello all, I also notice this pause (not as long however) when I call: CommPortIdentifier.getPortIdentifier(PortName); I would think that if I supply the name of the port, it would not have to go through the same discovery process. If you have any ideas of how to get rid of this startup delay, I would really appreciate it. Thanks, Doug Doug Thistlethwaite wrote: > Trent, YiQi, and Jim: > > Thanks to all for the replies and information! I am just back from a > long weekend and I am now trying to figure out what I was doing! :) > > As for more information. First off, this example is being run under > windows XP. I am developing test equipment that communicates with a > java application via a serial port. I have been using the commapi for > several years and have not had a problem. Recently, I have started a > design modification that will replace the RS232 connection with a USB > port. I am using the ftdi module for prototyping and I discovered > that their virtual com port driver was not compatible with the commapi > that Sun released. It turns out that it has problems with hardware > flow control ( it works on incoming but not outgoing communications). > The way I figured this out was by experimenting with the SerialDemo > that was included with the Sum commapi. One nice thing about this > example is it has the ability to set incoming and outgoing flow > control independently. > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup). > > I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are: > > testRead() : -1, gnu.io.RXTXCommDriver > registerValidPorts() : 255, gnu.io.RXTXCommDriver > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > This was all initiated by the following call in the programs init routine: > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > After looking at this, My guess is that Trent is correct in that the > delay is in scanning for ports. I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system. Is there any way to reduce the number of ports scanned by > this function in windows XP? > > Thanks again for your time, > > Doug > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/edaa5c3c/attachment-0006.html From lynn at swcp.com Tue May 30 15:07:18 2006 From: lynn at swcp.com (lynn@swcp.com) Date: Tue, 30 May 2006 21:07:18 -0000 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CACB9.1000801@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: *IF* the name of the port is supplied, we might want to use the preferences mechanism (java.util.prefs) where we could have previously saved the info for the port. We could do a quick check to see that things have not changed before using it. If things have changed (or never been defined) we would do a full port scan and save detected ports in the preferences. This way if the hardware is not changed, you only pay the time penalty one time. just an idea... Lynn Doug Thistlethwaite said: > This is a multi-part message in MIME format. > --------------070808020900080005070500 > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > Content-Transfer-Encoding: 7bit > > Hello all, > > I also notice this pause (not as long however) when I call: > > CommPortIdentifier.getPortIdentifier(PortName); > > I would think that if I supply the name of the port, it would not have > to go through the same discovery process. If you have any ideas of how > to get rid of this startup delay, I would really appreciate it. > > Thanks, > > Doug > > Doug Thistlethwaite wrote: > > > Trent, YiQi, and Jim: > > > > Thanks to all for the replies and information! I am just back from a > > long weekend and I am now trying to figure out what I was doing! :) > > > > As for more information. First off, this example is being run under > > windows XP. I am developing test equipment that communicates with a > > java application via a serial port. I have been using the commapi for > > several years and have not had a problem. Recently, I have started a > > design modification that will replace the RS232 connection with a USB > > port. I am using the ftdi module for prototyping and I discovered > > that their virtual com port driver was not compatible with the commapi > > that Sun released. It turns out that it has problems with hardware > > flow control ( it works on incoming but not outgoing communications). > > The way I figured this out was by experimenting with the SerialDemo > > that was included with the Sum commapi. One nice thing about this > > example is it has the ability to set incoming and outgoing flow > > control independently. > > > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > > all instances of javax.comm with gnu.io and it compiled and runs > > without a hitch (except for the slow startup). > > > > I Paused the JBuilder IDE during this long pause and the last few > > entries in the stack trace are: > > > > testRead() : -1, gnu.io.RXTXCommDriver > > registerValidPorts() : 255, gnu.io.RXTXCommDriver > > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > > > This was all initiated by the following call in the programs init routine: > > > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > > > After looking at this, My guess is that Trent is correct in that the > > delay is in scanning for ports. I guess one solution would be to not > > scan for ports, though it would be nice to detect what is available on > > the system. Is there any way to reduce the number of ports scanned by > > this function in windows XP? > > > > Thanks again for your time, > > > > Doug > > > > --------------070808020900080005070500 > Content-Type: text/html; charset=ISO-8859-1 > Content-Transfer-Encoding: 7bit > > > > > > > > > Hello all,
>
> I also notice this pause (not as long however) when I call:
>
>          CommPortIdentifier.getPortIdentifier(PortName);
>
> I would think that if I supply the name of the port, it would not have > to go through the same discovery process.  If you have any ideas of how > to get rid of this startup delay, I would really appreciate it.
>
> Thanks,
>
> Doug
>
> Doug Thistlethwaite wrote: >
> > Trent, YiQi, and Jim:
>
> Thanks to all for the replies and information!  I am just back from a > long weekend and I am now trying to figure out what I was doing! :)
>
> As for more information.  First off, this example is being run under > windows XP.  I am developing test equipment that communicates with a > java application via a serial port.  I have been using the commapi for > several years and have not had a problem.  Recently, I have started a > design modification that will replace the RS232 connection with a USB > port.  I am using the ftdi module for prototyping and I discovered that > their virtual com port driver was not compatible with the commapi that > Sun released.  It turns out that it has problems with hardware flow > control ( it works on incoming but not outgoing communications).  The > way I figured this out was by experimenting with the SerialDemo that > was included with the Sum commapi.  One nice thing about this example > is it has the ability to set incoming and outgoing flow control > independently.
>
> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup).
>
> I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are:
>
> testRead() : -1, gnu.io.RXTXCommDriver
> registerValidPorts() : 255, gnu.io.RXTXCommDriver
> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>
> This was all initiated by the following call in the programs init > routine:
>
> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>
> After looking at this,  My guess is that Trent is correct in that the > delay is in scanning for ports.  I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system.  Is there any way to reduce the number of ports scanned by > this function in windows XP? 
>
> Thanks again for your time,
>
> Doug
>
>
> > > > --------------070808020900080005070500-- > -- From jredman at ergotech.com Tue May 30 15:42:35 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 30 May 2006 15:42:35 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: <447CBC4B.2080206@ergotech.com> Lynn, If I understand your idea correctly, I don't think that this would work well for, say, USB ports since these can be easily added/removed by the end user. Jim lynn at swcp.com wrote: > *IF* the name of the port is supplied, we might want to use the preferences > mechanism (java.util.prefs) where we could have previously saved the info for > the port. We could do a quick check to see that things have not changed > before using it. If things have changed (or never been defined) we would do a > full port scan and save detected ports in the preferences. > > This way if the hardware is not changed, you only pay the time penalty one time. > > just an idea... > Lynn > > > Doug Thistlethwaite said: > >> This is a multi-part message in MIME format. >> --------------070808020900080005070500 >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >> Content-Transfer-Encoding: 7bit >> >> Hello all, >> >> I also notice this pause (not as long however) when I call: >> >> CommPortIdentifier.getPortIdentifier(PortName); >> >> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process. If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it. >> >> Thanks, >> >> Doug >> >> Doug Thistlethwaite wrote: >> >>> Trent, YiQi, and Jim: >>> >>> Thanks to all for the replies and information! I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :) >>> >>> As for more information. First off, this example is being run under >>> windows XP. I am developing test equipment that communicates with a >>> java application via a serial port. I have been using the commapi for >>> several years and have not had a problem. Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port. I am using the ftdi module for prototyping and I discovered >>> that their virtual com port driver was not compatible with the commapi >>> that Sun released. It turns out that it has problems with hardware >>> flow control ( it works on incoming but not outgoing communications). >>> The way I figured this out was by experimenting with the SerialDemo >>> that was included with the Sum commapi. One nice thing about this >>> example is it has the ability to set incoming and outgoing flow >>> control independently. >>> >>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup). >>> >>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are: >>> >>> testRead() : -1, gnu.io.RXTXCommDriver >>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>> >>> This was all initiated by the following call in the programs init routine: >>> >>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>> >>> After looking at this, My guess is that Trent is correct in that the >>> delay is in scanning for ports. I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system. Is there any way to reduce the number of ports scanned by >>> this function in windows XP? >>> >>> Thanks again for your time, >>> >>> Doug >>> >> --------------070808020900080005070500 >> Content-Type: text/html; charset=ISO-8859-1 >> Content-Transfer-Encoding: 7bit >> >> >> >> >> >> >> >> >> Hello all,
>>
>> I also notice this pause (not as long however) when I call:
>>
>>         >  CommPortIdentifier.getPortIdentifier(PortName);
>>
>> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process.  If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it.
>>
>> Thanks,
>>
>> Doug
>>
>> Doug Thistlethwaite wrote: >>
>> >> Trent, YiQi, and Jim:
>>
>> Thanks to all for the replies and information!  I am just back from a >> long weekend and I am now trying to figure out what I was doing! :)
>>
>> As for more information.  First off, this example is being run under >> windows XP.  I am developing test equipment that communicates with a >> java application via a serial port.  I have been using the commapi for >> several years and have not had a problem.  Recently, I have started a >> design modification that will replace the RS232 connection with a USB >> port.  I am using the ftdi module for prototyping and I discovered that >> their virtual com port driver was not compatible with the commapi that >> Sun released.  It turns out that it has problems with hardware flow >> control ( it works on incoming but not outgoing communications).  The >> way I figured this out was by experimenting with the SerialDemo that >> was included with the Sum commapi.  One nice thing about this example >> is it has the ability to set incoming and outgoing flow control >> independently.
>>
>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >> all instances of javax.comm with gnu.io and it compiled and runs >> without a hitch (except for the slow startup).
>>
>> I Paused the JBuilder IDE during this long pause and the last few >> entries in the stack trace are:
>>
>> testRead() : -1, gnu.io.RXTXCommDriver
>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>
>> This was all initiated by the following call in the programs init >> routine:
>>
>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>
>> After looking at this,  My guess is that Trent is correct in that the >> delay is in scanning for ports.  I guess one solution would be to not >> scan for ports, though it would be nice to detect what is available on >> the system.  Is there any way to reduce the number of ports scanned by >> this function in windows XP? 
>>
>> Thanks again for your time,
>>
>> Doug
>>
>>
>> >> >> >> --------------070808020900080005070500-- >> > > > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From yhua537 at cse.unsw.edu.au Tue May 30 18:10:23 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 31 May 2006 10:10:23 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CBC4B.2080206@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: Doug, In the SerialDemo, it allow us to save the parameters into a file, and use it when your program start up. Would this help? YiQi On Tue, 30 May 2006, Jim Redman wrote: > Lynn, > > If I understand your idea correctly, I don't think that this would work > well for, say, USB ports since these can be easily added/removed by the > end user. > > Jim > > lynn at swcp.com wrote: >> *IF* the name of the port is supplied, we might want to use the preferences >> mechanism (java.util.prefs) where we could have previously saved the info for >> the port. We could do a quick check to see that things have not changed >> before using it. If things have changed (or never been defined) we would do a >> full port scan and save detected ports in the preferences. >> >> This way if the hardware is not changed, you only pay the time penalty one time. >> >> just an idea... >> Lynn >> >> >> Doug Thistlethwaite said: >> >>> This is a multi-part message in MIME format. >>> --------------070808020900080005070500 >>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>> Content-Transfer-Encoding: 7bit >>> >>> Hello all, >>> >>> I also notice this pause (not as long however) when I call: >>> >>> CommPortIdentifier.getPortIdentifier(PortName); >>> >>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process. If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it. >>> >>> Thanks, >>> >>> Doug >>> >>> Doug Thistlethwaite wrote: >>> >>>> Trent, YiQi, and Jim: >>>> >>>> Thanks to all for the replies and information! I am just back from a >>>> long weekend and I am now trying to figure out what I was doing! :) >>>> >>>> As for more information. First off, this example is being run under >>>> windows XP. I am developing test equipment that communicates with a >>>> java application via a serial port. I have been using the commapi for >>>> several years and have not had a problem. Recently, I have started a >>>> design modification that will replace the RS232 connection with a USB >>>> port. I am using the ftdi module for prototyping and I discovered >>>> that their virtual com port driver was not compatible with the commapi >>>> that Sun released. It turns out that it has problems with hardware >>>> flow control ( it works on incoming but not outgoing communications). >>>> The way I figured this out was by experimenting with the SerialDemo >>>> that was included with the Sum commapi. One nice thing about this >>>> example is it has the ability to set incoming and outgoing flow >>>> control independently. >>>> >>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>> all instances of javax.comm with gnu.io and it compiled and runs >>>> without a hitch (except for the slow startup). >>>> >>>> I Paused the JBuilder IDE during this long pause and the last few >>>> entries in the stack trace are: >>>> >>>> testRead() : -1, gnu.io.RXTXCommDriver >>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>> >>>> This was all initiated by the following call in the programs init routine: >>>> >>>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>> >>>> After looking at this, My guess is that Trent is correct in that the >>>> delay is in scanning for ports. I guess one solution would be to not >>>> scan for ports, though it would be nice to detect what is available on >>>> the system. Is there any way to reduce the number of ports scanned by >>>> this function in windows XP? >>>> >>>> Thanks again for your time, >>>> >>>> Doug >>>> >>> --------------070808020900080005070500 >>> Content-Type: text/html; charset=ISO-8859-1 >>> Content-Transfer-Encoding: 7bit >>> >>> >>> >>> >>> >>> >>> >>> >>> Hello all,
>>>
>>> I also notice this pause (not as long however) when I call:
>>>
>>>         >>  CommPortIdentifier.getPortIdentifier(PortName);
>>>
>>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process.  If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it.
>>>
>>> Thanks,
>>>
>>> Doug
>>>
>>> Doug Thistlethwaite wrote: >>>
>>> >>> Trent, YiQi, and Jim:
>>>
>>> Thanks to all for the replies and information!  I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :)
>>>
>>> As for more information.  First off, this example is being run under >>> windows XP.  I am developing test equipment that communicates with a >>> java application via a serial port.  I have been using the commapi for >>> several years and have not had a problem.  Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port.  I am using the ftdi module for prototyping and I discovered that >>> their virtual com port driver was not compatible with the commapi that >>> Sun released.  It turns out that it has problems with hardware flow >>> control ( it works on incoming but not outgoing communications).  The >>> way I figured this out was by experimenting with the SerialDemo that >>> was included with the Sum commapi.  One nice thing about this example >>> is it has the ability to set incoming and outgoing flow control >>> independently.
>>>
>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup).
>>>
>>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are:
>>>
>>> testRead() : -1, gnu.io.RXTXCommDriver
>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>
>>> This was all initiated by the following call in the programs init >>> routine:
>>>
>>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>
>>> After looking at this,  My guess is that Trent is correct in that the >>> delay is in scanning for ports.  I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system.  Is there any way to reduce the number of ports scanned by >>> this function in windows XP? 
>>>
>>> Thanks again for your time,
>>>
>>> Doug
>>>
>>>
>>> >>> >>> >>> --------------070808020900080005070500-- >>> >> >> >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From halbleib at rechnerbetriebsgruppe.de Wed May 31 02:06:16 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 10:06:16 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp Message-ID: <447D4E78.30302@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, I getting an error while reloading my app in tomcat. At the first start everything runs well, but if i reload mit webapp by tomcat manager i get the following error. java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader Is there a possibility to unload the native library rxtxSerial.dll? thx for all help! regards tom -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 b8FT80HQ1xlbDLnRecDANCc= =heb1 -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 02:52:17 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 10:52:17 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D4E78.30302@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> Message-ID: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Hello Tom, To the best of my knowledge it is impossible to unload native libraries once loaded into the JVM. The exception you see stems from the fact, that Tomcat creates a new classloader when you "reload" the weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar is loaded from the session class loader. Try to add RXTXComm.jar to your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. Regards, Joachim On 31.05.2006, at 10:06, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 > b8FT80HQ1xlbDLnRecDANCc= > =heb1 > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From halbleib at rechnerbetriebsgruppe.de Wed May 31 03:28:35 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 11:28:35 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Message-ID: <447D61C3.1030807@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Joachim, I'm still not getting it. How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml-file? Perhaps web.xml? Regards, Tom Joachim Buechse schrieb: > Hello Tom, > > To the best of my knowledge it is impossible to unload native > libraries once loaded into the JVM. The exception you see stems from > the fact, that Tomcat creates a new classloader when you "reload" the > weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar > is loaded from the session class loader. Try to add RXTXComm.jar to > your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. > > Regards, > Joachim > > On 31.05.2006, at 10:06, Tom Halbleib wrote: > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL tzNy+/0iIUfkYYgt1+UT1ko= =pkpY -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 04:03:42 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 12:03:42 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D61C3.1030807@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> <447D61C3.1030807@rechnerbetriebsgruppe.de> Message-ID: -Xbootclasspath/a: is a start option to the java vm. Google is your friend in finding how to modfiy it and what it means: tomcat modifying bootclasspath Regards, Joachim On 31.05.2006, at 11:28, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Joachim, > > I'm still not getting it. > How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml- > file? > Perhaps web.xml? > > Regards, > Tom > > Joachim Buechse schrieb: >> Hello Tom, >> >> To the best of my knowledge it is impossible to unload native >> libraries once loaded into the JVM. The exception you see stems from >> the fact, that Tomcat creates a new classloader when you "reload" the >> weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar >> is loaded from the session class loader. Try to add RXTXComm.jar to >> your bootlclasspath (-Xbootclasspath/a:) and the problem should go >> away. >> >> Regards, >> Joachim >> >> On 31.05.2006, at 10:06, Tom Halbleib wrote: >> >> Hi all, >> >> I getting an error while reloading my app in tomcat. At the first >> start >> everything runs well, but if i reload mit webapp by tomcat manager >> i get >> the following error. >> >> java.lang.UnsatisfiedLinkError: Native Library >> C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in >> another classloader thrown while loading gnu.io.RXTXCommDriver >> Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: >> Native >> Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already >> loaded >> in another classloader >> >> >> Is there a possibility to unload the native library rxtxSerial.dll? >> >> thx for all help! >> >> regards >> >> tom > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL > tzNy+/0iIUfkYYgt1+UT1ko= > =pkpY > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From impakt01 at optusnet.com.au Wed May 31 06:55:42 2006 From: impakt01 at optusnet.com.au (Daren) Date: Wed, 31 May 2006 22:55:42 +1000 Subject: [Rxtx] (no subject) Message-ID: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/ade7ad37/attachment-0006.html From doug at dupreeinc.com Wed May 31 10:19:19 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 31 May 2006 09:19:19 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: <447DC207.3070702@dupreeinc.com> I am not sure what you are saying. The Save parameters menu option saves the current settings (baud, data bits, etc.). The long pause (~60 seconds) is when the application first starts (before loading the saved parameters). This does bring up a question, though I hate this type of kludge approach to getting this library to work... What exactly is a PortIdentifier? Is it always the same? If I stored the results from "CommPortIdentifier.getPortIdentifier(PortName);" in a file, could I use this the next time the program is executed? In this case I am using a virtual com port driver to connect to the device through a USB port. Doug YiQi Huang wrote: >Doug, > >In the SerialDemo, it allow us to save the parameters into a file, and use >it when your program start up. Would this help? > >YiQi > >On Tue, 30 May 2006, Jim Redman wrote: > > > >>Lynn, >> >>If I understand your idea correctly, I don't think that this would work >>well for, say, USB ports since these can be easily added/removed by the >>end user. >> >>Jim >> >>lynn at swcp.com wrote: >> >> >>>*IF* the name of the port is supplied, we might want to use the preferences >>>mechanism (java.util.prefs) where we could have previously saved the info for >>>the port. We could do a quick check to see that things have not changed >>>before using it. If things have changed (or never been defined) we would do a >>>full port scan and save detected ports in the preferences. >>> >>>This way if the hardware is not changed, you only pay the time penalty one time. >>> >>>just an idea... >>>Lynn >>> >>> >>>Doug Thistlethwaite said: >>> >>> >>> >>>>This is a multi-part message in MIME format. >>>>--------------070808020900080005070500 >>>>Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>>>Content-Transfer-Encoding: 7bit >>>> >>>>Hello all, >>>> >>>>I also notice this pause (not as long however) when I call: >>>> >>>> CommPortIdentifier.getPortIdentifier(PortName); >>>> >>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process. If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it. >>>> >>>>Thanks, >>>> >>>>Doug >>>> >>>>Doug Thistlethwaite wrote: >>>> >>>> >>>> >>>>>Trent, YiQi, and Jim: >>>>> >>>>>Thanks to all for the replies and information! I am just back from a >>>>>long weekend and I am now trying to figure out what I was doing! :) >>>>> >>>>>As for more information. First off, this example is being run under >>>>>windows XP. I am developing test equipment that communicates with a >>>>>java application via a serial port. I have been using the commapi for >>>>>several years and have not had a problem. Recently, I have started a >>>>>design modification that will replace the RS232 connection with a USB >>>>>port. I am using the ftdi module for prototyping and I discovered >>>>>that their virtual com port driver was not compatible with the commapi >>>>>that Sun released. It turns out that it has problems with hardware >>>>>flow control ( it works on incoming but not outgoing communications). >>>>>The way I figured this out was by experimenting with the SerialDemo >>>>>that was included with the Sum commapi. One nice thing about this >>>>>example is it has the ability to set incoming and outgoing flow >>>>>control independently. >>>>> >>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>>without a hitch (except for the slow startup). >>>>> >>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>>entries in the stack trace are: >>>>> >>>>>testRead() : -1, gnu.io.RXTXCommDriver >>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>>> >>>>>This was all initiated by the following call in the programs init routine: >>>>> >>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>>> >>>>>After looking at this, My guess is that Trent is correct in that the >>>>>delay is in scanning for ports. I guess one solution would be to not >>>>>scan for ports, though it would be nice to detect what is available on >>>>>the system. Is there any way to reduce the number of ports scanned by >>>>>this function in windows XP? >>>>> >>>>>Thanks again for your time, >>>>> >>>>>Doug >>>>> >>>>> >>>>> >>>>--------------070808020900080005070500 >>>>Content-Type: text/html; charset=ISO-8859-1 >>>>Content-Transfer-Encoding: 7bit >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>>Hello all,
>>>>
>>>>I also notice this pause (not as long however) when I call:
>>>>
>>>>        >>>> >>>> >>> CommPortIdentifier.getPortIdentifier(PortName);
>>> >>> >>>>
>>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process.  If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it.
>>>>
>>>>Thanks,
>>>>
>>>>Doug
>>>>
>>>>Doug Thistlethwaite wrote: >>>>
>>>> >>>>Trent, YiQi, and Jim:
>>>>
>>>>Thanks to all for the replies and information!  I am just back from a >>>>long weekend and I am now trying to figure out what I was doing! :)
>>>>
>>>>As for more information.  First off, this example is being run under >>>>windows XP.  I am developing test equipment that communicates with a >>>>java application via a serial port.  I have been using the commapi for >>>>several years and have not had a problem.  Recently, I have started a >>>>design modification that will replace the RS232 connection with a USB >>>>port.  I am using the ftdi module for prototyping and I discovered that >>>>their virtual com port driver was not compatible with the commapi that >>>>Sun released.  It turns out that it has problems with hardware flow >>>>control ( it works on incoming but not outgoing communications).  The >>>>way I figured this out was by experimenting with the SerialDemo that >>>>was included with the Sum commapi.  One nice thing about this example >>>>is it has the ability to set incoming and outgoing flow control >>>>independently.
>>>>
>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>without a hitch (except for the slow startup).
>>>>
>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>entries in the stack trace are:
>>>>
>>>>testRead() : -1, gnu.io.RXTXCommDriver
>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>>
>>>>This was all initiated by the following call in the programs init >>>>routine:
>>>>
>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>>
>>>>After looking at this,  My guess is that Trent is correct in that the >>>>delay is in scanning for ports.  I guess one solution would be to not >>>>scan for ports, though it would be nice to detect what is available on >>>>the system.  Is there any way to reduce the number of ports scanned by >>>>this function in windows XP? 
>>>>
>>>>Thanks again for your time,
>>>>
>>>>Doug
>>>>
>>>>
>>>> >>>> >>>> >>>>--------------070808020900080005070500-- >>>> >>>> >>>> >>> >>> >>> >>-- >>Jim Redman >>(505) 662 5156 x85 >>http://www.ergotech.com >>_______________________________________________ >>Rxtx mailing list >>Rxtx at qbang.org >>http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > >cheers >YiQi Huang >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/61d4d4c9/attachment-0006.html From impakt01 at optusnet.com.au Wed May 31 17:02:54 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 09:02:54 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Message-ID: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Hi all, I downloaded 2.1.7-pre16 and managed to build it and get it going. I made the changes as suggested by Peter Smith in an old post, by adding his code to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. Still not working, it opens the port at 9600 according to portmon.exe . Has anyone managed to get this going at a custom rate? Here is the post I'm referring to: http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 Thanks, Daren ________________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Daren Sent: Wednesday, 31 May 2006 10:56 PM To: rxtx at qbang.org Subject: [Rxtx] (no subject) Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren From tjarvi at qbang.org Wed May 31 21:44:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 May 2006 21:44:01 -0600 (MDT) Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> References: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Message-ID: On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org From impakt01 at optusnet.com.au Wed May 31 22:06:04 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 14:06:04 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: Message-ID: <200606010406.k51464X2010447@mail03.syd.optusnet.com.au> Trent, I have managed to successfully open the port at this speed using Realterm (available on sourceforge). From memory this uses DLPortIO. Using portmon.exe with realterm, even there it says that the port has opened at 1953. I changed termios.c:560 to dcb->BaudRate = 1953 ; and it still opens the port at 9600. Daren -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Thursday, 1 June 2006 1:44 PM To: RXTX Developers and Users Subject: Re: [Rxtx] custom baud rate win32 On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From smontgomery at mediaspansoftware.com Mon May 1 09:52:28 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 11:52:28 -0400 Subject: [Rxtx] RXTX, Java COMM and Windows Server 2003 on x64 experiences? Message-ID: Just wondering if anybody here has had to deploy RXTX or the javax.comm on Windows Server 2003 machines running on x64 (i.e. Xeon EM64T) and would like to relate how things went. From Sun's site, the Supported System Configurations pages give the options for that system: Java 5.0: - 32-bit Java 5.0 running on the OS in the 32-bit mode - 64-bit Java 5.0 running on the OS in the 64-bit native mode Java 1.4.2: - no options listed for EM64T processors, but potentially the standard 32-bit Java 1.4.2 could run on the OS in 32-bit mode? I guess the two main points of failure would be 1) the JVM itself and 2) the jni components. Make that three: there's gotta be hardware vendor driver support for the OS in the various modes, too. Guess I better go look at Keyspan's website... Thanks in advance for any info anyone might be able to provide. From smontgomery at mediaspansoftware.com Mon May 1 10:18:33 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 12:18:33 -0400 Subject: [Rxtx] Mailing list archive out of date? Message-ID: The mailing list archive at: http://mailman.qbang.org/pipermail/rxtx/ only shows emails through the end of March. Is there a new archive somewhere else? Didn't see anything mentioned on the wiki. From p.cain at phasefale.com.au Mon May 1 22:33:09 2006 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 02 May 2006 14:33:09 +1000 Subject: [Rxtx] RXTX and the Linux kernel. Message-ID: <4456E105.5080106@phasefale.com.au> Hi, First off the problem I am having isn't caused by RXTX itself but I'm hoping someone out there may have some knowledge that may help me. Background: I have an application monitoring a control system through a standard PC serial port which I talk to with rxtx-2.0.5. The application runs on RedHat7.3 kernel version 2.4.18 using Java 1.4. This configuration has been in use for several years and has proved to be stable. But it has become necessary for me to upgrade the OS but I'm running into problems with the serial communications. Its not that the comms don't work on the new OS (its never that simple) the comms work for a variable period of time (sometimes several hours) and then just stop, nothing on the data lines and control lines all indicate that data could flow. The new OS is Ubuntu 5.10 running kernel version 2.6.12. I have installed the OS and software on a PC and had it perform ok, then install the new OS and same software on the very same hardware and experienced the problems of them comms stopping. In the new OS I'm using Java5 to run the app but since I have experience the problem I reverted back to Java1.4 which didn't fix the problem. I've moved the app to a different system RedHat FC3 running 2.6.14 had experienced the problem. Not wanting to go through all the thing I have tried but I have established that it seems to be the 2.6 versions of the kernel that seem to be the problem and not an individual distribution of Linux. I should point out that I am using the same jar and library files for each java and OS combination. So I'm just wondering if anyone has had or heard of problems similar to these ? Or perhaps might know of what changed in the Linux serial driver (something I'm having a hard time establishing). I'm starting to run low on ideas of what to try so any help would be much appreciated. -- Peter Cain Senior Programmer Phasefale Pty Ltd From tjarvi at qbang.org Wed May 3 07:31:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 May 2006 07:31:00 -0600 (MDT) Subject: [Rxtx] Re: Concering ircomm and RXTX In-Reply-To: References: Message-ID: On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From legolas.w at gmail.com Wed May 3 08:46:23 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 19:16:23 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <4458C23F.2000003@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From legolas.w at gmail.com Wed May 3 13:10:57 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 23:40:57 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <44590041.80706@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From Lars.Hennig at wow-portal.com Thu May 4 00:39:15 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Thu, 4 May 2006 08:39:15 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: Message-ID: Hi, I could not find any solution. I therefore decided to to my own native implementation. Allthough it only supports the functions I need, it works pretty well now for me. I think the main problem there is the use of a wrong Windows API function and not setting an timeout. Regards, Lars Hennig W?rth Online World GmbH Tel. (0049)7181-258183 Mob. (0049)160-3522889 Fax. (0049)7940-153299 Lars.Hennig at wow-portal.com Gesendet von: rxtx-bounces at qbang.org 09.04.2006 10:42 Bitte antworten zu RXTX Developers and Users An d.herwald at dsh-elektronik.de, RXTX Developers and Users Kopie Thema Re: [Rxtx] USB Serialport - disconnection problems WV Proj./Teilpr.: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/7b39f374/attachment-0007.html From Pawan.Kharbanda at dot.state.co.us Thu May 4 11:00:58 2006 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Thu, 4 May 2006 11:00:58 -0600 Subject: [Rxtx] Dangling Lock Files Message-ID: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Hi, I have been using RXTX API's for the Serial Communication for quite some time now and for some of the devices we are opening and closing the connection every 2 minutes. This works great for few days and then suddenly I start seeing some "Port in Use Exception" and I see that the Lock files are still in the /var/lock folder after manually removing the lock files it works good for few hours and I see the same problem again. Can somebody explain me the scenarios why I am seeing the dangling Lock files? I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise Servers. Thanks Pawan Kharbanda -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/ba0e9261/attachment-0007.html From tjarvi at qbang.org Thu May 4 14:10:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:10:30 -0600 (MDT) Subject: [Rxtx] Dangling Lock Files In-Reply-To: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> References: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Message-ID: On Thu, 4 May 2006, Kharbanda, Pawan wrote: > Hi, > I have been using RXTX API's for the Serial Communication for quite > some time now and for some of the devices we are opening and closing the > connection every 2 minutes. This works great for few days and then > suddenly I start seeing some "Port in Use Exception" and I see that the > Lock files are still in the /var/lock folder after manually removing the > lock files it works good for few hours and I see the same problem again. > Can somebody explain me the scenarios why I am seeing the dangling Lock > files? > > I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise > Servers. Hi Pawan The next time it happens, look in the lockfile. There will be a pid. ps aux |grep 'pid' I think you will see that the application is still running for some reason. RXTX does a kill -0 on the pid to see if its alive. If not, it will remove the lockfile. So I suspect the previous program did not exit as you expected. -- Trent Jarvi tjarvi at qbang.org From Scott.Hughes at dalsemi.com Thu May 4 14:23:11 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 4 May 2006 15:23:11 -0500 Subject: [Rxtx] Wiki instructions... Message-ID: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire demo apps, when I stumbled across this tip on the wiki to add yourself to the uucp group: It may be simpler to just run usermod -G uucp jarvi Taken from: http://rxtx.qbang.org/wiki/index.php/Installation This does not work as advertised. I should have read the man page for usermod before I tried that out. If there are any groups which are not listed after the -G switch, the user is removed from those groups. On Ubuntu, this is bad... I removed myself from the Admin group, which removed my sudo priviledges. Ubuntu has no root account, so I've disabled the only account which could fix it. Anyone know of a good workaround? Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor From tjarvi at qbang.org Thu May 4 14:32:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:32:09 -0600 (MDT) Subject: [Rxtx] Wiki instructions... In-Reply-To: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> Message-ID: On Thu, 4 May 2006, Scott Hughes wrote: > I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire > demo apps, when I stumbled across this tip on the wiki to add yourself to > the uucp group: > > It may be simpler to just run > > usermod -G uucp jarvi > > Taken from: > http://rxtx.qbang.org/wiki/index.php/Installation > > This does not work as advertised. I should have read the man page for > usermod before I tried that out. If there are any groups which are not > listed after the -G switch, the user is removed from those groups. On > Ubuntu, this is bad... I removed myself from the Admin group, which removed > my sudo priviledges. Ubuntu has no root account, so I've disabled the only > account which could fix it. > > Anyone know of a good workaround? > Yikes This will get your permissions back: in grub/lilo/.. pass the following option to the kernel init=/bin/sh You are now root. when it boots, mount -o remount,rw / add yourself to the groups, reboot to get normal init going. Thats about all I can think of without sudo/root. -- Trent Jarvi tjarvi at qbang.org From Gettings at earth.utah.edu Thu May 4 14:41:22 2006 From: Gettings at earth.utah.edu (Paul Gettings) Date: Thu, 4 May 2006 14:41:22 -0600 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <20060504204122.GA6534@earth.utah.edu> When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get messages on stdout from the JVM: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 As the only change was the version of RXTX (from 2.1.6), I am unsure why the messages suddenly appeared. Anyone know how to get rid of them? Thanks. -- 101 USES FOR A DEAD MICROPROCESSOR (23) Dead cat brush From mmester at sps.edu Mon May 1 21:22:28 2006 From: mmester at sps.edu (Michael Mester) Date: Mon, 1 May 2006 23:22:28 -0400 Subject: [Rxtx] Windows PortInUseException Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> I'm trying to get simple serial communication going with RxTx under Windows XP. I can enumerate the ports fine, but I always run into problems when I try to open one. I get a PortInUseException, but the owner application is "Unknown" and the port is never open. I've tried this on several different systems and all of them give the same behavior. The only thing I can thiunk of that might be causing the problem is that fact that I had to put the serial .dll file in system32 instead of the reccommended folder, because it didn't work in the folder the documentation gives. The library loads fine, though, so I'm not sure whether that makes sense, and I don't know how to fix it anyway. Any help is greatly appreciated. Below is the output of the program, right up to the PortInUseException and the NullPointerException it causes (because the serial port object is not instantiated). C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI Starting GPSTalkerGUI... Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 gnu.io.PortInUseException: Unknown Application Exception in thread "main" java.lang.NullPointerException at GPSTalkerGUI.(GPSTalkerGUI.java:102) at GPSTalkerGUI.main(GPSTalkerGUI.java:161) Again, thank you very much for any help you can give. From lshellman at qwest.net Wed May 3 01:38:34 2006 From: lshellman at qwest.net (Lucious Shellman) Date: Wed, 03 May 2006 01:38:34 -0600 Subject: [Rxtx] Help needed: Project using parallel port Message-ID: <1146641914.8337.14.camel@localhost.localdomain> I was looking for a way to access the parallel port on a PC using Java. Searching the Internet, I came across this site (rxtx.org). What I am trying to do is detect logic levels from a TTL logic IC on the parallel port. I am not trying to do classic parallel port communication. I just want to detect whether a line(s) is (are) high or low. I am using Windows 98. Can rxtx be used to do this? If yes, is there a tutorial for using rxtx posted on the Internet that someone can direct me to. If you need more information, feel free to e-mail me. Unfortunately for me, I need the information ASAP. Thanks. lshellman at qwest.net From webmaster at egyhelp.com Wed May 3 18:43:39 2006 From: webmaster at egyhelp.com (Mohamed Samy) Date: Thu, 4 May 2006 02:43:39 +0200 Subject: [Rxtx] RE: Concering ircomm and RXTX In-Reply-To: Message-ID: <20060503184362.SM01044@Geek> Hey, I issue the command "modprobe ircomm-tty" yet no ttyircomm appears, while the ircomm appear by "modprobe ircomm" so forgive me but I am bit lost. Even searching google for the keyword "ttyircomm" only returns 3 matches. So any way I can start the ttyircomm???? Thanks a lot. -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Wednesday, May 03, 2006 3:31 PM To: Mohamed Samy; rxtx at qbang.org Cc: taj at www.linux.org.uk Subject: Re: Concering ircomm and RXTX On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 4 15:49:49 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 15:49:49 -0600 (MDT) Subject: [Rxtx] Windows PortInUseException In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> Message-ID: On Mon, 1 May 2006, Michael Mester wrote: > > I'm trying to get simple serial communication going with RxTx under > Windows XP. I can enumerate the ports fine, but I always run into > problems when I try to open one. I get a PortInUseException, but the > owner application is "Unknown" and the port is never open. I've tried > this on several different systems and all of them give the same > behavior. The only thing I can thiunk of that might be causing the > problem is that fact that I had to put the serial .dll file in system32 > instead of the reccommended folder, because it didn't work in the folder > the documentation gives. The library loads fine, though, so I'm not sure > whether that makes sense, and I don't know how to fix it anyway. Any > help is greatly appreciated. Below is the output of the program, right > up to the PortInUseException and the NullPointerException it causes > (because the serial port object is not instantiated). > > C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI > Starting GPSTalkerGUI... > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > gnu.io.PortInUseException: Unknown Application > Exception in thread "main" java.lang.NullPointerException > at GPSTalkerGUI.(GPSTalkerGUI.java:102) > at GPSTalkerGUI.main(GPSTalkerGUI.java:161) > Perhaps you are trying to open the port twice in your code? rxtx does open the ports, do a timed out read and then close the ports during enumeration. I think the port is being opened fine. The Unknown Application is always reported. On linux, there is some code that finds the actual application but on windows, its always unknown. If the port enumeration is returning the ports you expect, rxtx has opened the port and closed it with success. The port should open. There is also example code in the contrib directory that comes with rxtx source that has examples you can modify to work. -- Trent Jarvi tjarvi at qbang.org From Christian.Klemke at t-online.de Thu May 4 23:37:23 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Fri, 5 May 2006 07:37:23 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu> Message-ID: <004f01c67005$fc72fee0$016a10ac@NB600> Hi Paul, I was wondering about the same question some days ago and took a look at the source files. Unfortunately, I found that you can only get rid of that messages by altering and recompiling the Java code. There is a final static boolean variable called "devel" in the file "RXTXCommDriver.java" which is set to "true". This constellation causes the output after the native libraries have been loaded. No mechanism exists to suppress them otherwise :-(. Trent, does that mean that 2.1.7 is still officially a "development" version ? When will this value be changed to "false" by default ? With 2.1.8 ? It would be nice to provide a means to suppress such messages besides that static flag (maybe by setting a property called "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The output can indeed by annoying, especially when used with console applications, where the message potentially appears "in the middle" of your own output. Another possibility would be not to use System.out directly, but instead some PrintStream field which is initially set to System.out but can programatically be changed. That would allow for any kind of redirection or suppression by implementing appropriate user-defined PrintStream subclasses and making RXTX use that stream. What do you think ? Best regards, Christian ----- Original Message ----- From: "Paul Gettings" To: Sent: Thursday, May 04, 2006 10:41 PM Subject: [Rxtx] RXTX causing stdout messages > When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get > messages on stdout from the JVM: > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > As the only change was the version of RXTX (from 2.1.6), I am unsure > why the messages suddenly appeared. Anyone know how to get rid of > them? > > Thanks. > > -- > 101 USES FOR A DEAD MICROPROCESSOR > (23) Dead cat brush > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri May 5 06:09:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 06:09:46 -0600 (MDT) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <004f01c67005$fc72fee0$016a10ac@NB600> References: <20060504204122.GA6534@earth.utah.edu> <004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: On Fri, 5 May 2006, Christian Klemke wrote: > Hi Paul, > > I was wondering about the same question some days ago and took a look at the > source files. Unfortunately, I found that you can only get rid of that > messages by altering and recompiling the Java code. There is a final static > boolean variable called "devel" in the file "RXTXCommDriver.java" which is > set to "true". This constellation causes the output after the native > libraries have been loaded. No mechanism exists to suppress them otherwise > :-(. > > Trent, does that mean that 2.1.7 is still officially a "development" version > ? When will this value be changed to "false" by default ? With 2.1.8 ? It > would be nice to provide a means to suppress such messages besides that > static flag (maybe by setting a property called > "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The > output can indeed by annoying, especially when used with console > applications, where the message potentially appears "in the middle" of your > own output. Another possibility would be not to use System.out directly, but > instead some PrintStream field which is initially set to System.out but can > programatically be changed. That would allow for any kind of redirection or > suppression by implementing appropriate user-defined PrintStream subclasses > and making RXTX use that stream. What do you think ? > A patch for using properties would be accepted I'm sure. The reason the default is to display the message is not related to the development state of rxtx anymore. The problem is that people first using rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. The message prevents a great deal of email thats easily explained by the message. I question if we should support rxtx 2.0 at all anymore. If you post a patch in bugzilla, we'll put it into CVS this weekend. we'll be going through and doing such things anyhow. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri May 5 13:23:56 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 13:23:56 -0600 (MDT) Subject: [Rxtx] How to read from RxTx parallel port in Win XP In-Reply-To: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> References: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> Message-ID: On Thu, 27 Apr 2006, Worsley, Bob (Development Engineer) wrote: > I'm sorry if this is a dumb question, but I didn't find the answer in > the archives. > > I'm using the RxTx binaries for Windows on a reasonably current notebook > PC running Windows XP. I can send stuff to a printer on the parallel > port (LPT1), but I can't get anything back. > > I wrote a class that has the methods listed below. I write some data to > the printer with the "write" method and then try to read a response > using the "read" method, but I never get any data. I'd greatly > appreciate any help you can give! > > Bob Worsley > bobwoyid2 at yahoo.com > > > > > private ParallelPort parallelPort = null; > private RXTXCommDriver parallelPortDriver = null; > > > public boolean initialize() throws IOException { > if (parallelPort != null) { > return false; // Already initialized > } > > // Create the parallel port; > parallelPortDriver = new RXTXCommDriver(); > parallelPort = > (ParallelPort)parallelPortDriver.getCommPort(address, > CommPortIdentifier.PORT_PARALLEL); > > // Set the parallel port parameters. > try { > parallelPort.enableReceiveTimeout(READ_TIMEOUT); > parallelPort.disableReceiveFraming(); > parallelPort.disableReceiveThreshold(); > //parallelPort.setMode(mode); !!!!errors > } catch (UnsupportedCommOperationException e) { > throw (new IOException("Parallel port with address '" + > address > + "' cannot be configured as specified")); > } > > return true; > } > > > > public void write(final byte[] bytes) throws IOException { > initialize(); > while (busyReading) { > Thread.yield(); > } > busyWriting = true; > if (bytes.length < 1) { > return; > } > OutputStream outputStream = parallelPort.getOutputStream(); > outputStream.write(bytes); > outputStream.flush(); > outputStream.close(); > Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); > busyWriting = false; > } > > > public byte[] read() throws IOException { > > // Read up to MAX_BYTES bytes. > initialize(); > while (busyWriting) { > Thread.yield(); > } > busyReading = true; > byte[] buff = new byte[MAX_BYTES_READ]; > InputStream inputStream = parallelPort.getInputStream(); > // This read blocks until input data is available > int bytesRead = inputStream.read(buff); > inputStream.close(); > // If no data read, create empty array > if (bytesRead == -1) { > bytesRead = 0; > } > byte[] deviceBytes = new byte[bytesRead]; > System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); > if (bytesRead > 0) { > Debug.p("PPIOP.read - got data: '" + new > String(deviceBytes) + "'"); > } > busyReading = false; > return deviceBytes; > } > Hi Bob I've only used rxtx to test a hello world page printing but there are others that have used it. PPIOP? hmm what is this? :) The rxtx parallel support is behind the serial support but should be OK. As you note, the setting of modes is not supported. rxtx uses what is provided when the port is open. Are your asserting the pin for the printer being online? I suspect what often happens is people try to just use the data pins but the C API rxtx uses wants the printer to be online. There should be some posts relating to this in the rxtx mail-list archive. Some APIs are probably reading and writing from the port address (also suggested in your code as something you are looking at). RXTX currently uses a higher level C/C++ API for port access. This can still work if the API thinks the 'printer' is there. -- Trent Jarvi tjarvi at qbang.org From agrodellic at gmail.com Sat May 6 08:39:40 2006 From: agrodellic at gmail.com (Leigh Stewart) Date: Sat, 6 May 2006 10:39:40 -0400 Subject: [Rxtx] sun commapi 3 Message-ID: I think I read here: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html that rxtx-2.0 is basically fracked for now? Does anyone know of a workaround? ie can i somehow get an older version of sun's comm api and use that (not easy to find)? i mean 2.0 must be working for someone...how is it being tested. 2.1 isnt working for me....im getting nasty native exceptions etc, which is why im so set on 2.0... any ideas? From tjarvi at qbang.org Sun May 7 15:40:27 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 7 May 2006 15:40:27 -0600 (MDT) Subject: [Rxtx] sun commapi 3 In-Reply-To: References: Message-ID: On Sat, 6 May 2006, Leigh Stewart wrote: > > 2.1 isnt working for me....im getting nasty native exceptions etc, > which is why im so set on 2.0... any ideas? > Hi Leigh What native exceptions are you seeing? Which OS? The native code is almost identical between rxtx 2.0 and 2.1. Only the names have been changed to protect the inocent. :) ie: javax_comm_... vs gnu_io_... So the odds are very likely that even if you do find commapi 2.0 and get it installed, you will run into the same error. It would be better to just find and fix the problem. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Mon May 8 10:47:20 2006 From: mail at willicon.de (WILLICon) Date: Mon, 08 May 2006 18:47:20 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 Message-ID: <445F7618.3070303@willicon.de> Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/ef37e8ec/attachment-0007.html From tjarvi at qbang.org Mon May 8 16:14:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 May 2006 16:14:51 -0600 (MDT) Subject: [Rxtx] Screenshot of Application using RXTX (fwd) Message-ID: Just though someone may end up searching for 0x0D and 0x0A. Here are the details from his system. SuSE Linux 10.0 (x86_64) Kernel 2.6.13-15.8 j2se 1.4.2_11 (i586) Sun: comm3.0_u1 rxtx: rxtx-2.1-7 ---------- Forwarded message ---------- Date: Sat, 6 May 2006 20:01:46 +0200 From: Michael Poppitz To: taj at www.linux.org.uk Subject: Screenshot of Application using RXTX Hi Trent, the rxtx package works like a charm. Sun's package seemed to replace all 0x0D with 0x0A in received data on my Linux box, which is really annoying when transfering binary data. But rxtx came and saved the day - and turned out to be a lot more convenient as it does not require a configuration file. I use it for connecting to a home made logic analyzer. (http://www.sump.org/projects/analyzer/) Thanks for your great job, Michael -------------- next part -------------- A non-text attachment was scrubbed... Name: la_client.png Type: image/png Size: 16592 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/45494fbb/la_client-0007.png From tjarvi at qbang.org Tue May 9 14:56:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 May 2006 14:56:05 -0600 (MDT) Subject: [Rxtx] RXTX javax.comm: which one to install? In-Reply-To: <20060509161742.43547.qmail@web53814.mail.yahoo.com> References: <20060509161742.43547.qmail@web53814.mail.yahoo.com> Message-ID: On Tue, 9 May 2006, Adenilson Cavalcanti wrote: > Dear Trent Jarvi > > I'm trying to write a small Java app running in linux that interfaces with a device connected to serial port. > > I do have some questions about RXTX and javax.comm state of affairs, since I'm new to Java programming (used to program in plain old C writting to devices using termios and open/write/read syscalls, but this is another story). > > I ask you the favor to clarify this issues (if possible...): > > a) Sun offers to download a file (comm3.0_u1_PUTAUNIXVERSION.zip) which does contain .so files. Does it work out of box? > > b) Case negative, its there that we should use 'librxtx*.so' provided by your site? > > c) Sun's comm3 API version does work with which version of rxtx? > > I already searched google and read documentation available in rxtx site ("Java Comm Serial API How-to") but still have this issues unsolved. Any help will be appreciated. > > Best regards > > Adenilson Hi Adenilson, RXTX does not currently support javax.comm in Sun's CommAPI 3.0. I would recommend using package gnu.io provided by rxtx 2.1. -- Trent Jarvi tjarvi at qbang.org From chris.develder at intec.ugent.be Wed May 10 08:45:40 2006 From: chris.develder at intec.ugent.be (Chris Develder) Date: Wed, 10 May 2006 16:45:40 +0200 Subject: [Rxtx] rxtx troubles on ARM Message-ID: <4461FC94.6040909@intec.ugent.be> Hi all, Sorry to bother you, but I don't seem to get RXTX working on an ARM processor (xscale ixp 425, big endian). I managed to crosscompile the rxtx libs and moved it over to the ARM. Using jamvm (which is the only open source java VM we got working on the ARM), I get the following error result when running SimpleRead from Sun's javax.comm examples (commapi\examples\Simple\SimpleRead) -- see bottom of mail for complete output: "java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver" However, output shows that the RXTXCommDriver code is accessible (cf. debug and devel output of lib versions). So it doesn't seem to be a missing lib/jar issue. The error happens before RXTXCommDriver.initialize() is called, since the first line there is System.out.println("RXTXCommDriver:initialize()"); Any ideas? Cheers, Chris ---------------------------- [root at xxx(ttyp1) /work/cdvelder/xscale/test]# jamvm -Djava.library.path=/work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/jre/lib/arm -classpath /work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/lib/ext/RXTXcomm.jar:./comm.jar:. SimpleRead RXTXCommDriver {} Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTXCommDriver: Jar version = RXTX-2.1-7 native lib Version = RXTX-2.1-7 java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver gnu/io/RXTXCommDriver at javax.comm.CommPortIdentifier.loadDriver (CommPortIdentifier.java:239) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:109) at SimpleRead.main (Unknown Source) java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive (Native Method) at com.sun.comm.Portmapping.registerCommPorts (Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase (Portmapping.java:100) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:138) at SimpleRead.main (Unknown Source) From joachim at buechse.de Fri May 12 00:44:48 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 08:44:48 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) Message-ID: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Good day, I guess that only a selected few (hi Trent) will be able to answer this question, but the answer might be interesting for anyone trying to debug or understand the code. Apparently the MonitorThread is started and stopped in RXTXPort.addEventListener and RXTXPort.removeEventListener. This would indicate that (originally?) the MonitorThread is only required when there is an EventListener. However the MonitorThread is also started in the RXTXPort constructor, which could mean that RXTX won't work at all if it isn't there. It seems to me, that if anyone would add an event listener and later on remove it, he could potentially wreak the port. Because the second action would kill the MonitorThread. For the moment I am only trying to understand the role of and idea behind the MonitorThread. But of course there is a deeper reason thor my question: If the MonitorThread needs to exist anyway, it could be the thread that cleans up the port (ie calls nativeClose) - this would eliminate (a further) problem I am seeing with some USB drivers on Mac OSX. (Close blocks (after releasing the tty, but still) in the USB driver if the device is "not responding"). Greetings, Joachim From tjarvi at qbang.org Fri May 12 07:10:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 12 May 2006 07:10:59 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Fri, 12 May 2006, Joachim Buechse wrote: > Good day, > > I guess that only a selected few (hi Trent) will be able to answer > this question, but the answer might be interesting for anyone trying > to debug or understand the code. > > Apparently the MonitorThread is started and stopped in > RXTXPort.addEventListener and RXTXPort.removeEventListener. This > would indicate that (originally?) the MonitorThread is only required > when there is an EventListener. However the MonitorThread is also > started in the RXTXPort constructor, which could mean that RXTX won't > work at all if it isn't there. > > It seems to me, that if anyone would add an event listener and later > on remove it, he could potentially wreak the port. Because the second > action would kill the MonitorThread. > > > For the moment I am only trying to understand the role of and idea > behind the MonitorThread. But of course there is a deeper reason thor > my question: > > If the MonitorThread needs to exist anyway, it could be the thread > that cleans up the port (ie calls nativeClose) - this would eliminate > (a further) problem I am seeing with some USB drivers on Mac OSX. > (Close blocks (after releasing the tty, but still) in the USB driver > if the device is "not responding"). > Hi Jaochim Before commapi, rxtx did not support events. You could read, write and change port settings. The MonitorThread was added as an afterthought to support commapi events. So the way things are now his historical spaghetti not a well devised plan. It is my opinion that the MonitorThread should exist as long as the port is open. The odd starting of the thread in the constructor and addEventListener was just to get past the obvious problem of people using the port without adding listeners. -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Fri May 12 07:59:50 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 15:59:50 +0200 Subject: [Rxtx] MonitorThread -> ChangeRequest In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: <2B1E508C-8CEE-4AB7-914D-E7BA25C871A2@buechse.de> In this case I suggest removing the starting/stopping of MonitorThread in addEventListener / removeEventListener. This should not affect existing projects. On 12.05.2006, at 15:10, Trent Jarvi wrote: > It is my opinion that the MonitorThread should exist as long as the > port > is open. The odd starting of the thread in the constructor and > addEventListener was just to get past the obvious problem of people > using > the port without adding listeners. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Fri May 12 11:43:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 19:43:21 +0200 Subject: [Rxtx] Spring Cleaning - some suggestions Message-ID: The current implementation of RXTX contains quite a lot of code that will break if it is used from several threads (especially on a multi processor machine). I think it would be nice to clean this up. I suggest the following changes (which keep the current semantics and should not influence existing projects in a negative way): - InterruptedException will never be ignored or reset - read methods will be protected with a Monitor - write methods will be protected with a (separate) Monitor - close() sets the read and write monitors into a "closed" state which will lead to IOExceptions for any following call to RXTXPort.read/write. - close() will wait a finite amount of time (maybe 500ms) for the release of the read and write monitors after that, it will trigger the closing of the file descriptor to abort any pending read or write. - close() will not call close(file_desc). Instead it will "interrupt" (ie set a flag and then, pthread_kill(ABRT)) the MonitorThread, the MonitorThread will call close(file_desc). - the monitors are properly released in a finally block the try of which starts directly after obtaining the monitor. - finally will not call close(file_desc) it will only "interrupt" the MonitorThread (see above) - the native-code (esp read) does not use SA_RESTART but checks Thread.interrupted() when it receives a SIGNAL (ie system call returns with EINTR or other signalling method). The read/write monitors will be allocated from a factory whose mode can be set to fast/normal/advanced. In fast-mode it will create "non thread safe, non synchronized" pseudo-monitors. In default mode, the monitors will store the owning thread. In "advanced" mode setting the monitors into closed state will "interrupt()" threads which are blocked in a native read/write. {Reasoning close behaviour: Calling close on a file descriptor in Windows unblocks any read() or write() on the same file descriptor with an error. On Solaris < 2.7 and MacOS X however the close() will/ can block - until the read or write have finished:-(( Even the JDK people have trouble with this. I dont know how Linux reacts in this case. The best practice for BSD/Solaris is to send a signal to the thread which will usually unblock the read/write with an EINTR - this however is not guarenteed as it also depends on the device driver. So the only resolution that will certainly not block the thread calling RXTXPort.close() (which will often enough be the AWT event dispatcher or the VM finalizer thread) is to call close(fd) from another thread.} {Reasoning read behaviour: It is rather uncommon to receive a signal while reading or writing - it will happen, but checking Thread.interrupted() when it happens will not degrade performance. The checking of Thread.interrupted() can be handled by returning to Java and potententially reentering into the native code if the thread was not interrupted or by calling back into the VM from the native code. On top of this, many functions like read(byte[]) or read(byte [], int, int) are allowed to return less than the requested amount of data. Only int read() is a bit more tricky. } [Trent: From the code I can tell, that you experimented quite a bit with signals. Do you know if the Java Thread.interrupt() triggers a unix signal on Linux/Solaris? If so, which one?? References: - http://java.sun.com/docs/hotspot/VMOptions.html - http://www.hp.com/products1/unix/java/infolibrary/prog_guide/ signals.html ] On OS X (hotspot client jdk-1.4.2) I did not see any signal propagated to the SELECT of the event_loop/MonitorThread (ie no EINTR) when I call monThread.interrupt(). This is a pitty, but thats the way it is. I simply assume this is true for most system calls. How to handle this? Of course it would be possible to install/ deinstall a specific signal handler before/after every native read and to natively send an ABRT signal if RXTXPort.close is called. A more elegant solution might be to have an additional "signaling" socket which is always included in the SELECT. Or the simplest solution: cap the timeout of the select to 500 ms (the loop around it exists already) after every timeout check the Thread.interrupted() flag. From a performance perspective this should be completely invisible... On the other hand, all write() calls need to be preceeded by a SELECT as well, to avoid running into a blocking write. Best regards, Joachim From lyon at docjava.com Sat May 13 05:54:52 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 13 May 2006 07:54:52 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Dmitry suggests that we acquire an implementation of a serial port reference, use it, then release it (i.e., check it back in). Joachim says that making serial ports thread friendly might be a good idea. This is a good idea. The design pattern that is close to this idea is the "Object Pool Design Pattern". # Object Pool Manage the reuse of objects for a type of object that is expensive to create or only a limited number of a kind of object can be created. It has been described at: http://www.developer.com/java/ent/article.php/626171 and in Marks' book, Patterns in Java, Volume 1. However, the Object Pool is intended to pool objects so that each object is just like every other object. The intent of the Parametric Singleton is to enable others to access the same resource at the same time (as long as the same parameters were used in construction). It sounds like we need a NEW Design Pattern (Oh no, Doug is doing it again!). Yes friends, you got me on a role (roll) :) If you like design patterns, you can thank me later. If you don't like design patterns, blame Dmitry, it was his idea ;) And Dave, thanks for the feedback on Singleton abuse. It has led me to change the way I think about application contexts, which we will see, below. We need (drum roll please): The Parametric Object Pool Design Pattern (POP) By Douglas A. Lyon ABSTRACT The goal of the Parametric Singleton design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values, in a given context. In comparison, the goal of the POP design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values and that only one reference to the class is checked out at a time, in a given context. A context is a namespace for holding identifiers during execution. In Java, A context can be changed in any of several ways. For example, creation of a new class loader, the deserialization of an old POP or the creation of a new process all create a new namespace. The POP Design Pattern combines the Parametric Singleton Design Pattern with the check out mechanism of the Object Pool Design Pattern. This enables unique creation of instances of a class. These instances are cached in a table. When a clients asks for an instance with these parameters, the cache is checked. If the instance is not in the cache it is created. If the instance is available, the clients checks out the instance. A reference is left to the clients that checked out the instance. The POP has the role of creating objects uniquely, from parameters. It also has the role of keeping track of which clients has checked out a given object. This is just like a library keeping track of who borrowed a book. If a resource is left unavailable in a system, a deadlock can occur. Deadlock debugging is facilitated by mapping a resource to the clients that have checked it out. We apply our POP Design Pattern to the retrieval of serial ports. The goal of our system is to make sure that serial ports are checked out to only one client at a time, and that they be checked back in when the client is done. The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. Users are discouraged from calling this the Parametric Object Oriented Pool (POOP). Introduction The intent of the POP Design Pattern is to ensure that a class has only one instance for a given set of parameter values. It also provides a point of access that is global to a given context. The POP uses the Singleton Design Pattern to ensure that there is only one POP, in the given context. The POP DP is responsible for checking out a reference to a given instance, and keeping track of that instance. The instance is responsible for sharing that instance. POP requires that users of the DP implement an interface that enables a recall facility. Thus, if there is a contention for a consumed resource, the deadlock can be resolved in an orderly fashion. Motivation A system cannot tolerate multiple instances of some classes with identical parameters used by different instances at the same time. For example, you cannot have two instances use the same serial port, at the same time. You cannot have two instances that are trying to listen to the same socket connection. You cannot have two instances writing to the same file structure at the same time. Further, once a serial port is checked out by a client, it is assigned to the client. This is like the spin-lock service provided by the operating system, only in the application layer. Naturally, deadlock will occur if a resource is not released, therefore the client of the resource is tracked. Recalling a resource is required for the POP DP by virtue of the implementation of an interface. The policy on how to break a deadlock (by honoring the recall) is application specific. As the operating system is often thought of as the arbiter of consumed resources (i.e., tape drives, serial ports, etc.) we frequently leave it to an operating system implementation to resolve these contention issues. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on naming conventions (which are not well standardized). The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. The POP Design Pattern can take on the role of the peer method mapper that homogenizes the API for different operating environments. That is, it can wrapper the different locking mechanisms used in different operating systems. POP that is responsible for keeping track of the instances created and the client that has checked them out. The POP Design Pattern is implemented using the Singleton Design Pattern. In Java, the POP implementation is declared final, so that it cannot be subclassed. The class also has a private constructor, so that other classes cannot instance it. The new design pattern is called the POP design pattern and it provides a way to check out and create instances with given parameters. Applicability Use the POP Design Pattern when: 1. There must be exactly one instance of a class with the given parameters in a given context. 2. The instances must be accessible to clients from a well-known access point. 3. The instances are reusable. 4. Only one client can check out an instance at a time. Structure Insert UML diagram here. Participants The POP Clients that need instances 1. The POP defines an instance upon request from a client, if, and only if, the instance does not already exist. 2. The POP returns the instance to the client. 3. The POP is responsible for creating unique instances from given parameters. 4. The POP is responsible to recalling instances from clients. Collaborations Clients obtain a reference to a POP instance only through the singleton design pattern. If the POP instance is left in an improper state (e.g., the serial port was left open) it is NOT the role of the POP to close the IO port. However, the POP can be requested to get the instance released. Nor is it the role of the POP Design Pattern to open the port. That role is delegate to some other part of the system. Further, it is the role of the POP Design Pattern to check out resources. However, it is still possible to have, multiple threads that have multiple references to the same resource at the same time. Checkout and resource requests are MUTEX locked (i.e., synchronized). Consequences The POP Design Pattern has several benefits: 1. Controlled access to parametrically defined instances. Since the POP encapsulates its instances, there is some limited control over how and when clients access it. 2. Reduced name space. The POP pattern avoids global variables that store instances created from the same parameter. Implementation Here are implementation issues to consider when using the POP pattern: 1. Unique mapping of parameters. The POP pattern requires that there be a mean to isomorphically map the parameter space into the instance space and back again. 2. Ensure unique instances. The POP pattern makes unique instances from parameters, and it does so only once. 3. Cache instances for fast retrieval. The POP must be able to look up instances, given some set of parameters, and do so from some data structure. That is, there must be enough space to hold references to all the instances the program will need. Also, a mechanism is needed to look up and retrieve the instances quickly enough to satisfy the clients. Sample Code To be written....any volunteers? Thanks! - Doug >I don't think I get it > >On Mar 22, 2006, at 9:36 AM, David Garnier wrote: >>Using the singleton pattern in this case is >>just convenient for the programmer. Problems >>arises >>pretty quickly, especially if you attempt to unit-test your classes. > > >so you're saying that something isn't so good >because you can not test it in the convenient >way? >if that's true, I'm totally disagree >change your test, debug whatever, but if >software is efficient at runtime, works fine and >only problem is some unit test >(which is some kind of framework for testing) >then dump that unit test , dump that unit >framework and make something appropriate to the >software >you're testing > >so if Douglas want to use singletons, what's the problem? >and what do you mean by abusing of singleton usage? > >of course singleton doesn't prevent concurrent >access to the resource across the processes >unless >you're using some OS facility to prevent it, besides >singleton as it was introduced is relevant only >and only inside of the same process >otherwise it's not singleton it's something else >(let's say network singleton: so you have remote >invocation facility >and some factory method that return object created by that facility) > >I don't have any problem with using any kind of singletons. > Parametric Singleton idea (if I understand it >right) could be easily implemented in the >following way: >use a map >populate map with instances of some class and key is your parameter >(you can use lazy population too) > >if somebody ask the key check the value if it's null so resource is taken >if somebody returns the resource put it back to the map > >public synchronized static Object getSomeResource(Object parameter); >public synchronized static void returnResource(Object parameter); > >getSomeResource (inside of the same process) could return null in 2 cases >1. if somebody (from other thread for example) already took that resource >2. if OS API said that resource corresponded to >that parameter (serial port with parameter = 1 >(port #)) >is locked and unavailable; >I'm not sure that in case of serial ports we >even need those Parametric Singletons >(unless lock checking is a very expensive operation) >just ask the OS about availability of that >resource and if it's available give it away >and then OS will lock it and therefore in next >time somebody ask it just answer that resource >is locked >and return null > >for example system has 2 serial ports available >so I ask getResource("tty"); >or I ask getResource("Bluetooth-Modem"); > >and if OS is ok you can give tty or Bluetooth-Modem or both > >no need for any additional pattern I think > >back to the problem >mac os x doesn't recognize locking via files, so >it handles locking via some API >an instance of the singleton in each process >should recognize that resource is locked >(by using that API) that's all >we don't have to make things more complicate >then they are just because there is some nice >design pattern or nice unit test framework or whatever >keep things simple, make them work fast, don't introduce middle layers >unless you have really good reason to do so > >of course I could be entirely wrong, so sorry about that in advance > >thanks > > >Dmitry Markman > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx >Good day, > >I guess that only a selected few (hi Trent) will be able to answer? >this question, but the answer might be interesting for anyone trying? >to debug or understand the code. > >Apparently the MonitorThread is started and stopped in? >RXTXPort.addEventListener and RXTXPort.removeEventListener. This? >would indicate that (originally?) the MonitorThread is only required? >when there is an EventListener. However the MonitorThread is also? >started in the RXTXPort constructor, which could mean that RXTX won't? >work at all if it isn't there. > >It seems to me, that if anyone would add an event listener and later? >on remove it, he could potentially wreak the port. Because the second? >action would kill the MonitorThread. > > >For the moment I am only trying to understand the role of and idea? >behind the MonitorThread. But of course there is a deeper reason thor? >my question: > >If the MonitorThread needs to exist anyway, it could be the thread? >that cleans up the port (ie calls nativeClose) - this would eliminate? >(a further) problem I am seeing with some USB drivers on Mac OSX.? >(Close blocks (after releasing the tty, but still) in the USB driver? >if the device is "not responding"). > >Greetings, >Joachim > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Sat May 13 10:07:37 2006 From: joachim at buechse.de (Joachim Buechse) Date: Sat, 13 May 2006 18:07:37 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Douglas, Looking at the current code, leaves me with the feeling, that there is a lot to do. Defining an API that wraps javax.comm to provide what you describe is certainly possible, but I wonder how much benefit it will actually provide. Personally I think the API defined by javax.comm "request/lock" a port with: cp= new CommunicationPort(identifier) "release" a port with: cp.close(); works quite nice for 99% of the applications. In my experience, the most efficient and elegant implementation is to wrap a port/socket/.. into a business object which declares the remote operations that are possible. Ie "uploadFile", "waitForPrompt", "getSerialNumber", "sendContact", "executeCommand", etc Those methods are then either synchronized or guarded by a monitor. I do not see how your design pattern applied to the port resource would help implementing this. [details start, skip if you agree to the above] When I talked about "thread-safe" I didn't mean several independent "sessions" accessing the port concurrently. I think this is a very rare usage. I believe the most common use case for serial ports today is the control of an external device from a PC running a GUI based application. To implement a clean Swing/AWT-GUI one needs to pass any action that can block to a "worker" thread (else the GUI blocks, the application appears dead). While it is possible to use own prespawned thread that will accept Runnables which operate on the port, this is not very elegant. It is more common to spawn a new thread for every action triggered by the user. Additionally the ABORT of a running operation is often implemented via a port.close() delegated to a different thread. - During the lifetime of a port, it will usually be accessed from several different threads. Instance variables need to be set/read in synchronized regions to guarantee a correct operation based on the Java memory model. - Synchronizing the access is usually handled on the application level (synchronizing the reads/writes is usually useless from the applications view because it is not a transaction mechanism). [details end] I am very open to learn about other scenarios where your proposed design pattern applied to the port resource is beneficial to the application implementor. Best regards, Joachim On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > Dmitry suggests that we acquire an implementation of > a serial port reference, use it, then release it (i.e., check it > back in). > > Joachim says that making serial ports thread friendly might be a > good idea. > > This is a good idea. The design pattern that is close to this idea > is the "Object Pool Design Pattern". > # Object Pool From jredman at ergotech.com Sun May 14 14:28:24 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 14:28:24 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers Message-ID: <446792E8.4000506@ergotech.com> Does anyone know of any work to make RXTX work with Ethernet (telent) Terminal Servers? If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? We've used RXTX with upwards of 100 virtual COM ports on Windows and it works well. Linux is more problematic. It would be good to have an OS independent solution to accesses remote Ethernet serial ports. Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From legolas.w at gmail.com Sun May 14 14:26:34 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:56:34 +0430 Subject: [Rxtx] does any one have a working sample of RXTX and LPT port Message-ID: <4467927A.4000008@gmail.com> Hi Thank you for reading my post does any one has a working sample for RXTX and LPT port ? Thanks From legolas.w at gmail.com Sun May 14 14:27:29 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:57:29 +0430 Subject: [Rxtx] does RXTX support Trigerr on parallel port? Message-ID: <446792B1.4040905@gmail.com> Hi does RXTX support trigger on LPT port ? if so , how i can use it ? Thanks From tjarvi at qbang.org Sun May 14 17:40:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 17:40:59 -0600 (MDT) Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: <446792E8.4000506@ergotech.com> References: <446792E8.4000506@ergotech.com> Message-ID: On Sun, 14 May 2006, Jim Redman wrote: > Does anyone know of any work to make RXTX work with Ethernet (telent) > Terminal Servers? > > If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 > Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? > Hi Jim It appears the author of NVTCom has decided to release the library into the public domain. Integration with rxtx is possible but it would be best to contact the author and find out what his intent is. I would suggest contacting the author with a proposal of what you would like to do and take it from there. We could 'take' public domain software but its better to show respect to the authors and respect their wishes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:10:23 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:10:23 -0600 (MDT) Subject: [Rxtx] does any one have a working sample of RXTX and LPT port In-Reply-To: <4467927A.4000008@gmail.com> References: <4467927A.4000008@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > Thank you for reading my post > does any one has a working sample for RXTX and LPT port ? > Thanks Hi Legolas LPT port support in rxtx is spotty. That means some people have sent in patches for what they do and it works well for them. The original code was not very good. It may have been 3 hours work :/ To get started, Sun has some demo programs with their commapi. With rxtx 2.1 you can change their code from using javax.com to gnu.io and it -should- work. But if it does not you can post here and on bugzilla. There has been more interest lately off the list and maybe there will be enough community resources to get what you need going. If you do get a sample program together, we would gladly put it in the contrib directory so the next person can get things going faster. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:12:12 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:12:12 -0600 (MDT) Subject: [Rxtx] does RXTX support Trigerr on parallel port? In-Reply-To: <446792B1.4040905@gmail.com> References: <446792B1.4040905@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > does RXTX support trigger on LPT port ? > if so , how i can use it ? > Hi Legolas As mentioned in the previous post, rxtx parallel support is not very mature. But if you can point to something that describes the trigger feature, we can probably make sure its there and give a quick code example. -- Trent Jarvi tjarvi at qbang.org From jredman at ergotech.com Sun May 14 22:22:48 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 22:22:48 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: References: <446792E8.4000506@ergotech.com> Message-ID: <44680218.4080008@ergotech.com> Trent, Trent Jarvi wrote: > On Sun, 14 May 2006, Jim Redman wrote: > >> Does anyone know of any work to make RXTX work with Ethernet (telent) >> Terminal Servers? >> >> If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 >> Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? >> > > Hi Jim > > It appears the author of NVTCom has decided to release the library into > the public domain. Integration with rxtx is possible but it would be best > to contact the author and find out what his intent is. > > I would suggest contacting the author with a proposal of what you would > like to do and take it from there. We could 'take' public domain software > but its better to show respect to the authors and respect their wishes. > I sent Marco(?), the author of the library, a note before asking the list - I'll let you know the response. If anyone is already working on it, or has an interest and more time and energy than me, I'd hate to duplicate the efforts. If no one is, and no one objects, maybe I'll see what I can do. Jim > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From Christian.Klemke at t-online.de Mon May 15 02:23:06 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Mon, 15 May 2006 10:23:06 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu><004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: <008a01c677f8$cae18590$02fea8c0@NB600> Hi Trent, Hi Paul, I finally found some time to create a simple patch to enable the optional suppression of version output to the console. It is based on a new system property called "gnu.io.rxtx.NoVersionOutput" which can by set to "true" if necessary. I had some problems accessing CVS, therefore I downloaded the rxtx-2.1-7r2 source archive from ftp.qbang.org (which is linked on the rxtx.org download page) and worked with that release. Please find my proposed patch in the attachment ! Regards, Christian ----- Original Message ----- From: "Trent Jarvi" To: "RXTX Developers and Users" Cc: ""Paul Gettings"" Sent: Friday, May 05, 2006 2:09 PM Subject: Re: [Rxtx] RXTX causing stdout messages > On Fri, 5 May 2006, Christian Klemke wrote: > >> Hi Paul, >> >> I was wondering about the same question some days ago and took a look at >> the >> source files. Unfortunately, I found that you can only get rid of that >> messages by altering and recompiling the Java code. There is a final >> static >> boolean variable called "devel" in the file "RXTXCommDriver.java" which >> is >> set to "true". This constellation causes the output after the native >> libraries have been loaded. No mechanism exists to suppress them >> otherwise >> :-(. >> >> Trent, does that mean that 2.1.7 is still officially a "development" >> version >> ? When will this value be changed to "false" by default ? With 2.1.8 ? It >> would be nice to provide a means to suppress such messages besides that >> static flag (maybe by setting a property called >> "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The >> output can indeed by annoying, especially when used with console >> applications, where the message potentially appears "in the middle" of >> your >> own output. Another possibility would be not to use System.out directly, >> but >> instead some PrintStream field which is initially set to System.out but >> can >> programatically be changed. That would allow for any kind of redirection >> or >> suppression by implementing appropriate user-defined PrintStream >> subclasses >> and making RXTX use that stream. What do you think ? >> > > A patch for using properties would be accepted I'm sure. > > The reason the default is to display the message is not related to the > development state of rxtx anymore. The problem is that people first using > rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. > The message prevents a great deal of email thats easily explained by the > message. > > I question if we should support rxtx 2.0 at all anymore. > > If you post a patch in bugzilla, we'll put it into CVS this weekend. > we'll be going through and doing such things anyhow. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_version_output_patch.diff Type: application/octet-stream Size: 991 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060515/3173c2b6/rxtx_version_output_patch-0007.obj From lyon at docjava.com Mon May 15 06:06:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 May 2006 08:06:21 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Joachim makes several good points. Let me see if I can address some of them below: >Hello Douglas, > >Looking at the current code, leaves me with the feeling, that there? >is a lot to do. Yes! >Defining an API that wraps javax.comm to provide what? >you describe is certainly possible, but I wonder how much benefit it? >will actually provide. > >Personally I think the API defined by javax.comm > >"request/lock" a port with: > cp= new CommunicationPort(identifier) >"release" a port with: > cp.close(); > >works quite nice for 99% of the applications. I don't know what percentage of applications turn off locking, the way that I do in my version of the RXTX lib. I do know that this is not safe practice. I also know that it was motivated by the multi-platform nature of my code and that this was the only way I could make things work, at the time. Java does not appear to have a cross-platform standard for locking resources on various platforms. Each OS appears to have its own standard. The question of who breaks deadlocks and how this is done remains open, as this is not an easy question to resolve. Let me continue, below: > >In my experience, the most efficient and elegant implementation is to? >wrap a port/socket/.. into a business object which declares the? >remote operations that are possible. Ie "uploadFile",? >"waitForPrompt", "getSerialNumber", "sendContact", "executeCommand",? >etc Those methods are then either synchronized or guarded by a? >monitor. I do not see how your design pattern applied to the port? >resource would help implementing this. I have no problem with high-level wrappers that are application specific. That is a very good idea, but orthogonal with respect to the issue of deadlocks. More below: > >[details start, skip if you agree to the above] >When I talked about "thread-safe" I didn't mean several independent? >"sessions" accessing the port concurrently. I think this is a very? >rare usage. That is probably why turning locking off works so well! On the other hand, it is not safe and I shouldn't do it. >I believe the most common use case for serial ports today? >is the control of an external device from a PC running a GUI based? >application. To implement a clean Swing/AWT-GUI one needs to pass any? >action that can block to a "worker" thread (else the GUI blocks, the? >application appears dead). While it is possible to use own prespawned? >thread that will accept Runnables which operate on the port, this is? >not very elegant. It is more common to spawn a new thread for every? >action triggered by the user. Additionally the ABORT of a running? >operation is often implemented via a port.close() delegated to a? >different thread. Here lies the heart of serial port concern. An application opens a serial port and then dies. The application is restarted and finds the port locked. How do we clear the lock? Must the application's user reside in the UUCP group? Must installers of the serial port add users to the UUCP group? Should locking be handled at a high-level of abstraction in an operating system independent way? Should the implementation of the locking mechanism be translated into an API that is dependent on the OS convention? Suppose that we restrict the discussion to serial ports. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on inconsistent naming conventions. Hence my feeling that we need to mirror what is done in other API's; we need a locking toolkit that references peer methods, IMHO. >From the Java programming point of view, the locking API is portable across different platforms, but has, as its implementation, a native peer method that uses the conventions of the underlying OS. This enables portable resource locking (in theory!). Consider, for example: org.apache.commons.transaction.locking with: Interface LockManager at: http://jakarta.apache.org/commons/transaction/apidocs/org/apache/commons/transaction/locking/LockManager.html Or, more recently: java.util.concurrent.locks Interface Lock based on Doug Lea's code: http://kickjava.com/src/EDU/oswego/cs/dl/util/concurrent/ReadWriteLock.java.htm Should we incorporate a clean, portable design into serial port use, one that is consistent with current locking APIs? Basically, a comm port is a resource and resources are typically controlled by managers. Thus, I suggest that we make use of a CommPortManager to help control and centralize serial port usage. The question of how this is done remains open, IMHO, but using core API's like: java.util.concurrent.locks might not be amiss. High-level methods (getAllPorts, getAllSerialPorts, getAllParallelPorts, etc...) might be welcome additions. Basic questions like, "what if a port is in use?" remain open, hence my proposal for the new design pattern. Isn't it the CommPortManager's role to break the deadlock? Cheers! - Doug > >- During the lifetime of a port, it will usually be accessed from? >several different threads. Instance variables need to be set/read in? >synchronized regions to guarantee a correct operation based on the? >Java memory model. >- Synchronizing the access is usually handled on the application? >level (synchronizing the reads/writes is usually useless from the? >applications view because it is not a transaction mechanism). >[details end] > >I am very open to learn about other scenarios where your proposed? >design pattern applied to the port resource is beneficial to the? >application implementor. > >Best regards, >Joachim > >On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > >> Dmitry suggests that we acquire an implementation of >> a serial port reference, use it, then release it (i.e., check it? >> back in). >> > > Joachim says that making serial ports thread friendly might be a? >> good idea. >> >> This is a good idea. The design pattern that is close to this idea >> is the "Object Pool Design Pattern". >> # Object Pool > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Mon May 15 06:58:19 2006 From: joachim at buechse.de (Joachim Buechse) Date: Mon, 15 May 2006 14:58:19 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Doug, I agree fully, that locking of the system resource should be abstracted from the user (programmer). Currently this is already the case, but I agree it might be nice to extract the code into a separate class, which uses platform dependent providers to do its job. What I described in my email was not targeted at allocating the system resource, but at handling an already allocated system resource inside the framework. I agree that it may be possible to combine the two - however, I would suggest to do this in phase2. I can contribute a work over of RXTXPort.java which implements clean internal locking and proper close behavior (which I would call phase 1). I could do this this week. However I strongly believe that there is little sense in trying to do this as a series of patches. It will be closer to a rewrite than to a patch. I have already provided a number of suggested patches via Bugzilla, but this is quite inconvenient (for me). My working copy diverges more and more from the master and hence it gets more and more annoying to provide self contained patches. Best regards, Joachim From tjarvi at qbang.org Mon May 15 08:27:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 May 2006 08:27:51 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Mon, 15 May 2006, Joachim Buechse wrote: > Hello Doug, > > I agree fully, that locking of the system resource should be > abstracted from the user (programmer). Currently this is already the > case, but I agree it might be nice to extract the code into a > separate class, which uses platform dependent providers to do its job. > > What I described in my email was not targeted at allocating the > system resource, but at handling an already allocated system resource > inside the framework. I agree that it may be possible to combine the > two - however, I would suggest to do this in phase2. > > I can contribute a work over of RXTXPort.java which implements clean > internal locking and proper close behavior (which I would call phase > 1). I could do this this week. > > However I strongly believe that there is little sense in trying to do > this as a series of patches. It will be closer to a rewrite than to a > patch. I have already provided a number of suggested patches via > Bugzilla, but this is quite inconvenient (for me). My working copy > diverges more and more from the master and hence it gets more and > more annoying to provide self contained patches. > For methodical testing purposes (which does go on) the incremental patches are better. I'm lagging behind in bugzilla but thats soon to change (this week). It has just been rather chaotic up until now. I moved, purchased a house, and jumped into the fire of a feature freeze timeframe at a new job. btw, we see the Solaris close issues on 2.8 also. 9 and 10 are fine. I'll work towards making those test results public and allow others to run new rxtx code through them. We had the OK at one point but setting up the environment is involved. It isn't just a collection of java classes. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Tue May 16 02:01:47 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:01:47 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] Message-ID: <446986EB.209@willicon.de> Hi, any ideas for my problem? Hans -------- Original-Nachricht -------- Betreff: [Rxtx] Problem under Mac OSX 10.3.9 Datum: Mon, 08 May 2006 18:47:20 +0200 Von: WILLICon Antwort an: RXTX Developers and Users An: RXTX Developers and Users Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/b0741c2b/attachment-0007.html From joachim at buechse.de Tue May 16 02:15:08 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 10:15:08 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: Hello Hans, I am using RXTX on OS X for my own project. I do not see the problem you describe. I had some troubles installing it because the current version uses lock files which is non-standard on OS X. I have created a patched version which I currently use. This version does not need to modify user groups and hence does not need an installer. I just pop it in the application directory. If you send me a link where I can download your OSX installer, I will have a quick look. Regards, Joachim On 16.05.2006, at 10:01, WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we > have some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + > spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + > spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always > the value "false". > I can only get the status, while I open the port and catch the > exception. > > Any ideas? > > Hans > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail at willicon.de Tue May 16 02:26:53 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:26:53 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: References: <446986EB.209@willicon.de> Message-ID: <44698CCD.7050709@willicon.de> Joachim, tanks for the answer. I'll send You a mail. Hans Joachim Buechse schrieb: > Hello Hans, > > I am using RXTX on OS X for my own project. I do not see the problem > you describe. > > I had some troubles installing it because the current version uses > lock files which is non-standard on OS X. I have created a patched > version which I currently use. This version does not need to modify > user groups and hence does not need an installer. I just pop it in > the application directory. If you send me a link where I can download > your OSX installer, I will have a quick look. > > Regards, > Joachim > > On 16.05.2006, at 10:01, WILLICon wrote: > > >> Hi, >> >> any ideas for my problem? >> >> Hans >> >> -------- Original-Nachricht -------- >> Betreff: [Rxtx] Problem under Mac OSX 10.3.9 >> Datum: Mon, 08 May 2006 18:47:20 +0200 >> Von: WILLICon >> Antwort an: RXTX Developers and Users >> An: RXTX Developers and Users >> >> >> Hi, >> >> I use for RXTX for communicate with CyclingComputers. >> >> It works good under Win32, Sloaris and Linux but with Mac OSX we >> have some problems. >> >> My users install the Mac OSX serial lib from the actual binary. >> >> After starting the program, they get this error message: >> >> java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while >> loading gnu.io.RXTXCommDriver >> >> Remember, this error comes only under Mac OSX. >> >> That is the code for the error: >> >> Enumeration portList = CommPortIdentifier.getPortIdentifiers(); >> spInUse = getBundleStr("serialPortInUse"); >> spFree = getBundleStr("serialPortFree"); >> while (portList.hasMoreElements()) { >> CommPortIdentifier portId = (CommPortIdentifier) >> portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (osName != null && osName.startsWith("mac")) { >> if (!portId.getName().startsWith("dev/cu.")) { >> continue; >> } >> } >> if (portId.isCurrentlyOwned()) { >> serialPortNames.add(portId.getName() + " - " + >> spInUse); >> } >> else { >> serialPortNames.add(portId.getName() + " - " + >> spFree); >> } >> } >> } >> if (serialPortNames.size() == 0) { >> serialPortNames.add(getBundleStr("serialPortNotFound")); >> } >> >> BTW: The methode isCurrentlyOwned() is not working. I get always >> the value "false". >> I can only get the status, while I open the port and catch the >> exception. >> >> Any ideas? >> >> Hans >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/948333be/attachment-0007.html From jredman at ergotech.com Tue May 16 07:35:52 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 16 May 2006 07:35:52 -0600 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: <4469D538.6070408@ergotech.com> Hans, I have no direct insight, but would note that what you have is a "NoClassDefFoundError" not a "ClassNotFoundException". So the class javax/comm/CommDriver is found, but one of its dependencies is missing. NoClassDefFoundError are a bigger problem to resolve because you get no indication of the real problem. Jim WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we have > some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > * spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always the > value "false". > I can only get the status, while I open the port and catch the exception. > > Any ideas? > > Hans > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.de Tue May 16 08:01:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 16:01:21 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 In-Reply-To: <4469AFC3.6000002@willicon.de> References: <44698EBC.8000008@willicon.de> <8C5680C4-E2BA-42FF-B221-36E1124FA6A4@buechse.de> <4469AFC3.6000002@willicon.de> Message-ID: <9825A602-D6ED-4C28-BF33-9A7C984FACD5@buechse.de> Hallo Hans, you include RXTX 2.17 in your "bikeXexperience.jar" (2.17 uses Interfaces from gnu.io.* not javax.comm.*). Now inspect your error log closely: The class gnu.io.RXTXCommDriver tries to load javax.comm.CommDriver: this is only the case for RXTX 2.07. I assume, that the user has installed Version 2.07 into one of the java.ext.dirs . The VM always tries to load classes from the "system" path first. The current Mac installer distributed with RXTX in fact installs RXTXcomm.jar and librxtxSerial.jnilib into /Library/Java/Extensions. (I wrote some time ago that I consider this as a bad idea because of potential version conflicts-> thanks for delivering the example). For 2.07 it does so without installing the javax.comm classes it seems. I would recommend that you instruct your users to install version 2.17 only. Until RXTX is changed to use TIOCEXCL instead of lock files, you can hardly avoid the installer, as the user needs to be added to a special group and a lockfile directory needs be created. More precisely you are waiting for: http://bugzilla.qbang.org/show_bug.cgi?id=50 [RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL)] Regards, Joachim -------------- next part -------------- A non-text attachment was scrubbed... Name: log.tiff Type: image/tiff Size: 38394 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/e3e52128/log-0007.tiff -------------- next part -------------- > > Ich verwende RXTX 2.17. Das orginal RXTXcomm.jar ist in > CyclingDataManager.jar enthalten. > From tjarvi at qbang.org Wed May 17 23:18:15 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 May 2006 23:18:15 -0600 (MDT) Subject: [Rxtx] update Message-ID: So we have several patches and these have stacked up. I'd like to thank everyone for being patient. Tests for the most intrusive patches look good so far. I still have to get some bits together on my end but it looks like we can catch everything up in CVS this week. I'll try to post a normal list of what went in by whom with links Saturday. But I'm not seeing anything that raises flags yet. I also think I'll be able to submit a patch for nonstandard baud rates. I have to confirm w32 but I think its going to be a one line fix. I don't know if its bugzilla or people tinkering with patch files before submitting but patches are not applying cleanly. So the patches have to be done by hand. This may make things difficult for people hoping to add other patches on top. I'm trying to make that go well but ... -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Thu May 18 02:23:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 May 2006 10:23:47 +0200 Subject: [Rxtx] update In-Reply-To: References: Message-ID: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Hello Trent, in fact I tinkered with the patches (never used this mechanism before, usually I "communicate" via cvs) ... so sorry for any trouble you had applying them. Basicly I edited the patches to make them self contained. Having the tests run with different speeds on different platforms, may well be an effect of caching. I have seen quite interesting propagation delays for the closing flag on my PowerPC system, which makes me doubt, that the propagation of output_buffer_empty_flag works as it should. Maybe the communication mechanism between the two threads should be replaced by something like pthread_cond_*. Could you describe which problems you see on Solaris/SPARC? I'd be interested to see if they exist on OS X (PowerPC) as well... As you seem to work on the stuff at the moment I would like to suggest the following additions (it looks more than it is, I posted some context to make clear where to apply the change). See the comments in braces for what was changed Greetings, Joachim (1) The end of the drain loop could be: --- report("drain_loop: received EINTR in tcdrain\n"); --- (added "in tcdrain" to make debug output clearer) (2) The start of the drain loop should be: --- for(i=0;;i++) { report_verbose("drain_loop: looping\n"); #if defined(__sun__) /* FIXME: No time to test on all OS's for production */ if( eis->eventloop_interrupted ) { goto end; } if (usleep(5000)) { report("drain_loop: received EINTR"); } #else if (usleep(1000000)) { report("drain_loop: received EINTR"); } #endif /* __sun__ */ --- (added a check for "eis->eventloop_interrupted" before the sleep) (3) The end of interrupt_event_loop could (and maybe should) be: --- #if !defined(TIOCSERGETLSR) && !defined(WIN32) /* make sure that the drainloop unblocks from tcdrain */ pthread_kill(index->drain_tid, SIGABRT); /* TODO use wait/join/SIGCHLD/?? instead of sleep? */ usleep(50 * 1000); /* Under normal conditions, SIGABRT will unblock tcdrain. However a non-responding USB device combined with an unclean driver may still block. This is very ugly because it may block the call to close indefinetly. */ if (index->closing != 1) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); index->closing = 1; } #endif report("interruptEventLoop: interrupted\n"); --- (added some comments and pthread_cancel for resisting drain thread) On 18.05.2006, at 07:18, Trent Jarvi wrote: > > So we have several patches and these have stacked up. I'd like to > thank > everyone for being patient. > > Tests for the most intrusive patches look good so far. I still > have to > get some bits together on my end but it looks like we can catch > everything > up in CVS this week. > > I'll try to post a normal list of what went in by whom with links > Saturday. But I'm not seeing anything that raises flags yet. I also > think I'll be able to submit a patch for nonstandard baud rates. > I have > to confirm w32 but I think its going to be a one line fix. > > I don't know if its bugzilla or people tinkering with patch files > before > submitting but patches are not applying cleanly. So the patches > have to > be done by hand. This may make things difficult for people hoping > to add > other patches on top. I'm trying to make that go well but ... > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu May 18 22:28:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 18 May 2006 22:28:00 -0600 (MDT) Subject: [Rxtx] update In-Reply-To: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> References: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Message-ID: On Thu, 18 May 2006, Joachim Buechse wrote: > Hello Trent, > > in fact I tinkered with the patches (never used this mechanism > before, usually I "communicate" via cvs) ... so sorry for any trouble > you had applying them. Basicly I edited the patches to make them self > contained. I think we are close to moving towards that. > > Having the tests run with different speeds on different platforms, > may well be an effect of caching. I have seen quite interesting > propagation delays for the closing flag on my PowerPC system, which > makes me doubt, that the propagation of output_buffer_empty_flag > works as it should. Maybe the communication mechanism between the two > threads should be replaced by something like pthread_cond_*. Could > you describe which problems you see on Solaris/SPARC? I'd be > interested to see if they exist on OS X (PowerPC) as well... This is interesting. I have seen problems with output buffer empty in applications that require it. I'm trying to get a bug list and or test results open for everyone to see but that may take time. But missed output buffer events ... yep. With Sparc, we have seen a few things. One was a kernel race condition that went away when we reimaged and updated 2.8. RXTX was hanging on close, top showed no cpu use but there was 2 second delays just typing on console. The other is our tests now take ~4 times longer on Solaris. Someone is looking at timing just open, close, read, write, ... to see if they can find where the slowdown is. This happened after solaris 2.8. I'll try to share more when/if there is something interesting. This may well not be solvable in userland. > > As you seem to work on the stuff at the moment I would like to > suggest the following additions (it looks more than it is, I posted > some context to make clear where to apply the change). See the > comments in braces for what was changed I'll take a look. This could all come together Saturday but I also have an event to attend that day. I may not wrap this up until Sunday. -- Trent Jarvi tjarvi at qbang.org From andrewlord at internode.on.net Sun May 21 20:10:02 2006 From: andrewlord at internode.on.net (Andrew Lord) Date: Mon, 22 May 2006 11:40:02 +0930 Subject: [Rxtx] Kernel include files do not match kernel Message-ID: <200605221140.03271.andrewlord@internode.on.net> Hi, I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel 2.6.12-18 with the command: ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include However I get the message: ## checking java.version 1.5.0_06 ## checking os.version 2.6.12-18mdk ## ## WARNING: Kernel include files do not match the current kernel ## ## configure: creating ./config.status etc. Is there a problem with the way I'm specifying the 'include' directory ? If not, how else can I specify the correct directory for the include files please ? Cheers, Andrew From tjarvi at qbang.org Sun May 21 20:31:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 May 2006 20:31:31 -0600 (MDT) Subject: [Rxtx] Kernel include files do not match kernel In-Reply-To: <200605221140.03271.andrewlord@internode.on.net> References: <200605221140.03271.andrewlord@internode.on.net> Message-ID: On Mon, 22 May 2006, Andrew Lord wrote: > Hi, > > I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel > 2.6.12-18 with the command: > > ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk > CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include > > However I get the message: > > ## checking java.version 1.5.0_06 > ## checking os.version 2.6.12-18mdk > ## > ## WARNING: Kernel include files do not match the current kernel > ## > ## configure: creating ./config.status > etc. > > Is there a problem with the way I'm specifying the 'include' directory ? If > not, how else can I specify the correct directory for the include files > please ? > Hi Andrew I'm fairly sure your --with-kernel option does nothing. The CPPFLAGS should do what you want. Maybe put an #error message in /usr/src/linux.../incude/linux/version.h But I don't recall a recent problem with version missmatches. It should work. Distros will even ship include files that don't match versions exactly. In theory it should never matter for users. I used to compile new kernels by hand and really didnt have a distro. I didnt have a seperate package of kernel headers for users (myself). When changing a gateway from linux 1.2.12 to 2.1.77, I would worry about such messages. So if you are doing something that weird, the message may be of use to you. If you just see the message on a distro you installed, it is more than likely harmless. -- Trent Jarvi tjarvi at qbang.org From mrogers at spro.net Mon May 22 14:45:39 2006 From: mrogers at spro.net (Mike Rogers) Date: Mon, 22 May 2006 14:45:39 -0600 Subject: [Rxtx] Sun's CommAPI -- think May? Message-ID: <447222F3.9040302@spro.net> Hi, Any word from Sun about progress towards fixing the Java CommAPI v3 "incompatibilities" so RXTX 2.0 can operate within the framework's namespace (javax.comm)? I recall mention of a May time frame. Thanks, Mike From paul.klissner at sun.com Mon May 22 15:09:27 2006 From: paul.klissner at sun.com (Paul Klissner) Date: Mon, 22 May 2006 14:09:27 -0700 Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <447222F3.9040302@spro.net> References: <447222F3.9040302@spro.net> Message-ID: <44722887.8080308@sun.com> Mike Rogers wrote: > Hi, > > Any word from Sun about progress towards fixing the Java CommAPI v3 > "incompatibilities" so RXTX 2.0 can operate within the framework's > namespace (javax.comm)? I recall mention of a May time frame. > > Thanks, > > Mike > We've had a lot of work come in. This hasn't been the only priority. I'm running behind the plan in addressing this, but will be looking at it again soon. Rather than state a new, I'll just say it is in progress, and not off the table. I'll get this fixed as soon as I can. Good timing for asking as we just started discussing javax.comm plans today, and I'll have some cycles to work on it soon. Paul From yhua537 at cse.unsw.edu.au Mon May 22 16:03:05 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Tue, 23 May 2006 08:03:05 +1000 (EST) Subject: [Rxtx] install rxtx in XP Message-ID: Hi Guys, I am new to serial port programming, and have no experience on programming java in xp, but my project require me to builld a communication link between xp and a UART device. Most of the information in the web site seems for linux only. including the commands such as export and chmod. How do I install rxtx in xp? cheers YiQi Huang From mark at mdsh.com Tue May 23 01:24:20 2006 From: mark at mdsh.com (Mark Himsley) Date: Tue, 23 May 2006 08:24:20 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off , it includes DLLs for Windows and the JAR for Java. Follow the Windows instructions in the INSTALL. ie RXTXcomm.jar goes in \jre\lib\ext (under java) rxtxSerial.dll goes in \jre\bin So, assuming a fairly standard Java install, copy RXTXcomm.jar into C:\Program Files\Java\jre1.5.0_06\lib\ext and copy rxtxSerial.dll into C:\Program Files\Java\jre1.5.0_06\bin Yes, it really is that simple. On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > I am new to serial port programming, and have no experience on > programming java in xp, but my project require me to builld a > communication link between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang -- Mark Himsley From joachim at buechse.de Tue May 23 02:51:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 23 May 2006 10:51:47 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) Unless it is absolutely required you should NOT install RXTX in your global Java Runtime Environment. This will for sure create versioning conflicts - if not now, than in the future, if not on your system than at your clients. Instead put the dll in your application directory and include the RXTXcomm.jar in your classpath. This is much safer and not a bit more complicated. Regards, Joachim On 23.05.2006, at 09:24, Mark Himsley wrote: > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR > for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > >> I am new to serial port programming, and have no experience on >> programming java in xp, but my project require me to builld a >> communication link between xp and a UART device. >> >> Most of the information in the web site seems for linux only. >> including >> the commands such as export and chmod. How do I install rxtx in xp? >> >> cheers >> YiQi Huang > > > > -- > Mark Himsley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tod at todbot.com Tue May 23 03:12:22 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 02:12:22 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I totally agree: do not contaminate the Java installation. I put all the RXTX files in a directory and then change my java invocation to be: % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* Alternatively, use Launch4J to create a double-clickable application and keep the RXTX libraries in the directory of the application. -=tod On May 23, 2006, at 1:51 AM, Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > >> Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off >> , it includes DLLs for Windows and the JAR >> for Java. >> >> Follow the Windows instructions in the INSTALL. >> >> ie >> >> RXTXcomm.jar goes in \jre\lib\ext (under java) >> rxtxSerial.dll goes in \jre\bin >> >> So, assuming a fairly standard Java install, copy RXTXcomm.jar into >> C:\Program Files\Java\jre1.5.0_06\lib\ext >> and copy rxtxSerial.dll into >> C:\Program Files\Java\jre1.5.0_06\bin >> >> Yes, it really is that simple. >> >> >> >> On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: >> >>> I am new to serial port programming, and have no experience on >>> programming java in xp, but my project require me to builld a >>> communication link between xp and a UART device. >>> >>> Most of the information in the web site seems for linux only. >>> including >>> the commands such as export and chmod. How do I install rxtx in xp? >>> >>> cheers >>> YiQi Huang >> >> >> >> -- >> Mark Himsley >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From smontgomery at mediaspansoftware.com Tue May 23 08:46:53 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Tue, 23 May 2006 10:46:53 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: Message-ID: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Joachim and Tod mentioned how to keep the files RXTX requires on Windows XP out of the Java installations - thanks gentlemen! Are there similar suggestions for an RXTX install on OS X? The current "canonical" OS X installation instructions "contaminate the Java installation", to use Tod's words. Our app will run fine under 1.4.2 and 5.0 on OS X, and a lot of users will have both. We've already been burned by the recent switch from 1.4.2 to 5.0 as the platform default. Any suggestions welcomed. From tod at todbot.com Tue May 23 13:27:55 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 12:27:55 -0700 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <9BA0F670-A862-42E7-BB2C-130D775ABDF9@todbot.com> Hi Sean, It depends on how you build and deploy your code. If you're using shell scripts, you can do something like this: #!/bin/sh # pick one JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/ Commands/java #JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/ Commands/java $JAVA -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* That both picks which VM to use and uses the RXTX in the directory called 'rxtxlib'. If you want your shell script to be clever, you could test for the existence of the different 'java' executables and go from there (maybe even use different jar files). I am almost positive all OS X systems with Java 1.5 are guaranteed to also have Java 1.4.2. If you're using Jar Builder or XCode, you can specify which JVM to use and add the extra args in the Info.plist file. The paths specified in the 'java' invocation then are based off of the $JAVAROOT variable that the JavaApplicationStub sets for you. For my app, I've have been compiling two sets of jars, one compiled with 1.4.2 and one with 1.5, but they both run under 1.5. So I have a similar shell script that chooses a different 'javac' depending on the need. -=tod On May 23, 2006, at 7:46 AM, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From yhua537 at cse.unsw.edu.au Tue May 23 11:09:37 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 03:09:37 +1000 (EST) Subject: [Rxtx] install rxtx in XP (Mark Himsley, Joachim Buechse, Tod E. Kurt> In-Reply-To: References: Message-ID: > Message: 8 > Date: Tue, 23 May 2006 08:03:05 +1000 (EST) > From: YiQi Huang > Subject: [Rxtx] install rxtx in XP > To: rxtx at qbang.org > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > Hi Guys, > > I am new to serial port programming, and have no experience on programming > java in xp, but my project require me to builld a communication link > between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang > > > ------------------------------ > > Message: 9 > Date: Tue, 23 May 2006 08:24:20 +0100 > From: Mark Himsley > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=us-ascii; format=flowed > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > ------------------------------ > > Message: 10 > Date: Tue, 23 May 2006 10:51:47 +0200 > From: Joachim Buechse > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > > ------------------------------ > > Message: 11 > Date: Tue, 23 May 2006 02:12:22 -0700 > From: "Tod E. Kurt" > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I totally agree: do not contaminate the Java installation. > > I put all the RXTX files in a directory and then change my java > invocation to be: > > % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* > > Alternatively, use Launch4J to create a double-clickable application > and keep the RXTX libraries in the directory of the application. > > -=tod > > Hi, Thanks guys, I don't know if this is the correct way to reply your mecessage, if wrong, please point out. Thank you for Mark to give the detail instructions and Joachim to point out the cons ot installing in the java directory, and specially thanks for Tod to give the instrection in detail. Sorry to ask another stupid question: I have followed Tod's instruction. Now I think i am ready to start hacking. But where is the RXTX API documentation? Is it the same as using normal java comm API? btw, where could i find some examples to start with? Thanks very much cheers YiQi Huang From tjarvi at qbang.org Tue May 23 16:09:32 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 May 2006 16:09:32 -0600 (MDT) Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <44722887.8080308@sun.com> References: <447222F3.9040302@spro.net> <44722887.8080308@sun.com> Message-ID: > Good timing for asking as we just started discussing javax.comm plans > today, and I'll have some cycles to work on it soon. Hi Paul I assume you mean Sun is discussing plans concerning its own internal actions and there is no community involvment at this point. -- Trent Jarvi tjarvi at qbang.org From yhua537 at cse.unsw.edu.au Tue May 23 22:50:01 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 14:50:01 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } From mmester at sps.edu Tue May 23 22:58:21 2006 From: mmester at sps.edu (Michael Mester) Date: Wed, 24 May 2006 00:58:21 -0400 Subject: [Rxtx] install rxtx in XP References: Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below -----Original Message----- From: rxtx-bounces at qbang.org on behalf of YiQi Huang Sent: Wed 5/24/2006 12:50 AM To: RXTX Developers and Users Subject: Re: [Rxtx] install rxtx in XP Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3950 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060523/b36d0c63/attachment-0007.bin From yhua537 at cse.unsw.edu.au Tue May 23 23:05:50 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 15:05:50 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: Yes, Michael you are right, it should be semicolons, But it still can't find the correct library. On Wed, 24 May 2006, Michael Mester wrote: > I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below > > > -----Original Message----- > From: rxtx-bounces at qbang.org on behalf of YiQi Huang > Sent: Wed 5/24/2006 12:50 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] install rxtx in XP > > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > cheers YiQi Huang From tod at todbot.com Wed May 24 00:01:57 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 23:01:57 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Yes, sorry, classpath entries are semicolon-separated on Windows and colon-separated on everything else. Your example code below is importing the wrong set of classes. It should not "import javax.comm.*", instead it should "import gnu.io.*". When I make that change, your example program compiles. The "javax.comm" package is the one released by Sun, the "gnu.io" package is the RXTX one. You might've seen some discussion that the two will be merged or become compatible, but that hasn't happened yet. -=tod On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > > Yes, Michael you are right, it should be semicolons, But it still > can't > find the correct library. > > On Wed, 24 May 2006, Michael Mester wrote: > >> I believe the entries in the classpath need to be seperated with >> semicolons, not a colon as you have in your command below >> >> >> -----Original Message----- >> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >> Sent: Wed 5/24/2006 12:50 AM >> To: RXTX Developers and Users >> Subject: Re: [Rxtx] install rxtx in XP >> >> Hi, >> >> Sorry guys.I follow Tod's instruction, and here is what i did: >> >> put >> RXTXcomm.jar, >> rxtxParallel.dll, >> rxtxSerial.dll >> in >> C:\RXTX_files >> >> and I got a SimpleRead class attached below, compile it with : >> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >> it still saying "cannot find symbol". >> >> Is there anything I did wrong? Do I need the comm.jar from Sun? >> >> Thanks & regards >> YiQi Huang >> >> >> //////////////////////////////////////////////////////// >> // SimpleRead.java >> //////////////////////////////////////////////////////// >> >> import java.io.*; >> import java.util.*; >> import javax.comm.*; >> >> public class SimpleRead >> implements Runnable, SerialPortEventListener { >> static CommPortIdentifier portId; >> static Enumeration portList; >> InputStream inputStream; >> SerialPort serialPort; >> Thread readThread; >> public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == >> CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals("COM1")) { >> //if (portId.getName().equals("/dev/term/a")) { >> SimpleRead reader = new SimpleRead(); >> } >> } >> } >> } >> public SimpleRead() { >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", >> 2000); >> } catch (PortInUseException e) {} >> try { >> inputStream = serialPort.getInputStream(); >> } catch (IOException e) {} >> try { >> serialPort.addEventListener(this); >> } catch (TooManyListenersException e) {} >> serialPort.notifyOnDataAvailable(true); >> try { >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } catch (UnsupportedCommOperationException e) {} >> readThread = new Thread(this); >> readThread.start(); >> } >> public void run() { >> try { >> Thread.sleep(20000); >> } catch (InterruptedException e) {} >> } >> public void serialEvent(SerialPortEvent event) { >> switch(event.getEventType()) { >> case SerialPortEvent.BI: >> case SerialPortEvent.OE: >> case SerialPortEvent.FE: >> case SerialPortEvent.PE: >> case SerialPortEvent.CD: >> case SerialPortEvent.CTS: >> case SerialPortEvent.DSR: >> case SerialPortEvent.RI: >> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >> break; >> case SerialPortEvent.DATA_AVAILABLE: >> byte[] readBuffer = new byte[20]; >> try { >> while (inputStream.available() > 0) { >> int numBytes = inputStream.read(readBuffer); >> } >> System.out.print(new String(readBuffer)); >> } catch (IOException e) {} >> break; >> } >> } >> } >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > cheers > YiQi Huang > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From joachim at buechse.de Wed May 24 00:10:06 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:10:06 +0200 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Hi Sean, my preferred way of dealing with RXTX on OS X is to include the RXTX classes into my application jar and to put the RXTX lib in the same directory as this jar. To make it even more comfortable, you can include the lib in the jar and have some startup code extract it and write it to a temporary file from which you load it with System.load(). Unfortunately the current version of RXTX for OS X requires tinkering with user groups as it is based on lockfiles - and hence it needs the RXTX OS X installer or you need to duplicated this functionality in your own installer. I have created my own native version which is not based on lockfiles but tty locking (the standard way to do it on OSX). I hope that these patches will be integrated soon into the distribution. Regards, Joachim On 23.05.2006, at 16:46, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Wed May 24 00:16:12 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:16:12 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <7017ECFC-B13E-4806-B321-9FFCAC5830F0@buechse.de> I assume you downloaded rxtx-217 (not 207). Instead of importing javax.comm.* you must import gnu.io.* The classes have the same name, but they are not in the same package. On 24.05.2006, at 06:50, YiQi Huang wrote: > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From yhua537 at cse.unsw.edu.au Wed May 24 00:17:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 16:17:45 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Message-ID: Thanks Tod again, i kept reading "gnu.io.*" as "gun.io.*" last few hours after i read some commons from web. Thanks very much Tod. thanks YiQi Huang On Tue, 23 May 2006, Tod E. Kurt wrote: > Yes, sorry, classpath entries are semicolon-separated on Windows and > colon-separated on everything else. > > Your example code below is importing the wrong set of classes. It > should not "import javax.comm.*", instead it should "import > gnu.io.*". When I make that change, your example program compiles. > The "javax.comm" package is the one released by Sun, the "gnu.io" > package is the RXTX one. You might've seen some discussion that the > two will be merged or become compatible, but that hasn't happened yet. > > -=tod > > > On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > >> >> Yes, Michael you are right, it should be semicolons, But it still >> can't >> find the correct library. >> >> On Wed, 24 May 2006, Michael Mester wrote: >> >>> I believe the entries in the classpath need to be seperated with >>> semicolons, not a colon as you have in your command below >>> >>> >>> -----Original Message----- >>> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >>> Sent: Wed 5/24/2006 12:50 AM >>> To: RXTX Developers and Users >>> Subject: Re: [Rxtx] install rxtx in XP >>> >>> Hi, >>> >>> Sorry guys.I follow Tod's instruction, and here is what i did: >>> >>> put >>> RXTXcomm.jar, >>> rxtxParallel.dll, >>> rxtxSerial.dll >>> in >>> C:\RXTX_files >>> >>> and I got a SimpleRead class attached below, compile it with : >>> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >>> it still saying "cannot find symbol". >>> >>> Is there anything I did wrong? Do I need the comm.jar from Sun? >>> >>> Thanks & regards >>> YiQi Huang >>> >>> >>> //////////////////////////////////////////////////////// >>> // SimpleRead.java >>> //////////////////////////////////////////////////////// >>> >>> import java.io.*; >>> import java.util.*; >>> import javax.comm.*; >>> >>> public class SimpleRead >>> implements Runnable, SerialPortEventListener { >>> static CommPortIdentifier portId; >>> static Enumeration portList; >>> InputStream inputStream; >>> SerialPort serialPort; >>> Thread readThread; >>> public static void main(String[] args) { >>> portList = CommPortIdentifier.getPortIdentifiers(); >>> while (portList.hasMoreElements()) { >>> portId = (CommPortIdentifier) portList.nextElement(); >>> if (portId.getPortType() == >>> CommPortIdentifier.PORT_SERIAL) { >>> if (portId.getName().equals("COM1")) { >>> //if (portId.getName().equals("/dev/term/a")) { >>> SimpleRead reader = new SimpleRead(); >>> } >>> } >>> } >>> } >>> public SimpleRead() { >>> try { >>> serialPort = (SerialPort) portId.open("SimpleReadApp", >>> 2000); >>> } catch (PortInUseException e) {} >>> try { >>> inputStream = serialPort.getInputStream(); >>> } catch (IOException e) {} >>> try { >>> serialPort.addEventListener(this); >>> } catch (TooManyListenersException e) {} >>> serialPort.notifyOnDataAvailable(true); >>> try { >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, >>> SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> } catch (UnsupportedCommOperationException e) {} >>> readThread = new Thread(this); >>> readThread.start(); >>> } >>> public void run() { >>> try { >>> Thread.sleep(20000); >>> } catch (InterruptedException e) {} >>> } >>> public void serialEvent(SerialPortEvent event) { >>> switch(event.getEventType()) { >>> case SerialPortEvent.BI: >>> case SerialPortEvent.OE: >>> case SerialPortEvent.FE: >>> case SerialPortEvent.PE: >>> case SerialPortEvent.CD: >>> case SerialPortEvent.CTS: >>> case SerialPortEvent.DSR: >>> case SerialPortEvent.RI: >>> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >>> break; >>> case SerialPortEvent.DATA_AVAILABLE: >>> byte[] readBuffer = new byte[20]; >>> try { >>> while (inputStream.available() > 0) { >>> int numBytes = inputStream.read(readBuffer); >>> } >>> System.out.print(new String(readBuffer)); >>> } catch (IOException e) {} >>> break; >>> } >>> } >>> } >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> >> cheers >> YiQi Huang >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From smontgomery at mediaspansoftware.com Wed May 24 10:24:13 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 12:24:13 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: Tod & Joachim, Thanks for the info, that's very helpful. I'll give that a whirl when I move to rxtx 2.1. I'm still using the older 2.0.7 version for now (don't ask), which probably requires the Sun comm.jar, javax.comm.properties and librxtxSerial.jnilib to be in very specific places in each jvm's file hierarchy. From tjarvi at qbang.org Wed May 24 11:59:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 11:59:16 -0600 (MDT) Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: On Wed, 24 May 2006, Sean Montgomery wrote: > Tod & Joachim, > > Thanks for the info, that's very helpful. I'll give that a whirl > when I move to rxtx 2.1. I'm still using the older 2.0.7 version for > now (don't ask), which probably requires the Sun comm.jar, > javax.comm.properties and librxtxSerial.jnilib to be in very specific > places in each jvm's file hierarchy. > You will need comm.jar from Sun then. It must be Sun's version 2.* or older for Linux or Solaris. I assume they have this in download archives. The default offering from Sun is version 3.0. This version currently does not support rxtx. The older version will probably be fine for your needs. -- Trent Jarvi tjarvi at qbang.org From smontgomery at mediaspansoftware.com Wed May 24 12:19:06 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 14:19:06 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: <3939EFB8-11E1-4E3E-A684-5B3C525577CD@mediaspansoftware.com> Yup, that's right, thanks Trent. I've been using these files for quite a while now. Thanks for bringing it up. I almost didn't mention using 2.0.7 because I didn't want to give any new members of the list the wrong idea! :-) On May 24, 2006, at 1:59 PM, Trent Jarvi wrote: > On Wed, 24 May 2006, Sean Montgomery wrote: > >> Tod & Joachim, >> >> Thanks for the info, that's very helpful. I'll give that a whirl >> when I move to rxtx 2.1. I'm still using the older 2.0.7 version for >> now (don't ask), which probably requires the Sun comm.jar, >> javax.comm.properties and librxtxSerial.jnilib to be in very specific >> places in each jvm's file hierarchy. >> > > You will need comm.jar from Sun then. It must be Sun's version 2.* or > older for Linux or Solaris. I assume they have this in download > archives. > > The default offering from Sun is version 3.0. This version > currently does > not support rxtx. > > The older version will probably be fine for your needs. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mark at mdsh.com Wed May 24 15:55:46 2006 From: mark at mdsh.com (Mark Himsley) Date: Wed, 24 May 2006 22:55:46 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <37B0FC4B1F3237321F093ABE@MacMini.local> On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) That's no problem. BUT, do note that the instructions I elaborated on are in the INSTALL file within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone please update the INSTALL file? > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > > , it includes DLLs for Windows and the JAR > > for Java. > > > > Follow the Windows instructions in the INSTALL. > > > > ie > > > > RXTXcomm.jar goes in \jre\lib\ext (under java) > > rxtxSerial.dll goes in \jre\bin > > > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > > C:\Program Files\Java\jre1.5.0_06\lib\ext > > and copy rxtxSerial.dll into > > C:\Program Files\Java\jre1.5.0_06\bin > > > > Yes, it really is that simple. > > > > > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > > > >> I am new to serial port programming, and have no experience on > >> programming java in xp, but my project require me to builld a > >> communication link between xp and a UART device. > >> > >> Most of the information in the web site seems for linux only. > >> including > >> the commands such as export and chmod. How do I install rxtx in xp? > >> > >> cheers > >> YiQi Huang > > > > > > > > -- > > Mark Himsley > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Mark Himsley From tjarvi at qbang.org Wed May 24 16:41:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 16:41:46 -0600 (MDT) Subject: [Rxtx] install rxtx in XP In-Reply-To: <37B0FC4B1F3237321F093ABE@MacMini.local> References: <37B0FC4B1F3237321F093ABE@MacMini.local> Message-ID: On Wed, 24 May 2006, Mark Himsley wrote: > > > On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > >> I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > That's no problem. > > BUT, do note that the instructions I elaborated on are in the INSTALL file > within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone > please update the INSTALL file? > > The INSTALL file may be updated by anyone at anytime. http://rxtx.qbang.org/wiki/index.php/Installation We are moving it to the wiki so end users may put the type of answers they would like to see in. Sometimes it's best if developers don't give what appears to be cryptic answers. You can even put in that jre/lib/ext is not the right place but you don't understand the classpath solution mentioned on the mail-list and then we know what to add. -- Trent Jarvi tjarvi at qbang.org From stramit at gmail.com Wed May 24 21:45:31 2006 From: stramit at gmail.com (Tim Cooper) Date: Thu, 25 May 2006 13:45:31 +1000 Subject: [Rxtx] Accessing Virtual Com Port Message-ID: Hi, I have to develop an application that talks to a virtual com port (in this case com3) which translates any messages sent across a USB cable to a micro. Using C++ I can talk to this com port and I know that it is configured, present, and working. For the application that I am trying to write I want to use RXTX for the communication. My problem is that the configured virtual port (in windows) is not showing up when I do an enumeration over the available ports. The output I get is (com 3 is not present) : Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 PORT FOUND: COM1 PORT FOUND: LPT1 Is there anything that I need to do to make com3 available to RXTX and my application? Timothy Cooper -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060524/c5591648/attachment-0007.html From antonio.luis at iscte.pt Thu May 25 01:39:13 2006 From: antonio.luis at iscte.pt (=?ISO-8859-1?Q?Ant=F3nio_Lopes?=) Date: Thu, 25 May 2006 08:39:13 +0100 Subject: [Rxtx] RXTX on Pocket PC Message-ID: <44755F21.8060103@iscte.pt> Hello everyone, I've been using RXTX to communicate with serial ports in Windows and it's been quite successful. However, I'm now considering porting my application from Windows to Pocket PC but I can't seem to find the RXTX binaries (*.jar and *.dll) to use in Pocket PC. I've been "digging" on the mailing list's archives and also on the web and I can't find these anywhere. Can anyone in this mailing list give me some pointers on this? Where can I find the necessary files and basic installation instructions? Thanks very much for your help. I very much appreciate any help that you can provide me. Regards, -- Ant?nio Lopes @contact: antonio.luis at iscte.pt @work: ADETTI - ISCTE @web: http://antonio.lopes.googlepages.com/home From doug at dupreeinc.com Fri May 26 15:45:50 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Fri, 26 May 2006 14:45:50 -0700 Subject: [Rxtx] rxtx slow startup Message-ID: <4477770E.9010400@dupreeinc.com> Hello, I hope there are people still reading this mailing list. The archive appeared to not have anything new after 4/2005. I was using the commapi from sun for a project where a java application reads data from test equipment connected to the serial port. I had to upgrade the ftdi vcp driver on my pc and the old sun commapi no longer works with hardware flow control. as an experiment I replaced the javax.com with gnu.io in the SerialDemo.java project that was included with the commapi. This compiled fine using JBuilder 2006 and JRE 1.5.0_05. RXTX also works with the latest ftdi drivers so life is wonderful again... almost... When using the commapi jar the SerialDemo program starts in about 1 second on my system. Using the RXTX jar it takes over 56 seconds to start. Has anyone else seen this problem? Is there a workaround to get the startup performance close to the old commapi? The last thing printed to the console before this delay is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks for your time! Doug From yhua537 at cse.unsw.edu.au Sat May 27 05:46:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 21:46:45 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <4477770E.9010400@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> Message-ID: hi Doug The archive hasn't been update for a long time, But people certainly still reading the list. I don't have enough experience to help on your problem, but without any detail about what your problem doing during that 56 seconds, it is hard to target the your question, I think. cheers YiQi On Fri, 26 May 2006, Doug Thistlethwaite wrote: > Hello, > > I hope there are people still reading this mailing list. The archive > appeared to not have anything new after 4/2005. > > I was using the commapi from sun for a project where a java application > reads data from test equipment connected to the serial port. I had to > upgrade the ftdi vcp driver on my pc and the old sun commapi no longer > works with hardware flow control. as an experiment I replaced the > javax.com with gnu.io in the SerialDemo.java project that was included > with the commapi. This compiled fine using JBuilder 2006 and JRE > 1.5.0_05. RXTX also works with the latest ftdi drivers so life is > wonderful again... almost... > > When using the commapi jar the SerialDemo program starts in about 1 > second on my system. Using the RXTX jar it takes over 56 seconds to > start. Has anyone else seen this problem? Is there a workaround to get > the startup performance close to the old commapi? > > The last thing printed to the console before this delay is: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Thanks for your time! > > Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------- Just a student, Still a student ------------------------------- From yhua537 at cse.unsw.edu.au Sat May 27 06:04:26 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 22:04:26 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: Sorry, I don't think you could understand what I mean .I mean this: Without any detail about what your program is doing during that 56 seconds, it is hard for anyone to target the problem. On Sat, 27 May 2006, YiQi Huang wrote: > hi Doug > > The archive hasn't been update for a long time, But people certainly still > reading the list. > > I don't have enough experience to help on your problem, but without any > detail about what your problem doing during that 56 seconds, it is hard to > target the your question, I think. > > cheers > YiQi > > On Fri, 26 May 2006, Doug Thistlethwaite wrote: > >> Hello, >> >> I hope there are people still reading this mailing list. The archive >> appeared to not have anything new after 4/2005. >> >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From jredman at ergotech.com Sat May 27 08:32:02 2006 From: jredman at ergotech.com (Jim Redman) Date: Sat, 27 May 2006 08:32:02 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: <447862E2.4080506@ergotech.com> Doug, Since you mentioned it, we have a system that is also seems slow. From memory (I don't have one of the slow systems around), I'm not sure that it's consistent, it seems that sometimes it may take longer than others. Since it's part of the bootup it hasn't raised a flag and I haven't researched it. The same code runs much faster on other systems, so now you've got me wondering what's different. The slow system boots DSL (http://www.damnsmalllinux.org/) from a compact flash. FC4 is on my desktop where I haven't noticed a slow down. I think that the rxtx code is the same in both cases with lock files disabled. The slow system has a bunch of serial ports defined, including 4 USB serial ports that do not exist - they are not plugged in. Any clues in there? Jim > On Fri, 26 May 2006, Doug Thistlethwaite wrote: >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Sat May 27 10:41:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 May 2006 10:41:54 -0600 (MDT) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447862E2.4080506@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: On Sat, 27 May 2006, Jim Redman wrote: > Doug, > > Since you mentioned it, we have a system that is also seems slow. From > memory (I don't have one of the slow systems around), I'm not sure that > it's consistent, it seems that sometimes it may take longer than others. > Since it's part of the bootup it hasn't raised a flag and I haven't > researched it. > > The same code runs much faster on other systems, so now you've got me > wondering what's different. > > The slow system boots DSL (http://www.damnsmalllinux.org/) from a > compact flash. FC4 is on my desktop where I haven't noticed a slow > down. I think that the rxtx code is the same in both cases with lock > files disabled. > > The slow system has a bunch of serial ports defined, including 4 USB > serial ports that do not exist - they are not plugged in. > > Any clues in there? > rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. When it does this, it will try to open each port and do a timed out read. most systems will not have entries in device if the port is not there. But some minimal systems will just put all the device files there in case hardware is added. The list of devices scanned used to be ~10-20 times longer than it is today. That was getting very slow. I suspect moving the device files not used to a backup directory would increase the enumeration. I'll look into why the mail-list archive is not updating. The last update was about when I thought I 'fixed' the cron jobs. I probably didn't actually fix it but rather moved the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon May 29 19:46:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 May 2006 19:46:47 -0600 (MDT) Subject: [Rxtx] Mail-List Archives are updating. Message-ID: It was pointed out earlier that the archive is dated. This was a missing crontab entry. The list is currently archived by the week on the web page. It is updated once a day. So every 7 days it starts a new link and updates it daily. I've been limited in what I could do while my cable modem was disconnected this last week. rxtx.org is something I do on my own time. The patches and credits will be comming next. Many of these can be seen in bugzilla right now. -- Trent Jarvi tjarvi at qbang.org From doug at dupreeinc.com Tue May 30 11:18:41 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 10:18:41 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: <447C7E71.4080204@dupreeinc.com> Trent, YiQi, and Jim: Thanks to all for the replies and information! I am just back from a long weekend and I am now trying to figure out what I was doing! :) As for more information. First off, this example is being run under windows XP. I am developing test equipment that communicates with a java application via a serial port. I have been using the commapi for several years and have not had a problem. Recently, I have started a design modification that will replace the RS232 connection with a USB port. I am using the ftdi module for prototyping and I discovered that their virtual com port driver was not compatible with the commapi that Sun released. It turns out that it has problems with hardware flow control ( it works on incoming but not outgoing communications). The way I figured this out was by experimenting with the SerialDemo that was included with the Sum commapi. One nice thing about this example is it has the ability to set incoming and outgoing flow control independently. After I installed RXTX into my JBuilder 2006 IDE, I just replaced all all instances of javax.comm with gnu.io and it compiled and runs without a hitch (except for the slow startup). I Paused the JBuilder IDE during this long pause and the last few entries in the stack trace are: testRead() : -1, gnu.io.RXTXCommDriver registerValidPorts() : 255, gnu.io.RXTXCommDriver registerScannedPorts() : 777, gnu.io.RXTXCommDriver This was all initiated by the following call in the programs init routine: Enumeration en = CommPortIdentifier.getPortIdentifiers(); After looking at this, My guess is that Trent is correct in that the delay is in scanning for ports. I guess one solution would be to not scan for ports, though it would be nice to detect what is available on the system. Is there any way to reduce the number of ports scanned by this function in windows XP? Thanks again for your time, Doug Trent Jarvi wrote: >On Sat, 27 May 2006, Jim Redman wrote: > > > >>Doug, >> >>Since you mentioned it, we have a system that is also seems slow. From >>memory (I don't have one of the slow systems around), I'm not sure that >>it's consistent, it seems that sometimes it may take longer than others. >>Since it's part of the bootup it hasn't raised a flag and I haven't >>researched it. >> >>The same code runs much faster on other systems, so now you've got me >>wondering what's different. >> >>The slow system boots DSL (http://www.damnsmalllinux.org/) from a >>compact flash. FC4 is on my desktop where I haven't noticed a slow >>down. I think that the rxtx code is the same in both cases with lock >>files disabled. >> >>The slow system has a bunch of serial ports defined, including 4 USB >>serial ports that do not exist - they are not plugged in. >> >>Any clues in there? >> >> >> > >rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. > >When it does this, it will try to open each port and do a timed out read. >most systems will not have entries in device if the port is not there. >But some minimal systems will just put all the device files there in case >hardware is added. > >The list of devices scanned used to be ~10-20 times longer than it is >today. That was getting very slow. > >I suspect moving the device files not used to a backup directory would >increase the enumeration. > >I'll look into why the mail-list archive is not updating. The last update >was about when I thought I 'fixed' the cron jobs. I probably didn't >actually fix it but rather moved the problem. > >-- >Trent Jarvi >tjarvi at qbang.org > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/86796453/attachment-0007.html From doug at dupreeinc.com Tue May 30 14:36:09 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 13:36:09 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447C7E71.4080204@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com> Message-ID: <447CACB9.1000801@dupreeinc.com> Hello all, I also notice this pause (not as long however) when I call: CommPortIdentifier.getPortIdentifier(PortName); I would think that if I supply the name of the port, it would not have to go through the same discovery process. If you have any ideas of how to get rid of this startup delay, I would really appreciate it. Thanks, Doug Doug Thistlethwaite wrote: > Trent, YiQi, and Jim: > > Thanks to all for the replies and information! I am just back from a > long weekend and I am now trying to figure out what I was doing! :) > > As for more information. First off, this example is being run under > windows XP. I am developing test equipment that communicates with a > java application via a serial port. I have been using the commapi for > several years and have not had a problem. Recently, I have started a > design modification that will replace the RS232 connection with a USB > port. I am using the ftdi module for prototyping and I discovered > that their virtual com port driver was not compatible with the commapi > that Sun released. It turns out that it has problems with hardware > flow control ( it works on incoming but not outgoing communications). > The way I figured this out was by experimenting with the SerialDemo > that was included with the Sum commapi. One nice thing about this > example is it has the ability to set incoming and outgoing flow > control independently. > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup). > > I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are: > > testRead() : -1, gnu.io.RXTXCommDriver > registerValidPorts() : 255, gnu.io.RXTXCommDriver > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > This was all initiated by the following call in the programs init routine: > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > After looking at this, My guess is that Trent is correct in that the > delay is in scanning for ports. I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system. Is there any way to reduce the number of ports scanned by > this function in windows XP? > > Thanks again for your time, > > Doug > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/edaa5c3c/attachment-0007.html From lynn at swcp.com Tue May 30 15:07:18 2006 From: lynn at swcp.com (lynn@swcp.com) Date: Tue, 30 May 2006 21:07:18 -0000 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CACB9.1000801@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: *IF* the name of the port is supplied, we might want to use the preferences mechanism (java.util.prefs) where we could have previously saved the info for the port. We could do a quick check to see that things have not changed before using it. If things have changed (or never been defined) we would do a full port scan and save detected ports in the preferences. This way if the hardware is not changed, you only pay the time penalty one time. just an idea... Lynn Doug Thistlethwaite said: > This is a multi-part message in MIME format. > --------------070808020900080005070500 > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > Content-Transfer-Encoding: 7bit > > Hello all, > > I also notice this pause (not as long however) when I call: > > CommPortIdentifier.getPortIdentifier(PortName); > > I would think that if I supply the name of the port, it would not have > to go through the same discovery process. If you have any ideas of how > to get rid of this startup delay, I would really appreciate it. > > Thanks, > > Doug > > Doug Thistlethwaite wrote: > > > Trent, YiQi, and Jim: > > > > Thanks to all for the replies and information! I am just back from a > > long weekend and I am now trying to figure out what I was doing! :) > > > > As for more information. First off, this example is being run under > > windows XP. I am developing test equipment that communicates with a > > java application via a serial port. I have been using the commapi for > > several years and have not had a problem. Recently, I have started a > > design modification that will replace the RS232 connection with a USB > > port. I am using the ftdi module for prototyping and I discovered > > that their virtual com port driver was not compatible with the commapi > > that Sun released. It turns out that it has problems with hardware > > flow control ( it works on incoming but not outgoing communications). > > The way I figured this out was by experimenting with the SerialDemo > > that was included with the Sum commapi. One nice thing about this > > example is it has the ability to set incoming and outgoing flow > > control independently. > > > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > > all instances of javax.comm with gnu.io and it compiled and runs > > without a hitch (except for the slow startup). > > > > I Paused the JBuilder IDE during this long pause and the last few > > entries in the stack trace are: > > > > testRead() : -1, gnu.io.RXTXCommDriver > > registerValidPorts() : 255, gnu.io.RXTXCommDriver > > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > > > This was all initiated by the following call in the programs init routine: > > > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > > > After looking at this, My guess is that Trent is correct in that the > > delay is in scanning for ports. I guess one solution would be to not > > scan for ports, though it would be nice to detect what is available on > > the system. Is there any way to reduce the number of ports scanned by > > this function in windows XP? > > > > Thanks again for your time, > > > > Doug > > > > --------------070808020900080005070500 > Content-Type: text/html; charset=ISO-8859-1 > Content-Transfer-Encoding: 7bit > > > > > > > > > Hello all,
>
> I also notice this pause (not as long however) when I call:
>
>          CommPortIdentifier.getPortIdentifier(PortName);
>
> I would think that if I supply the name of the port, it would not have > to go through the same discovery process.  If you have any ideas of how > to get rid of this startup delay, I would really appreciate it.
>
> Thanks,
>
> Doug
>
> Doug Thistlethwaite wrote: >
> > Trent, YiQi, and Jim:
>
> Thanks to all for the replies and information!  I am just back from a > long weekend and I am now trying to figure out what I was doing! :)
>
> As for more information.  First off, this example is being run under > windows XP.  I am developing test equipment that communicates with a > java application via a serial port.  I have been using the commapi for > several years and have not had a problem.  Recently, I have started a > design modification that will replace the RS232 connection with a USB > port.  I am using the ftdi module for prototyping and I discovered that > their virtual com port driver was not compatible with the commapi that > Sun released.  It turns out that it has problems with hardware flow > control ( it works on incoming but not outgoing communications).  The > way I figured this out was by experimenting with the SerialDemo that > was included with the Sum commapi.  One nice thing about this example > is it has the ability to set incoming and outgoing flow control > independently.
>
> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup).
>
> I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are:
>
> testRead() : -1, gnu.io.RXTXCommDriver
> registerValidPorts() : 255, gnu.io.RXTXCommDriver
> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>
> This was all initiated by the following call in the programs init > routine:
>
> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>
> After looking at this,  My guess is that Trent is correct in that the > delay is in scanning for ports.  I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system.  Is there any way to reduce the number of ports scanned by > this function in windows XP? 
>
> Thanks again for your time,
>
> Doug
>
>
> > > > --------------070808020900080005070500-- > -- From jredman at ergotech.com Tue May 30 15:42:35 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 30 May 2006 15:42:35 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: <447CBC4B.2080206@ergotech.com> Lynn, If I understand your idea correctly, I don't think that this would work well for, say, USB ports since these can be easily added/removed by the end user. Jim lynn at swcp.com wrote: > *IF* the name of the port is supplied, we might want to use the preferences > mechanism (java.util.prefs) where we could have previously saved the info for > the port. We could do a quick check to see that things have not changed > before using it. If things have changed (or never been defined) we would do a > full port scan and save detected ports in the preferences. > > This way if the hardware is not changed, you only pay the time penalty one time. > > just an idea... > Lynn > > > Doug Thistlethwaite said: > >> This is a multi-part message in MIME format. >> --------------070808020900080005070500 >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >> Content-Transfer-Encoding: 7bit >> >> Hello all, >> >> I also notice this pause (not as long however) when I call: >> >> CommPortIdentifier.getPortIdentifier(PortName); >> >> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process. If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it. >> >> Thanks, >> >> Doug >> >> Doug Thistlethwaite wrote: >> >>> Trent, YiQi, and Jim: >>> >>> Thanks to all for the replies and information! I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :) >>> >>> As for more information. First off, this example is being run under >>> windows XP. I am developing test equipment that communicates with a >>> java application via a serial port. I have been using the commapi for >>> several years and have not had a problem. Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port. I am using the ftdi module for prototyping and I discovered >>> that their virtual com port driver was not compatible with the commapi >>> that Sun released. It turns out that it has problems with hardware >>> flow control ( it works on incoming but not outgoing communications). >>> The way I figured this out was by experimenting with the SerialDemo >>> that was included with the Sum commapi. One nice thing about this >>> example is it has the ability to set incoming and outgoing flow >>> control independently. >>> >>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup). >>> >>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are: >>> >>> testRead() : -1, gnu.io.RXTXCommDriver >>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>> >>> This was all initiated by the following call in the programs init routine: >>> >>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>> >>> After looking at this, My guess is that Trent is correct in that the >>> delay is in scanning for ports. I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system. Is there any way to reduce the number of ports scanned by >>> this function in windows XP? >>> >>> Thanks again for your time, >>> >>> Doug >>> >> --------------070808020900080005070500 >> Content-Type: text/html; charset=ISO-8859-1 >> Content-Transfer-Encoding: 7bit >> >> >> >> >> >> >> >> >> Hello all,
>>
>> I also notice this pause (not as long however) when I call:
>>
>>         >  CommPortIdentifier.getPortIdentifier(PortName);
>>
>> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process.  If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it.
>>
>> Thanks,
>>
>> Doug
>>
>> Doug Thistlethwaite wrote: >>
>> >> Trent, YiQi, and Jim:
>>
>> Thanks to all for the replies and information!  I am just back from a >> long weekend and I am now trying to figure out what I was doing! :)
>>
>> As for more information.  First off, this example is being run under >> windows XP.  I am developing test equipment that communicates with a >> java application via a serial port.  I have been using the commapi for >> several years and have not had a problem.  Recently, I have started a >> design modification that will replace the RS232 connection with a USB >> port.  I am using the ftdi module for prototyping and I discovered that >> their virtual com port driver was not compatible with the commapi that >> Sun released.  It turns out that it has problems with hardware flow >> control ( it works on incoming but not outgoing communications).  The >> way I figured this out was by experimenting with the SerialDemo that >> was included with the Sum commapi.  One nice thing about this example >> is it has the ability to set incoming and outgoing flow control >> independently.
>>
>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >> all instances of javax.comm with gnu.io and it compiled and runs >> without a hitch (except for the slow startup).
>>
>> I Paused the JBuilder IDE during this long pause and the last few >> entries in the stack trace are:
>>
>> testRead() : -1, gnu.io.RXTXCommDriver
>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>
>> This was all initiated by the following call in the programs init >> routine:
>>
>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>
>> After looking at this,  My guess is that Trent is correct in that the >> delay is in scanning for ports.  I guess one solution would be to not >> scan for ports, though it would be nice to detect what is available on >> the system.  Is there any way to reduce the number of ports scanned by >> this function in windows XP? 
>>
>> Thanks again for your time,
>>
>> Doug
>>
>>
>> >> >> >> --------------070808020900080005070500-- >> > > > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From yhua537 at cse.unsw.edu.au Tue May 30 18:10:23 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 31 May 2006 10:10:23 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CBC4B.2080206@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: Doug, In the SerialDemo, it allow us to save the parameters into a file, and use it when your program start up. Would this help? YiQi On Tue, 30 May 2006, Jim Redman wrote: > Lynn, > > If I understand your idea correctly, I don't think that this would work > well for, say, USB ports since these can be easily added/removed by the > end user. > > Jim > > lynn at swcp.com wrote: >> *IF* the name of the port is supplied, we might want to use the preferences >> mechanism (java.util.prefs) where we could have previously saved the info for >> the port. We could do a quick check to see that things have not changed >> before using it. If things have changed (or never been defined) we would do a >> full port scan and save detected ports in the preferences. >> >> This way if the hardware is not changed, you only pay the time penalty one time. >> >> just an idea... >> Lynn >> >> >> Doug Thistlethwaite said: >> >>> This is a multi-part message in MIME format. >>> --------------070808020900080005070500 >>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>> Content-Transfer-Encoding: 7bit >>> >>> Hello all, >>> >>> I also notice this pause (not as long however) when I call: >>> >>> CommPortIdentifier.getPortIdentifier(PortName); >>> >>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process. If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it. >>> >>> Thanks, >>> >>> Doug >>> >>> Doug Thistlethwaite wrote: >>> >>>> Trent, YiQi, and Jim: >>>> >>>> Thanks to all for the replies and information! I am just back from a >>>> long weekend and I am now trying to figure out what I was doing! :) >>>> >>>> As for more information. First off, this example is being run under >>>> windows XP. I am developing test equipment that communicates with a >>>> java application via a serial port. I have been using the commapi for >>>> several years and have not had a problem. Recently, I have started a >>>> design modification that will replace the RS232 connection with a USB >>>> port. I am using the ftdi module for prototyping and I discovered >>>> that their virtual com port driver was not compatible with the commapi >>>> that Sun released. It turns out that it has problems with hardware >>>> flow control ( it works on incoming but not outgoing communications). >>>> The way I figured this out was by experimenting with the SerialDemo >>>> that was included with the Sum commapi. One nice thing about this >>>> example is it has the ability to set incoming and outgoing flow >>>> control independently. >>>> >>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>> all instances of javax.comm with gnu.io and it compiled and runs >>>> without a hitch (except for the slow startup). >>>> >>>> I Paused the JBuilder IDE during this long pause and the last few >>>> entries in the stack trace are: >>>> >>>> testRead() : -1, gnu.io.RXTXCommDriver >>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>> >>>> This was all initiated by the following call in the programs init routine: >>>> >>>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>> >>>> After looking at this, My guess is that Trent is correct in that the >>>> delay is in scanning for ports. I guess one solution would be to not >>>> scan for ports, though it would be nice to detect what is available on >>>> the system. Is there any way to reduce the number of ports scanned by >>>> this function in windows XP? >>>> >>>> Thanks again for your time, >>>> >>>> Doug >>>> >>> --------------070808020900080005070500 >>> Content-Type: text/html; charset=ISO-8859-1 >>> Content-Transfer-Encoding: 7bit >>> >>> >>> >>> >>> >>> >>> >>> >>> Hello all,
>>>
>>> I also notice this pause (not as long however) when I call:
>>>
>>>         >>  CommPortIdentifier.getPortIdentifier(PortName);
>>>
>>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process.  If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it.
>>>
>>> Thanks,
>>>
>>> Doug
>>>
>>> Doug Thistlethwaite wrote: >>>
>>> >>> Trent, YiQi, and Jim:
>>>
>>> Thanks to all for the replies and information!  I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :)
>>>
>>> As for more information.  First off, this example is being run under >>> windows XP.  I am developing test equipment that communicates with a >>> java application via a serial port.  I have been using the commapi for >>> several years and have not had a problem.  Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port.  I am using the ftdi module for prototyping and I discovered that >>> their virtual com port driver was not compatible with the commapi that >>> Sun released.  It turns out that it has problems with hardware flow >>> control ( it works on incoming but not outgoing communications).  The >>> way I figured this out was by experimenting with the SerialDemo that >>> was included with the Sum commapi.  One nice thing about this example >>> is it has the ability to set incoming and outgoing flow control >>> independently.
>>>
>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup).
>>>
>>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are:
>>>
>>> testRead() : -1, gnu.io.RXTXCommDriver
>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>
>>> This was all initiated by the following call in the programs init >>> routine:
>>>
>>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>
>>> After looking at this,  My guess is that Trent is correct in that the >>> delay is in scanning for ports.  I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system.  Is there any way to reduce the number of ports scanned by >>> this function in windows XP? 
>>>
>>> Thanks again for your time,
>>>
>>> Doug
>>>
>>>
>>> >>> >>> >>> --------------070808020900080005070500-- >>> >> >> >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From halbleib at rechnerbetriebsgruppe.de Wed May 31 02:06:16 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 10:06:16 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp Message-ID: <447D4E78.30302@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, I getting an error while reloading my app in tomcat. At the first start everything runs well, but if i reload mit webapp by tomcat manager i get the following error. java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader Is there a possibility to unload the native library rxtxSerial.dll? thx for all help! regards tom -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 b8FT80HQ1xlbDLnRecDANCc= =heb1 -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 02:52:17 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 10:52:17 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D4E78.30302@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> Message-ID: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Hello Tom, To the best of my knowledge it is impossible to unload native libraries once loaded into the JVM. The exception you see stems from the fact, that Tomcat creates a new classloader when you "reload" the weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar is loaded from the session class loader. Try to add RXTXComm.jar to your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. Regards, Joachim On 31.05.2006, at 10:06, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 > b8FT80HQ1xlbDLnRecDANCc= > =heb1 > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From halbleib at rechnerbetriebsgruppe.de Wed May 31 03:28:35 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 11:28:35 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Message-ID: <447D61C3.1030807@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Joachim, I'm still not getting it. How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml-file? Perhaps web.xml? Regards, Tom Joachim Buechse schrieb: > Hello Tom, > > To the best of my knowledge it is impossible to unload native > libraries once loaded into the JVM. The exception you see stems from > the fact, that Tomcat creates a new classloader when you "reload" the > weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar > is loaded from the session class loader. Try to add RXTXComm.jar to > your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. > > Regards, > Joachim > > On 31.05.2006, at 10:06, Tom Halbleib wrote: > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL tzNy+/0iIUfkYYgt1+UT1ko= =pkpY -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 04:03:42 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 12:03:42 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D61C3.1030807@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> <447D61C3.1030807@rechnerbetriebsgruppe.de> Message-ID: -Xbootclasspath/a: is a start option to the java vm. Google is your friend in finding how to modfiy it and what it means: tomcat modifying bootclasspath Regards, Joachim On 31.05.2006, at 11:28, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Joachim, > > I'm still not getting it. > How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml- > file? > Perhaps web.xml? > > Regards, > Tom > > Joachim Buechse schrieb: >> Hello Tom, >> >> To the best of my knowledge it is impossible to unload native >> libraries once loaded into the JVM. The exception you see stems from >> the fact, that Tomcat creates a new classloader when you "reload" the >> weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar >> is loaded from the session class loader. Try to add RXTXComm.jar to >> your bootlclasspath (-Xbootclasspath/a:) and the problem should go >> away. >> >> Regards, >> Joachim >> >> On 31.05.2006, at 10:06, Tom Halbleib wrote: >> >> Hi all, >> >> I getting an error while reloading my app in tomcat. At the first >> start >> everything runs well, but if i reload mit webapp by tomcat manager >> i get >> the following error. >> >> java.lang.UnsatisfiedLinkError: Native Library >> C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in >> another classloader thrown while loading gnu.io.RXTXCommDriver >> Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: >> Native >> Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already >> loaded >> in another classloader >> >> >> Is there a possibility to unload the native library rxtxSerial.dll? >> >> thx for all help! >> >> regards >> >> tom > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL > tzNy+/0iIUfkYYgt1+UT1ko= > =pkpY > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From impakt01 at optusnet.com.au Wed May 31 06:55:42 2006 From: impakt01 at optusnet.com.au (Daren) Date: Wed, 31 May 2006 22:55:42 +1000 Subject: [Rxtx] (no subject) Message-ID: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/ade7ad37/attachment-0007.html From doug at dupreeinc.com Wed May 31 10:19:19 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 31 May 2006 09:19:19 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: <447DC207.3070702@dupreeinc.com> I am not sure what you are saying. The Save parameters menu option saves the current settings (baud, data bits, etc.). The long pause (~60 seconds) is when the application first starts (before loading the saved parameters). This does bring up a question, though I hate this type of kludge approach to getting this library to work... What exactly is a PortIdentifier? Is it always the same? If I stored the results from "CommPortIdentifier.getPortIdentifier(PortName);" in a file, could I use this the next time the program is executed? In this case I am using a virtual com port driver to connect to the device through a USB port. Doug YiQi Huang wrote: >Doug, > >In the SerialDemo, it allow us to save the parameters into a file, and use >it when your program start up. Would this help? > >YiQi > >On Tue, 30 May 2006, Jim Redman wrote: > > > >>Lynn, >> >>If I understand your idea correctly, I don't think that this would work >>well for, say, USB ports since these can be easily added/removed by the >>end user. >> >>Jim >> >>lynn at swcp.com wrote: >> >> >>>*IF* the name of the port is supplied, we might want to use the preferences >>>mechanism (java.util.prefs) where we could have previously saved the info for >>>the port. We could do a quick check to see that things have not changed >>>before using it. If things have changed (or never been defined) we would do a >>>full port scan and save detected ports in the preferences. >>> >>>This way if the hardware is not changed, you only pay the time penalty one time. >>> >>>just an idea... >>>Lynn >>> >>> >>>Doug Thistlethwaite said: >>> >>> >>> >>>>This is a multi-part message in MIME format. >>>>--------------070808020900080005070500 >>>>Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>>>Content-Transfer-Encoding: 7bit >>>> >>>>Hello all, >>>> >>>>I also notice this pause (not as long however) when I call: >>>> >>>> CommPortIdentifier.getPortIdentifier(PortName); >>>> >>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process. If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it. >>>> >>>>Thanks, >>>> >>>>Doug >>>> >>>>Doug Thistlethwaite wrote: >>>> >>>> >>>> >>>>>Trent, YiQi, and Jim: >>>>> >>>>>Thanks to all for the replies and information! I am just back from a >>>>>long weekend and I am now trying to figure out what I was doing! :) >>>>> >>>>>As for more information. First off, this example is being run under >>>>>windows XP. I am developing test equipment that communicates with a >>>>>java application via a serial port. I have been using the commapi for >>>>>several years and have not had a problem. Recently, I have started a >>>>>design modification that will replace the RS232 connection with a USB >>>>>port. I am using the ftdi module for prototyping and I discovered >>>>>that their virtual com port driver was not compatible with the commapi >>>>>that Sun released. It turns out that it has problems with hardware >>>>>flow control ( it works on incoming but not outgoing communications). >>>>>The way I figured this out was by experimenting with the SerialDemo >>>>>that was included with the Sum commapi. One nice thing about this >>>>>example is it has the ability to set incoming and outgoing flow >>>>>control independently. >>>>> >>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>>without a hitch (except for the slow startup). >>>>> >>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>>entries in the stack trace are: >>>>> >>>>>testRead() : -1, gnu.io.RXTXCommDriver >>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>>> >>>>>This was all initiated by the following call in the programs init routine: >>>>> >>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>>> >>>>>After looking at this, My guess is that Trent is correct in that the >>>>>delay is in scanning for ports. I guess one solution would be to not >>>>>scan for ports, though it would be nice to detect what is available on >>>>>the system. Is there any way to reduce the number of ports scanned by >>>>>this function in windows XP? >>>>> >>>>>Thanks again for your time, >>>>> >>>>>Doug >>>>> >>>>> >>>>> >>>>--------------070808020900080005070500 >>>>Content-Type: text/html; charset=ISO-8859-1 >>>>Content-Transfer-Encoding: 7bit >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>>Hello all,
>>>>
>>>>I also notice this pause (not as long however) when I call:
>>>>
>>>>        >>>> >>>> >>> CommPortIdentifier.getPortIdentifier(PortName);
>>> >>> >>>>
>>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process.  If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it.
>>>>
>>>>Thanks,
>>>>
>>>>Doug
>>>>
>>>>Doug Thistlethwaite wrote: >>>>
>>>> >>>>Trent, YiQi, and Jim:
>>>>
>>>>Thanks to all for the replies and information!  I am just back from a >>>>long weekend and I am now trying to figure out what I was doing! :)
>>>>
>>>>As for more information.  First off, this example is being run under >>>>windows XP.  I am developing test equipment that communicates with a >>>>java application via a serial port.  I have been using the commapi for >>>>several years and have not had a problem.  Recently, I have started a >>>>design modification that will replace the RS232 connection with a USB >>>>port.  I am using the ftdi module for prototyping and I discovered that >>>>their virtual com port driver was not compatible with the commapi that >>>>Sun released.  It turns out that it has problems with hardware flow >>>>control ( it works on incoming but not outgoing communications).  The >>>>way I figured this out was by experimenting with the SerialDemo that >>>>was included with the Sum commapi.  One nice thing about this example >>>>is it has the ability to set incoming and outgoing flow control >>>>independently.
>>>>
>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>without a hitch (except for the slow startup).
>>>>
>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>entries in the stack trace are:
>>>>
>>>>testRead() : -1, gnu.io.RXTXCommDriver
>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>>
>>>>This was all initiated by the following call in the programs init >>>>routine:
>>>>
>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>>
>>>>After looking at this,  My guess is that Trent is correct in that the >>>>delay is in scanning for ports.  I guess one solution would be to not >>>>scan for ports, though it would be nice to detect what is available on >>>>the system.  Is there any way to reduce the number of ports scanned by >>>>this function in windows XP? 
>>>>
>>>>Thanks again for your time,
>>>>
>>>>Doug
>>>>
>>>>
>>>> >>>> >>>> >>>>--------------070808020900080005070500-- >>>> >>>> >>>> >>> >>> >>> >>-- >>Jim Redman >>(505) 662 5156 x85 >>http://www.ergotech.com >>_______________________________________________ >>Rxtx mailing list >>Rxtx at qbang.org >>http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > >cheers >YiQi Huang >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/61d4d4c9/attachment-0007.html From impakt01 at optusnet.com.au Wed May 31 17:02:54 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 09:02:54 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Message-ID: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Hi all, I downloaded 2.1.7-pre16 and managed to build it and get it going. I made the changes as suggested by Peter Smith in an old post, by adding his code to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. Still not working, it opens the port at 9600 according to portmon.exe . Has anyone managed to get this going at a custom rate? Here is the post I'm referring to: http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 Thanks, Daren ________________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Daren Sent: Wednesday, 31 May 2006 10:56 PM To: rxtx at qbang.org Subject: [Rxtx] (no subject) Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren From tjarvi at qbang.org Wed May 31 21:44:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 May 2006 21:44:01 -0600 (MDT) Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> References: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Message-ID: On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org From impakt01 at optusnet.com.au Wed May 31 22:06:04 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 14:06:04 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: Message-ID: <200606010406.k51464X2010447@mail03.syd.optusnet.com.au> Trent, I have managed to successfully open the port at this speed using Realterm (available on sourceforge). From memory this uses DLPortIO. Using portmon.exe with realterm, even there it says that the port has opened at 1953. I changed termios.c:560 to dcb->BaudRate = 1953 ; and it still opens the port at 9600. Daren -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Thursday, 1 June 2006 1:44 PM To: RXTX Developers and Users Subject: Re: [Rxtx] custom baud rate win32 On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From smontgomery at mediaspansoftware.com Mon May 1 09:52:28 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 11:52:28 -0400 Subject: [Rxtx] RXTX, Java COMM and Windows Server 2003 on x64 experiences? Message-ID: Just wondering if anybody here has had to deploy RXTX or the javax.comm on Windows Server 2003 machines running on x64 (i.e. Xeon EM64T) and would like to relate how things went. From Sun's site, the Supported System Configurations pages give the options for that system: Java 5.0: - 32-bit Java 5.0 running on the OS in the 32-bit mode - 64-bit Java 5.0 running on the OS in the 64-bit native mode Java 1.4.2: - no options listed for EM64T processors, but potentially the standard 32-bit Java 1.4.2 could run on the OS in 32-bit mode? I guess the two main points of failure would be 1) the JVM itself and 2) the jni components. Make that three: there's gotta be hardware vendor driver support for the OS in the various modes, too. Guess I better go look at Keyspan's website... Thanks in advance for any info anyone might be able to provide. From smontgomery at mediaspansoftware.com Mon May 1 10:18:33 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 12:18:33 -0400 Subject: [Rxtx] Mailing list archive out of date? Message-ID: The mailing list archive at: http://mailman.qbang.org/pipermail/rxtx/ only shows emails through the end of March. Is there a new archive somewhere else? Didn't see anything mentioned on the wiki. From p.cain at phasefale.com.au Mon May 1 22:33:09 2006 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 02 May 2006 14:33:09 +1000 Subject: [Rxtx] RXTX and the Linux kernel. Message-ID: <4456E105.5080106@phasefale.com.au> Hi, First off the problem I am having isn't caused by RXTX itself but I'm hoping someone out there may have some knowledge that may help me. Background: I have an application monitoring a control system through a standard PC serial port which I talk to with rxtx-2.0.5. The application runs on RedHat7.3 kernel version 2.4.18 using Java 1.4. This configuration has been in use for several years and has proved to be stable. But it has become necessary for me to upgrade the OS but I'm running into problems with the serial communications. Its not that the comms don't work on the new OS (its never that simple) the comms work for a variable period of time (sometimes several hours) and then just stop, nothing on the data lines and control lines all indicate that data could flow. The new OS is Ubuntu 5.10 running kernel version 2.6.12. I have installed the OS and software on a PC and had it perform ok, then install the new OS and same software on the very same hardware and experienced the problems of them comms stopping. In the new OS I'm using Java5 to run the app but since I have experience the problem I reverted back to Java1.4 which didn't fix the problem. I've moved the app to a different system RedHat FC3 running 2.6.14 had experienced the problem. Not wanting to go through all the thing I have tried but I have established that it seems to be the 2.6 versions of the kernel that seem to be the problem and not an individual distribution of Linux. I should point out that I am using the same jar and library files for each java and OS combination. So I'm just wondering if anyone has had or heard of problems similar to these ? Or perhaps might know of what changed in the Linux serial driver (something I'm having a hard time establishing). I'm starting to run low on ideas of what to try so any help would be much appreciated. -- Peter Cain Senior Programmer Phasefale Pty Ltd From tjarvi at qbang.org Wed May 3 07:31:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 May 2006 07:31:00 -0600 (MDT) Subject: [Rxtx] Re: Concering ircomm and RXTX In-Reply-To: References: Message-ID: On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From legolas.w at gmail.com Wed May 3 08:46:23 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 19:16:23 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <4458C23F.2000003@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From legolas.w at gmail.com Wed May 3 13:10:57 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 23:40:57 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <44590041.80706@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From Lars.Hennig at wow-portal.com Thu May 4 00:39:15 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Thu, 4 May 2006 08:39:15 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: Message-ID: Hi, I could not find any solution. I therefore decided to to my own native implementation. Allthough it only supports the functions I need, it works pretty well now for me. I think the main problem there is the use of a wrong Windows API function and not setting an timeout. Regards, Lars Hennig W?rth Online World GmbH Tel. (0049)7181-258183 Mob. (0049)160-3522889 Fax. (0049)7940-153299 Lars.Hennig at wow-portal.com Gesendet von: rxtx-bounces at qbang.org 09.04.2006 10:42 Bitte antworten zu RXTX Developers and Users An d.herwald at dsh-elektronik.de, RXTX Developers and Users Kopie Thema Re: [Rxtx] USB Serialport - disconnection problems WV Proj./Teilpr.: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/7b39f374/attachment-0008.html From Pawan.Kharbanda at dot.state.co.us Thu May 4 11:00:58 2006 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Thu, 4 May 2006 11:00:58 -0600 Subject: [Rxtx] Dangling Lock Files Message-ID: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Hi, I have been using RXTX API's for the Serial Communication for quite some time now and for some of the devices we are opening and closing the connection every 2 minutes. This works great for few days and then suddenly I start seeing some "Port in Use Exception" and I see that the Lock files are still in the /var/lock folder after manually removing the lock files it works good for few hours and I see the same problem again. Can somebody explain me the scenarios why I am seeing the dangling Lock files? I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise Servers. Thanks Pawan Kharbanda -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/ba0e9261/attachment-0008.html From tjarvi at qbang.org Thu May 4 14:10:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:10:30 -0600 (MDT) Subject: [Rxtx] Dangling Lock Files In-Reply-To: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> References: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Message-ID: On Thu, 4 May 2006, Kharbanda, Pawan wrote: > Hi, > I have been using RXTX API's for the Serial Communication for quite > some time now and for some of the devices we are opening and closing the > connection every 2 minutes. This works great for few days and then > suddenly I start seeing some "Port in Use Exception" and I see that the > Lock files are still in the /var/lock folder after manually removing the > lock files it works good for few hours and I see the same problem again. > Can somebody explain me the scenarios why I am seeing the dangling Lock > files? > > I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise > Servers. Hi Pawan The next time it happens, look in the lockfile. There will be a pid. ps aux |grep 'pid' I think you will see that the application is still running for some reason. RXTX does a kill -0 on the pid to see if its alive. If not, it will remove the lockfile. So I suspect the previous program did not exit as you expected. -- Trent Jarvi tjarvi at qbang.org From Scott.Hughes at dalsemi.com Thu May 4 14:23:11 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 4 May 2006 15:23:11 -0500 Subject: [Rxtx] Wiki instructions... Message-ID: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire demo apps, when I stumbled across this tip on the wiki to add yourself to the uucp group: It may be simpler to just run usermod -G uucp jarvi Taken from: http://rxtx.qbang.org/wiki/index.php/Installation This does not work as advertised. I should have read the man page for usermod before I tried that out. If there are any groups which are not listed after the -G switch, the user is removed from those groups. On Ubuntu, this is bad... I removed myself from the Admin group, which removed my sudo priviledges. Ubuntu has no root account, so I've disabled the only account which could fix it. Anyone know of a good workaround? Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor From tjarvi at qbang.org Thu May 4 14:32:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:32:09 -0600 (MDT) Subject: [Rxtx] Wiki instructions... In-Reply-To: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> Message-ID: On Thu, 4 May 2006, Scott Hughes wrote: > I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire > demo apps, when I stumbled across this tip on the wiki to add yourself to > the uucp group: > > It may be simpler to just run > > usermod -G uucp jarvi > > Taken from: > http://rxtx.qbang.org/wiki/index.php/Installation > > This does not work as advertised. I should have read the man page for > usermod before I tried that out. If there are any groups which are not > listed after the -G switch, the user is removed from those groups. On > Ubuntu, this is bad... I removed myself from the Admin group, which removed > my sudo priviledges. Ubuntu has no root account, so I've disabled the only > account which could fix it. > > Anyone know of a good workaround? > Yikes This will get your permissions back: in grub/lilo/.. pass the following option to the kernel init=/bin/sh You are now root. when it boots, mount -o remount,rw / add yourself to the groups, reboot to get normal init going. Thats about all I can think of without sudo/root. -- Trent Jarvi tjarvi at qbang.org From Gettings at earth.utah.edu Thu May 4 14:41:22 2006 From: Gettings at earth.utah.edu (Paul Gettings) Date: Thu, 4 May 2006 14:41:22 -0600 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <20060504204122.GA6534@earth.utah.edu> When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get messages on stdout from the JVM: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 As the only change was the version of RXTX (from 2.1.6), I am unsure why the messages suddenly appeared. Anyone know how to get rid of them? Thanks. -- 101 USES FOR A DEAD MICROPROCESSOR (23) Dead cat brush From mmester at sps.edu Mon May 1 21:22:28 2006 From: mmester at sps.edu (Michael Mester) Date: Mon, 1 May 2006 23:22:28 -0400 Subject: [Rxtx] Windows PortInUseException Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> I'm trying to get simple serial communication going with RxTx under Windows XP. I can enumerate the ports fine, but I always run into problems when I try to open one. I get a PortInUseException, but the owner application is "Unknown" and the port is never open. I've tried this on several different systems and all of them give the same behavior. The only thing I can thiunk of that might be causing the problem is that fact that I had to put the serial .dll file in system32 instead of the reccommended folder, because it didn't work in the folder the documentation gives. The library loads fine, though, so I'm not sure whether that makes sense, and I don't know how to fix it anyway. Any help is greatly appreciated. Below is the output of the program, right up to the PortInUseException and the NullPointerException it causes (because the serial port object is not instantiated). C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI Starting GPSTalkerGUI... Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 gnu.io.PortInUseException: Unknown Application Exception in thread "main" java.lang.NullPointerException at GPSTalkerGUI.(GPSTalkerGUI.java:102) at GPSTalkerGUI.main(GPSTalkerGUI.java:161) Again, thank you very much for any help you can give. From lshellman at qwest.net Wed May 3 01:38:34 2006 From: lshellman at qwest.net (Lucious Shellman) Date: Wed, 03 May 2006 01:38:34 -0600 Subject: [Rxtx] Help needed: Project using parallel port Message-ID: <1146641914.8337.14.camel@localhost.localdomain> I was looking for a way to access the parallel port on a PC using Java. Searching the Internet, I came across this site (rxtx.org). What I am trying to do is detect logic levels from a TTL logic IC on the parallel port. I am not trying to do classic parallel port communication. I just want to detect whether a line(s) is (are) high or low. I am using Windows 98. Can rxtx be used to do this? If yes, is there a tutorial for using rxtx posted on the Internet that someone can direct me to. If you need more information, feel free to e-mail me. Unfortunately for me, I need the information ASAP. Thanks. lshellman at qwest.net From webmaster at egyhelp.com Wed May 3 18:43:39 2006 From: webmaster at egyhelp.com (Mohamed Samy) Date: Thu, 4 May 2006 02:43:39 +0200 Subject: [Rxtx] RE: Concering ircomm and RXTX In-Reply-To: Message-ID: <20060503184362.SM01044@Geek> Hey, I issue the command "modprobe ircomm-tty" yet no ttyircomm appears, while the ircomm appear by "modprobe ircomm" so forgive me but I am bit lost. Even searching google for the keyword "ttyircomm" only returns 3 matches. So any way I can start the ttyircomm???? Thanks a lot. -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Wednesday, May 03, 2006 3:31 PM To: Mohamed Samy; rxtx at qbang.org Cc: taj at www.linux.org.uk Subject: Re: Concering ircomm and RXTX On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 4 15:49:49 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 15:49:49 -0600 (MDT) Subject: [Rxtx] Windows PortInUseException In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> Message-ID: On Mon, 1 May 2006, Michael Mester wrote: > > I'm trying to get simple serial communication going with RxTx under > Windows XP. I can enumerate the ports fine, but I always run into > problems when I try to open one. I get a PortInUseException, but the > owner application is "Unknown" and the port is never open. I've tried > this on several different systems and all of them give the same > behavior. The only thing I can thiunk of that might be causing the > problem is that fact that I had to put the serial .dll file in system32 > instead of the reccommended folder, because it didn't work in the folder > the documentation gives. The library loads fine, though, so I'm not sure > whether that makes sense, and I don't know how to fix it anyway. Any > help is greatly appreciated. Below is the output of the program, right > up to the PortInUseException and the NullPointerException it causes > (because the serial port object is not instantiated). > > C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI > Starting GPSTalkerGUI... > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > gnu.io.PortInUseException: Unknown Application > Exception in thread "main" java.lang.NullPointerException > at GPSTalkerGUI.(GPSTalkerGUI.java:102) > at GPSTalkerGUI.main(GPSTalkerGUI.java:161) > Perhaps you are trying to open the port twice in your code? rxtx does open the ports, do a timed out read and then close the ports during enumeration. I think the port is being opened fine. The Unknown Application is always reported. On linux, there is some code that finds the actual application but on windows, its always unknown. If the port enumeration is returning the ports you expect, rxtx has opened the port and closed it with success. The port should open. There is also example code in the contrib directory that comes with rxtx source that has examples you can modify to work. -- Trent Jarvi tjarvi at qbang.org From Christian.Klemke at t-online.de Thu May 4 23:37:23 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Fri, 5 May 2006 07:37:23 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu> Message-ID: <004f01c67005$fc72fee0$016a10ac@NB600> Hi Paul, I was wondering about the same question some days ago and took a look at the source files. Unfortunately, I found that you can only get rid of that messages by altering and recompiling the Java code. There is a final static boolean variable called "devel" in the file "RXTXCommDriver.java" which is set to "true". This constellation causes the output after the native libraries have been loaded. No mechanism exists to suppress them otherwise :-(. Trent, does that mean that 2.1.7 is still officially a "development" version ? When will this value be changed to "false" by default ? With 2.1.8 ? It would be nice to provide a means to suppress such messages besides that static flag (maybe by setting a property called "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The output can indeed by annoying, especially when used with console applications, where the message potentially appears "in the middle" of your own output. Another possibility would be not to use System.out directly, but instead some PrintStream field which is initially set to System.out but can programatically be changed. That would allow for any kind of redirection or suppression by implementing appropriate user-defined PrintStream subclasses and making RXTX use that stream. What do you think ? Best regards, Christian ----- Original Message ----- From: "Paul Gettings" To: Sent: Thursday, May 04, 2006 10:41 PM Subject: [Rxtx] RXTX causing stdout messages > When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get > messages on stdout from the JVM: > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > As the only change was the version of RXTX (from 2.1.6), I am unsure > why the messages suddenly appeared. Anyone know how to get rid of > them? > > Thanks. > > -- > 101 USES FOR A DEAD MICROPROCESSOR > (23) Dead cat brush > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri May 5 06:09:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 06:09:46 -0600 (MDT) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <004f01c67005$fc72fee0$016a10ac@NB600> References: <20060504204122.GA6534@earth.utah.edu> <004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: On Fri, 5 May 2006, Christian Klemke wrote: > Hi Paul, > > I was wondering about the same question some days ago and took a look at the > source files. Unfortunately, I found that you can only get rid of that > messages by altering and recompiling the Java code. There is a final static > boolean variable called "devel" in the file "RXTXCommDriver.java" which is > set to "true". This constellation causes the output after the native > libraries have been loaded. No mechanism exists to suppress them otherwise > :-(. > > Trent, does that mean that 2.1.7 is still officially a "development" version > ? When will this value be changed to "false" by default ? With 2.1.8 ? It > would be nice to provide a means to suppress such messages besides that > static flag (maybe by setting a property called > "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The > output can indeed by annoying, especially when used with console > applications, where the message potentially appears "in the middle" of your > own output. Another possibility would be not to use System.out directly, but > instead some PrintStream field which is initially set to System.out but can > programatically be changed. That would allow for any kind of redirection or > suppression by implementing appropriate user-defined PrintStream subclasses > and making RXTX use that stream. What do you think ? > A patch for using properties would be accepted I'm sure. The reason the default is to display the message is not related to the development state of rxtx anymore. The problem is that people first using rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. The message prevents a great deal of email thats easily explained by the message. I question if we should support rxtx 2.0 at all anymore. If you post a patch in bugzilla, we'll put it into CVS this weekend. we'll be going through and doing such things anyhow. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri May 5 13:23:56 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 13:23:56 -0600 (MDT) Subject: [Rxtx] How to read from RxTx parallel port in Win XP In-Reply-To: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> References: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> Message-ID: On Thu, 27 Apr 2006, Worsley, Bob (Development Engineer) wrote: > I'm sorry if this is a dumb question, but I didn't find the answer in > the archives. > > I'm using the RxTx binaries for Windows on a reasonably current notebook > PC running Windows XP. I can send stuff to a printer on the parallel > port (LPT1), but I can't get anything back. > > I wrote a class that has the methods listed below. I write some data to > the printer with the "write" method and then try to read a response > using the "read" method, but I never get any data. I'd greatly > appreciate any help you can give! > > Bob Worsley > bobwoyid2 at yahoo.com > > > > > private ParallelPort parallelPort = null; > private RXTXCommDriver parallelPortDriver = null; > > > public boolean initialize() throws IOException { > if (parallelPort != null) { > return false; // Already initialized > } > > // Create the parallel port; > parallelPortDriver = new RXTXCommDriver(); > parallelPort = > (ParallelPort)parallelPortDriver.getCommPort(address, > CommPortIdentifier.PORT_PARALLEL); > > // Set the parallel port parameters. > try { > parallelPort.enableReceiveTimeout(READ_TIMEOUT); > parallelPort.disableReceiveFraming(); > parallelPort.disableReceiveThreshold(); > //parallelPort.setMode(mode); !!!!errors > } catch (UnsupportedCommOperationException e) { > throw (new IOException("Parallel port with address '" + > address > + "' cannot be configured as specified")); > } > > return true; > } > > > > public void write(final byte[] bytes) throws IOException { > initialize(); > while (busyReading) { > Thread.yield(); > } > busyWriting = true; > if (bytes.length < 1) { > return; > } > OutputStream outputStream = parallelPort.getOutputStream(); > outputStream.write(bytes); > outputStream.flush(); > outputStream.close(); > Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); > busyWriting = false; > } > > > public byte[] read() throws IOException { > > // Read up to MAX_BYTES bytes. > initialize(); > while (busyWriting) { > Thread.yield(); > } > busyReading = true; > byte[] buff = new byte[MAX_BYTES_READ]; > InputStream inputStream = parallelPort.getInputStream(); > // This read blocks until input data is available > int bytesRead = inputStream.read(buff); > inputStream.close(); > // If no data read, create empty array > if (bytesRead == -1) { > bytesRead = 0; > } > byte[] deviceBytes = new byte[bytesRead]; > System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); > if (bytesRead > 0) { > Debug.p("PPIOP.read - got data: '" + new > String(deviceBytes) + "'"); > } > busyReading = false; > return deviceBytes; > } > Hi Bob I've only used rxtx to test a hello world page printing but there are others that have used it. PPIOP? hmm what is this? :) The rxtx parallel support is behind the serial support but should be OK. As you note, the setting of modes is not supported. rxtx uses what is provided when the port is open. Are your asserting the pin for the printer being online? I suspect what often happens is people try to just use the data pins but the C API rxtx uses wants the printer to be online. There should be some posts relating to this in the rxtx mail-list archive. Some APIs are probably reading and writing from the port address (also suggested in your code as something you are looking at). RXTX currently uses a higher level C/C++ API for port access. This can still work if the API thinks the 'printer' is there. -- Trent Jarvi tjarvi at qbang.org From agrodellic at gmail.com Sat May 6 08:39:40 2006 From: agrodellic at gmail.com (Leigh Stewart) Date: Sat, 6 May 2006 10:39:40 -0400 Subject: [Rxtx] sun commapi 3 Message-ID: I think I read here: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html that rxtx-2.0 is basically fracked for now? Does anyone know of a workaround? ie can i somehow get an older version of sun's comm api and use that (not easy to find)? i mean 2.0 must be working for someone...how is it being tested. 2.1 isnt working for me....im getting nasty native exceptions etc, which is why im so set on 2.0... any ideas? From tjarvi at qbang.org Sun May 7 15:40:27 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 7 May 2006 15:40:27 -0600 (MDT) Subject: [Rxtx] sun commapi 3 In-Reply-To: References: Message-ID: On Sat, 6 May 2006, Leigh Stewart wrote: > > 2.1 isnt working for me....im getting nasty native exceptions etc, > which is why im so set on 2.0... any ideas? > Hi Leigh What native exceptions are you seeing? Which OS? The native code is almost identical between rxtx 2.0 and 2.1. Only the names have been changed to protect the inocent. :) ie: javax_comm_... vs gnu_io_... So the odds are very likely that even if you do find commapi 2.0 and get it installed, you will run into the same error. It would be better to just find and fix the problem. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Mon May 8 10:47:20 2006 From: mail at willicon.de (WILLICon) Date: Mon, 08 May 2006 18:47:20 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 Message-ID: <445F7618.3070303@willicon.de> Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/ef37e8ec/attachment-0008.html From tjarvi at qbang.org Mon May 8 16:14:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 May 2006 16:14:51 -0600 (MDT) Subject: [Rxtx] Screenshot of Application using RXTX (fwd) Message-ID: Just though someone may end up searching for 0x0D and 0x0A. Here are the details from his system. SuSE Linux 10.0 (x86_64) Kernel 2.6.13-15.8 j2se 1.4.2_11 (i586) Sun: comm3.0_u1 rxtx: rxtx-2.1-7 ---------- Forwarded message ---------- Date: Sat, 6 May 2006 20:01:46 +0200 From: Michael Poppitz To: taj at www.linux.org.uk Subject: Screenshot of Application using RXTX Hi Trent, the rxtx package works like a charm. Sun's package seemed to replace all 0x0D with 0x0A in received data on my Linux box, which is really annoying when transfering binary data. But rxtx came and saved the day - and turned out to be a lot more convenient as it does not require a configuration file. I use it for connecting to a home made logic analyzer. (http://www.sump.org/projects/analyzer/) Thanks for your great job, Michael -------------- next part -------------- A non-text attachment was scrubbed... Name: la_client.png Type: image/png Size: 16592 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/45494fbb/la_client-0008.png From tjarvi at qbang.org Tue May 9 14:56:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 May 2006 14:56:05 -0600 (MDT) Subject: [Rxtx] RXTX javax.comm: which one to install? In-Reply-To: <20060509161742.43547.qmail@web53814.mail.yahoo.com> References: <20060509161742.43547.qmail@web53814.mail.yahoo.com> Message-ID: On Tue, 9 May 2006, Adenilson Cavalcanti wrote: > Dear Trent Jarvi > > I'm trying to write a small Java app running in linux that interfaces with a device connected to serial port. > > I do have some questions about RXTX and javax.comm state of affairs, since I'm new to Java programming (used to program in plain old C writting to devices using termios and open/write/read syscalls, but this is another story). > > I ask you the favor to clarify this issues (if possible...): > > a) Sun offers to download a file (comm3.0_u1_PUTAUNIXVERSION.zip) which does contain .so files. Does it work out of box? > > b) Case negative, its there that we should use 'librxtx*.so' provided by your site? > > c) Sun's comm3 API version does work with which version of rxtx? > > I already searched google and read documentation available in rxtx site ("Java Comm Serial API How-to") but still have this issues unsolved. Any help will be appreciated. > > Best regards > > Adenilson Hi Adenilson, RXTX does not currently support javax.comm in Sun's CommAPI 3.0. I would recommend using package gnu.io provided by rxtx 2.1. -- Trent Jarvi tjarvi at qbang.org From chris.develder at intec.ugent.be Wed May 10 08:45:40 2006 From: chris.develder at intec.ugent.be (Chris Develder) Date: Wed, 10 May 2006 16:45:40 +0200 Subject: [Rxtx] rxtx troubles on ARM Message-ID: <4461FC94.6040909@intec.ugent.be> Hi all, Sorry to bother you, but I don't seem to get RXTX working on an ARM processor (xscale ixp 425, big endian). I managed to crosscompile the rxtx libs and moved it over to the ARM. Using jamvm (which is the only open source java VM we got working on the ARM), I get the following error result when running SimpleRead from Sun's javax.comm examples (commapi\examples\Simple\SimpleRead) -- see bottom of mail for complete output: "java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver" However, output shows that the RXTXCommDriver code is accessible (cf. debug and devel output of lib versions). So it doesn't seem to be a missing lib/jar issue. The error happens before RXTXCommDriver.initialize() is called, since the first line there is System.out.println("RXTXCommDriver:initialize()"); Any ideas? Cheers, Chris ---------------------------- [root at xxx(ttyp1) /work/cdvelder/xscale/test]# jamvm -Djava.library.path=/work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/jre/lib/arm -classpath /work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/lib/ext/RXTXcomm.jar:./comm.jar:. SimpleRead RXTXCommDriver {} Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTXCommDriver: Jar version = RXTX-2.1-7 native lib Version = RXTX-2.1-7 java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver gnu/io/RXTXCommDriver at javax.comm.CommPortIdentifier.loadDriver (CommPortIdentifier.java:239) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:109) at SimpleRead.main (Unknown Source) java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive (Native Method) at com.sun.comm.Portmapping.registerCommPorts (Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase (Portmapping.java:100) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:138) at SimpleRead.main (Unknown Source) From joachim at buechse.de Fri May 12 00:44:48 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 08:44:48 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) Message-ID: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Good day, I guess that only a selected few (hi Trent) will be able to answer this question, but the answer might be interesting for anyone trying to debug or understand the code. Apparently the MonitorThread is started and stopped in RXTXPort.addEventListener and RXTXPort.removeEventListener. This would indicate that (originally?) the MonitorThread is only required when there is an EventListener. However the MonitorThread is also started in the RXTXPort constructor, which could mean that RXTX won't work at all if it isn't there. It seems to me, that if anyone would add an event listener and later on remove it, he could potentially wreak the port. Because the second action would kill the MonitorThread. For the moment I am only trying to understand the role of and idea behind the MonitorThread. But of course there is a deeper reason thor my question: If the MonitorThread needs to exist anyway, it could be the thread that cleans up the port (ie calls nativeClose) - this would eliminate (a further) problem I am seeing with some USB drivers on Mac OSX. (Close blocks (after releasing the tty, but still) in the USB driver if the device is "not responding"). Greetings, Joachim From tjarvi at qbang.org Fri May 12 07:10:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 12 May 2006 07:10:59 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Fri, 12 May 2006, Joachim Buechse wrote: > Good day, > > I guess that only a selected few (hi Trent) will be able to answer > this question, but the answer might be interesting for anyone trying > to debug or understand the code. > > Apparently the MonitorThread is started and stopped in > RXTXPort.addEventListener and RXTXPort.removeEventListener. This > would indicate that (originally?) the MonitorThread is only required > when there is an EventListener. However the MonitorThread is also > started in the RXTXPort constructor, which could mean that RXTX won't > work at all if it isn't there. > > It seems to me, that if anyone would add an event listener and later > on remove it, he could potentially wreak the port. Because the second > action would kill the MonitorThread. > > > For the moment I am only trying to understand the role of and idea > behind the MonitorThread. But of course there is a deeper reason thor > my question: > > If the MonitorThread needs to exist anyway, it could be the thread > that cleans up the port (ie calls nativeClose) - this would eliminate > (a further) problem I am seeing with some USB drivers on Mac OSX. > (Close blocks (after releasing the tty, but still) in the USB driver > if the device is "not responding"). > Hi Jaochim Before commapi, rxtx did not support events. You could read, write and change port settings. The MonitorThread was added as an afterthought to support commapi events. So the way things are now his historical spaghetti not a well devised plan. It is my opinion that the MonitorThread should exist as long as the port is open. The odd starting of the thread in the constructor and addEventListener was just to get past the obvious problem of people using the port without adding listeners. -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Fri May 12 07:59:50 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 15:59:50 +0200 Subject: [Rxtx] MonitorThread -> ChangeRequest In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: <2B1E508C-8CEE-4AB7-914D-E7BA25C871A2@buechse.de> In this case I suggest removing the starting/stopping of MonitorThread in addEventListener / removeEventListener. This should not affect existing projects. On 12.05.2006, at 15:10, Trent Jarvi wrote: > It is my opinion that the MonitorThread should exist as long as the > port > is open. The odd starting of the thread in the constructor and > addEventListener was just to get past the obvious problem of people > using > the port without adding listeners. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Fri May 12 11:43:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 19:43:21 +0200 Subject: [Rxtx] Spring Cleaning - some suggestions Message-ID: The current implementation of RXTX contains quite a lot of code that will break if it is used from several threads (especially on a multi processor machine). I think it would be nice to clean this up. I suggest the following changes (which keep the current semantics and should not influence existing projects in a negative way): - InterruptedException will never be ignored or reset - read methods will be protected with a Monitor - write methods will be protected with a (separate) Monitor - close() sets the read and write monitors into a "closed" state which will lead to IOExceptions for any following call to RXTXPort.read/write. - close() will wait a finite amount of time (maybe 500ms) for the release of the read and write monitors after that, it will trigger the closing of the file descriptor to abort any pending read or write. - close() will not call close(file_desc). Instead it will "interrupt" (ie set a flag and then, pthread_kill(ABRT)) the MonitorThread, the MonitorThread will call close(file_desc). - the monitors are properly released in a finally block the try of which starts directly after obtaining the monitor. - finally will not call close(file_desc) it will only "interrupt" the MonitorThread (see above) - the native-code (esp read) does not use SA_RESTART but checks Thread.interrupted() when it receives a SIGNAL (ie system call returns with EINTR or other signalling method). The read/write monitors will be allocated from a factory whose mode can be set to fast/normal/advanced. In fast-mode it will create "non thread safe, non synchronized" pseudo-monitors. In default mode, the monitors will store the owning thread. In "advanced" mode setting the monitors into closed state will "interrupt()" threads which are blocked in a native read/write. {Reasoning close behaviour: Calling close on a file descriptor in Windows unblocks any read() or write() on the same file descriptor with an error. On Solaris < 2.7 and MacOS X however the close() will/ can block - until the read or write have finished:-(( Even the JDK people have trouble with this. I dont know how Linux reacts in this case. The best practice for BSD/Solaris is to send a signal to the thread which will usually unblock the read/write with an EINTR - this however is not guarenteed as it also depends on the device driver. So the only resolution that will certainly not block the thread calling RXTXPort.close() (which will often enough be the AWT event dispatcher or the VM finalizer thread) is to call close(fd) from another thread.} {Reasoning read behaviour: It is rather uncommon to receive a signal while reading or writing - it will happen, but checking Thread.interrupted() when it happens will not degrade performance. The checking of Thread.interrupted() can be handled by returning to Java and potententially reentering into the native code if the thread was not interrupted or by calling back into the VM from the native code. On top of this, many functions like read(byte[]) or read(byte [], int, int) are allowed to return less than the requested amount of data. Only int read() is a bit more tricky. } [Trent: From the code I can tell, that you experimented quite a bit with signals. Do you know if the Java Thread.interrupt() triggers a unix signal on Linux/Solaris? If so, which one?? References: - http://java.sun.com/docs/hotspot/VMOptions.html - http://www.hp.com/products1/unix/java/infolibrary/prog_guide/ signals.html ] On OS X (hotspot client jdk-1.4.2) I did not see any signal propagated to the SELECT of the event_loop/MonitorThread (ie no EINTR) when I call monThread.interrupt(). This is a pitty, but thats the way it is. I simply assume this is true for most system calls. How to handle this? Of course it would be possible to install/ deinstall a specific signal handler before/after every native read and to natively send an ABRT signal if RXTXPort.close is called. A more elegant solution might be to have an additional "signaling" socket which is always included in the SELECT. Or the simplest solution: cap the timeout of the select to 500 ms (the loop around it exists already) after every timeout check the Thread.interrupted() flag. From a performance perspective this should be completely invisible... On the other hand, all write() calls need to be preceeded by a SELECT as well, to avoid running into a blocking write. Best regards, Joachim From lyon at docjava.com Sat May 13 05:54:52 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 13 May 2006 07:54:52 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Dmitry suggests that we acquire an implementation of a serial port reference, use it, then release it (i.e., check it back in). Joachim says that making serial ports thread friendly might be a good idea. This is a good idea. The design pattern that is close to this idea is the "Object Pool Design Pattern". # Object Pool Manage the reuse of objects for a type of object that is expensive to create or only a limited number of a kind of object can be created. It has been described at: http://www.developer.com/java/ent/article.php/626171 and in Marks' book, Patterns in Java, Volume 1. However, the Object Pool is intended to pool objects so that each object is just like every other object. The intent of the Parametric Singleton is to enable others to access the same resource at the same time (as long as the same parameters were used in construction). It sounds like we need a NEW Design Pattern (Oh no, Doug is doing it again!). Yes friends, you got me on a role (roll) :) If you like design patterns, you can thank me later. If you don't like design patterns, blame Dmitry, it was his idea ;) And Dave, thanks for the feedback on Singleton abuse. It has led me to change the way I think about application contexts, which we will see, below. We need (drum roll please): The Parametric Object Pool Design Pattern (POP) By Douglas A. Lyon ABSTRACT The goal of the Parametric Singleton design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values, in a given context. In comparison, the goal of the POP design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values and that only one reference to the class is checked out at a time, in a given context. A context is a namespace for holding identifiers during execution. In Java, A context can be changed in any of several ways. For example, creation of a new class loader, the deserialization of an old POP or the creation of a new process all create a new namespace. The POP Design Pattern combines the Parametric Singleton Design Pattern with the check out mechanism of the Object Pool Design Pattern. This enables unique creation of instances of a class. These instances are cached in a table. When a clients asks for an instance with these parameters, the cache is checked. If the instance is not in the cache it is created. If the instance is available, the clients checks out the instance. A reference is left to the clients that checked out the instance. The POP has the role of creating objects uniquely, from parameters. It also has the role of keeping track of which clients has checked out a given object. This is just like a library keeping track of who borrowed a book. If a resource is left unavailable in a system, a deadlock can occur. Deadlock debugging is facilitated by mapping a resource to the clients that have checked it out. We apply our POP Design Pattern to the retrieval of serial ports. The goal of our system is to make sure that serial ports are checked out to only one client at a time, and that they be checked back in when the client is done. The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. Users are discouraged from calling this the Parametric Object Oriented Pool (POOP). Introduction The intent of the POP Design Pattern is to ensure that a class has only one instance for a given set of parameter values. It also provides a point of access that is global to a given context. The POP uses the Singleton Design Pattern to ensure that there is only one POP, in the given context. The POP DP is responsible for checking out a reference to a given instance, and keeping track of that instance. The instance is responsible for sharing that instance. POP requires that users of the DP implement an interface that enables a recall facility. Thus, if there is a contention for a consumed resource, the deadlock can be resolved in an orderly fashion. Motivation A system cannot tolerate multiple instances of some classes with identical parameters used by different instances at the same time. For example, you cannot have two instances use the same serial port, at the same time. You cannot have two instances that are trying to listen to the same socket connection. You cannot have two instances writing to the same file structure at the same time. Further, once a serial port is checked out by a client, it is assigned to the client. This is like the spin-lock service provided by the operating system, only in the application layer. Naturally, deadlock will occur if a resource is not released, therefore the client of the resource is tracked. Recalling a resource is required for the POP DP by virtue of the implementation of an interface. The policy on how to break a deadlock (by honoring the recall) is application specific. As the operating system is often thought of as the arbiter of consumed resources (i.e., tape drives, serial ports, etc.) we frequently leave it to an operating system implementation to resolve these contention issues. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on naming conventions (which are not well standardized). The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. The POP Design Pattern can take on the role of the peer method mapper that homogenizes the API for different operating environments. That is, it can wrapper the different locking mechanisms used in different operating systems. POP that is responsible for keeping track of the instances created and the client that has checked them out. The POP Design Pattern is implemented using the Singleton Design Pattern. In Java, the POP implementation is declared final, so that it cannot be subclassed. The class also has a private constructor, so that other classes cannot instance it. The new design pattern is called the POP design pattern and it provides a way to check out and create instances with given parameters. Applicability Use the POP Design Pattern when: 1. There must be exactly one instance of a class with the given parameters in a given context. 2. The instances must be accessible to clients from a well-known access point. 3. The instances are reusable. 4. Only one client can check out an instance at a time. Structure Insert UML diagram here. Participants The POP Clients that need instances 1. The POP defines an instance upon request from a client, if, and only if, the instance does not already exist. 2. The POP returns the instance to the client. 3. The POP is responsible for creating unique instances from given parameters. 4. The POP is responsible to recalling instances from clients. Collaborations Clients obtain a reference to a POP instance only through the singleton design pattern. If the POP instance is left in an improper state (e.g., the serial port was left open) it is NOT the role of the POP to close the IO port. However, the POP can be requested to get the instance released. Nor is it the role of the POP Design Pattern to open the port. That role is delegate to some other part of the system. Further, it is the role of the POP Design Pattern to check out resources. However, it is still possible to have, multiple threads that have multiple references to the same resource at the same time. Checkout and resource requests are MUTEX locked (i.e., synchronized). Consequences The POP Design Pattern has several benefits: 1. Controlled access to parametrically defined instances. Since the POP encapsulates its instances, there is some limited control over how and when clients access it. 2. Reduced name space. The POP pattern avoids global variables that store instances created from the same parameter. Implementation Here are implementation issues to consider when using the POP pattern: 1. Unique mapping of parameters. The POP pattern requires that there be a mean to isomorphically map the parameter space into the instance space and back again. 2. Ensure unique instances. The POP pattern makes unique instances from parameters, and it does so only once. 3. Cache instances for fast retrieval. The POP must be able to look up instances, given some set of parameters, and do so from some data structure. That is, there must be enough space to hold references to all the instances the program will need. Also, a mechanism is needed to look up and retrieve the instances quickly enough to satisfy the clients. Sample Code To be written....any volunteers? Thanks! - Doug >I don't think I get it > >On Mar 22, 2006, at 9:36 AM, David Garnier wrote: >>Using the singleton pattern in this case is >>just convenient for the programmer. Problems >>arises >>pretty quickly, especially if you attempt to unit-test your classes. > > >so you're saying that something isn't so good >because you can not test it in the convenient >way? >if that's true, I'm totally disagree >change your test, debug whatever, but if >software is efficient at runtime, works fine and >only problem is some unit test >(which is some kind of framework for testing) >then dump that unit test , dump that unit >framework and make something appropriate to the >software >you're testing > >so if Douglas want to use singletons, what's the problem? >and what do you mean by abusing of singleton usage? > >of course singleton doesn't prevent concurrent >access to the resource across the processes >unless >you're using some OS facility to prevent it, besides >singleton as it was introduced is relevant only >and only inside of the same process >otherwise it's not singleton it's something else >(let's say network singleton: so you have remote >invocation facility >and some factory method that return object created by that facility) > >I don't have any problem with using any kind of singletons. > Parametric Singleton idea (if I understand it >right) could be easily implemented in the >following way: >use a map >populate map with instances of some class and key is your parameter >(you can use lazy population too) > >if somebody ask the key check the value if it's null so resource is taken >if somebody returns the resource put it back to the map > >public synchronized static Object getSomeResource(Object parameter); >public synchronized static void returnResource(Object parameter); > >getSomeResource (inside of the same process) could return null in 2 cases >1. if somebody (from other thread for example) already took that resource >2. if OS API said that resource corresponded to >that parameter (serial port with parameter = 1 >(port #)) >is locked and unavailable; >I'm not sure that in case of serial ports we >even need those Parametric Singletons >(unless lock checking is a very expensive operation) >just ask the OS about availability of that >resource and if it's available give it away >and then OS will lock it and therefore in next >time somebody ask it just answer that resource >is locked >and return null > >for example system has 2 serial ports available >so I ask getResource("tty"); >or I ask getResource("Bluetooth-Modem"); > >and if OS is ok you can give tty or Bluetooth-Modem or both > >no need for any additional pattern I think > >back to the problem >mac os x doesn't recognize locking via files, so >it handles locking via some API >an instance of the singleton in each process >should recognize that resource is locked >(by using that API) that's all >we don't have to make things more complicate >then they are just because there is some nice >design pattern or nice unit test framework or whatever >keep things simple, make them work fast, don't introduce middle layers >unless you have really good reason to do so > >of course I could be entirely wrong, so sorry about that in advance > >thanks > > >Dmitry Markman > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx >Good day, > >I guess that only a selected few (hi Trent) will be able to answer? >this question, but the answer might be interesting for anyone trying? >to debug or understand the code. > >Apparently the MonitorThread is started and stopped in? >RXTXPort.addEventListener and RXTXPort.removeEventListener. This? >would indicate that (originally?) the MonitorThread is only required? >when there is an EventListener. However the MonitorThread is also? >started in the RXTXPort constructor, which could mean that RXTX won't? >work at all if it isn't there. > >It seems to me, that if anyone would add an event listener and later? >on remove it, he could potentially wreak the port. Because the second? >action would kill the MonitorThread. > > >For the moment I am only trying to understand the role of and idea? >behind the MonitorThread. But of course there is a deeper reason thor? >my question: > >If the MonitorThread needs to exist anyway, it could be the thread? >that cleans up the port (ie calls nativeClose) - this would eliminate? >(a further) problem I am seeing with some USB drivers on Mac OSX.? >(Close blocks (after releasing the tty, but still) in the USB driver? >if the device is "not responding"). > >Greetings, >Joachim > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Sat May 13 10:07:37 2006 From: joachim at buechse.de (Joachim Buechse) Date: Sat, 13 May 2006 18:07:37 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Douglas, Looking at the current code, leaves me with the feeling, that there is a lot to do. Defining an API that wraps javax.comm to provide what you describe is certainly possible, but I wonder how much benefit it will actually provide. Personally I think the API defined by javax.comm "request/lock" a port with: cp= new CommunicationPort(identifier) "release" a port with: cp.close(); works quite nice for 99% of the applications. In my experience, the most efficient and elegant implementation is to wrap a port/socket/.. into a business object which declares the remote operations that are possible. Ie "uploadFile", "waitForPrompt", "getSerialNumber", "sendContact", "executeCommand", etc Those methods are then either synchronized or guarded by a monitor. I do not see how your design pattern applied to the port resource would help implementing this. [details start, skip if you agree to the above] When I talked about "thread-safe" I didn't mean several independent "sessions" accessing the port concurrently. I think this is a very rare usage. I believe the most common use case for serial ports today is the control of an external device from a PC running a GUI based application. To implement a clean Swing/AWT-GUI one needs to pass any action that can block to a "worker" thread (else the GUI blocks, the application appears dead). While it is possible to use own prespawned thread that will accept Runnables which operate on the port, this is not very elegant. It is more common to spawn a new thread for every action triggered by the user. Additionally the ABORT of a running operation is often implemented via a port.close() delegated to a different thread. - During the lifetime of a port, it will usually be accessed from several different threads. Instance variables need to be set/read in synchronized regions to guarantee a correct operation based on the Java memory model. - Synchronizing the access is usually handled on the application level (synchronizing the reads/writes is usually useless from the applications view because it is not a transaction mechanism). [details end] I am very open to learn about other scenarios where your proposed design pattern applied to the port resource is beneficial to the application implementor. Best regards, Joachim On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > Dmitry suggests that we acquire an implementation of > a serial port reference, use it, then release it (i.e., check it > back in). > > Joachim says that making serial ports thread friendly might be a > good idea. > > This is a good idea. The design pattern that is close to this idea > is the "Object Pool Design Pattern". > # Object Pool From jredman at ergotech.com Sun May 14 14:28:24 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 14:28:24 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers Message-ID: <446792E8.4000506@ergotech.com> Does anyone know of any work to make RXTX work with Ethernet (telent) Terminal Servers? If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? We've used RXTX with upwards of 100 virtual COM ports on Windows and it works well. Linux is more problematic. It would be good to have an OS independent solution to accesses remote Ethernet serial ports. Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From legolas.w at gmail.com Sun May 14 14:26:34 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:56:34 +0430 Subject: [Rxtx] does any one have a working sample of RXTX and LPT port Message-ID: <4467927A.4000008@gmail.com> Hi Thank you for reading my post does any one has a working sample for RXTX and LPT port ? Thanks From legolas.w at gmail.com Sun May 14 14:27:29 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:57:29 +0430 Subject: [Rxtx] does RXTX support Trigerr on parallel port? Message-ID: <446792B1.4040905@gmail.com> Hi does RXTX support trigger on LPT port ? if so , how i can use it ? Thanks From tjarvi at qbang.org Sun May 14 17:40:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 17:40:59 -0600 (MDT) Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: <446792E8.4000506@ergotech.com> References: <446792E8.4000506@ergotech.com> Message-ID: On Sun, 14 May 2006, Jim Redman wrote: > Does anyone know of any work to make RXTX work with Ethernet (telent) > Terminal Servers? > > If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 > Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? > Hi Jim It appears the author of NVTCom has decided to release the library into the public domain. Integration with rxtx is possible but it would be best to contact the author and find out what his intent is. I would suggest contacting the author with a proposal of what you would like to do and take it from there. We could 'take' public domain software but its better to show respect to the authors and respect their wishes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:10:23 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:10:23 -0600 (MDT) Subject: [Rxtx] does any one have a working sample of RXTX and LPT port In-Reply-To: <4467927A.4000008@gmail.com> References: <4467927A.4000008@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > Thank you for reading my post > does any one has a working sample for RXTX and LPT port ? > Thanks Hi Legolas LPT port support in rxtx is spotty. That means some people have sent in patches for what they do and it works well for them. The original code was not very good. It may have been 3 hours work :/ To get started, Sun has some demo programs with their commapi. With rxtx 2.1 you can change their code from using javax.com to gnu.io and it -should- work. But if it does not you can post here and on bugzilla. There has been more interest lately off the list and maybe there will be enough community resources to get what you need going. If you do get a sample program together, we would gladly put it in the contrib directory so the next person can get things going faster. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:12:12 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:12:12 -0600 (MDT) Subject: [Rxtx] does RXTX support Trigerr on parallel port? In-Reply-To: <446792B1.4040905@gmail.com> References: <446792B1.4040905@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > does RXTX support trigger on LPT port ? > if so , how i can use it ? > Hi Legolas As mentioned in the previous post, rxtx parallel support is not very mature. But if you can point to something that describes the trigger feature, we can probably make sure its there and give a quick code example. -- Trent Jarvi tjarvi at qbang.org From jredman at ergotech.com Sun May 14 22:22:48 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 22:22:48 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: References: <446792E8.4000506@ergotech.com> Message-ID: <44680218.4080008@ergotech.com> Trent, Trent Jarvi wrote: > On Sun, 14 May 2006, Jim Redman wrote: > >> Does anyone know of any work to make RXTX work with Ethernet (telent) >> Terminal Servers? >> >> If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 >> Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? >> > > Hi Jim > > It appears the author of NVTCom has decided to release the library into > the public domain. Integration with rxtx is possible but it would be best > to contact the author and find out what his intent is. > > I would suggest contacting the author with a proposal of what you would > like to do and take it from there. We could 'take' public domain software > but its better to show respect to the authors and respect their wishes. > I sent Marco(?), the author of the library, a note before asking the list - I'll let you know the response. If anyone is already working on it, or has an interest and more time and energy than me, I'd hate to duplicate the efforts. If no one is, and no one objects, maybe I'll see what I can do. Jim > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From Christian.Klemke at t-online.de Mon May 15 02:23:06 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Mon, 15 May 2006 10:23:06 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu><004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: <008a01c677f8$cae18590$02fea8c0@NB600> Hi Trent, Hi Paul, I finally found some time to create a simple patch to enable the optional suppression of version output to the console. It is based on a new system property called "gnu.io.rxtx.NoVersionOutput" which can by set to "true" if necessary. I had some problems accessing CVS, therefore I downloaded the rxtx-2.1-7r2 source archive from ftp.qbang.org (which is linked on the rxtx.org download page) and worked with that release. Please find my proposed patch in the attachment ! Regards, Christian ----- Original Message ----- From: "Trent Jarvi" To: "RXTX Developers and Users" Cc: ""Paul Gettings"" Sent: Friday, May 05, 2006 2:09 PM Subject: Re: [Rxtx] RXTX causing stdout messages > On Fri, 5 May 2006, Christian Klemke wrote: > >> Hi Paul, >> >> I was wondering about the same question some days ago and took a look at >> the >> source files. Unfortunately, I found that you can only get rid of that >> messages by altering and recompiling the Java code. There is a final >> static >> boolean variable called "devel" in the file "RXTXCommDriver.java" which >> is >> set to "true". This constellation causes the output after the native >> libraries have been loaded. No mechanism exists to suppress them >> otherwise >> :-(. >> >> Trent, does that mean that 2.1.7 is still officially a "development" >> version >> ? When will this value be changed to "false" by default ? With 2.1.8 ? It >> would be nice to provide a means to suppress such messages besides that >> static flag (maybe by setting a property called >> "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The >> output can indeed by annoying, especially when used with console >> applications, where the message potentially appears "in the middle" of >> your >> own output. Another possibility would be not to use System.out directly, >> but >> instead some PrintStream field which is initially set to System.out but >> can >> programatically be changed. That would allow for any kind of redirection >> or >> suppression by implementing appropriate user-defined PrintStream >> subclasses >> and making RXTX use that stream. What do you think ? >> > > A patch for using properties would be accepted I'm sure. > > The reason the default is to display the message is not related to the > development state of rxtx anymore. The problem is that people first using > rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. > The message prevents a great deal of email thats easily explained by the > message. > > I question if we should support rxtx 2.0 at all anymore. > > If you post a patch in bugzilla, we'll put it into CVS this weekend. > we'll be going through and doing such things anyhow. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_version_output_patch.diff Type: application/octet-stream Size: 991 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060515/3173c2b6/rxtx_version_output_patch-0008.obj From lyon at docjava.com Mon May 15 06:06:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 May 2006 08:06:21 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Joachim makes several good points. Let me see if I can address some of them below: >Hello Douglas, > >Looking at the current code, leaves me with the feeling, that there? >is a lot to do. Yes! >Defining an API that wraps javax.comm to provide what? >you describe is certainly possible, but I wonder how much benefit it? >will actually provide. > >Personally I think the API defined by javax.comm > >"request/lock" a port with: > cp= new CommunicationPort(identifier) >"release" a port with: > cp.close(); > >works quite nice for 99% of the applications. I don't know what percentage of applications turn off locking, the way that I do in my version of the RXTX lib. I do know that this is not safe practice. I also know that it was motivated by the multi-platform nature of my code and that this was the only way I could make things work, at the time. Java does not appear to have a cross-platform standard for locking resources on various platforms. Each OS appears to have its own standard. The question of who breaks deadlocks and how this is done remains open, as this is not an easy question to resolve. Let me continue, below: > >In my experience, the most efficient and elegant implementation is to? >wrap a port/socket/.. into a business object which declares the? >remote operations that are possible. Ie "uploadFile",? >"waitForPrompt", "getSerialNumber", "sendContact", "executeCommand",? >etc Those methods are then either synchronized or guarded by a? >monitor. I do not see how your design pattern applied to the port? >resource would help implementing this. I have no problem with high-level wrappers that are application specific. That is a very good idea, but orthogonal with respect to the issue of deadlocks. More below: > >[details start, skip if you agree to the above] >When I talked about "thread-safe" I didn't mean several independent? >"sessions" accessing the port concurrently. I think this is a very? >rare usage. That is probably why turning locking off works so well! On the other hand, it is not safe and I shouldn't do it. >I believe the most common use case for serial ports today? >is the control of an external device from a PC running a GUI based? >application. To implement a clean Swing/AWT-GUI one needs to pass any? >action that can block to a "worker" thread (else the GUI blocks, the? >application appears dead). While it is possible to use own prespawned? >thread that will accept Runnables which operate on the port, this is? >not very elegant. It is more common to spawn a new thread for every? >action triggered by the user. Additionally the ABORT of a running? >operation is often implemented via a port.close() delegated to a? >different thread. Here lies the heart of serial port concern. An application opens a serial port and then dies. The application is restarted and finds the port locked. How do we clear the lock? Must the application's user reside in the UUCP group? Must installers of the serial port add users to the UUCP group? Should locking be handled at a high-level of abstraction in an operating system independent way? Should the implementation of the locking mechanism be translated into an API that is dependent on the OS convention? Suppose that we restrict the discussion to serial ports. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on inconsistent naming conventions. Hence my feeling that we need to mirror what is done in other API's; we need a locking toolkit that references peer methods, IMHO. >From the Java programming point of view, the locking API is portable across different platforms, but has, as its implementation, a native peer method that uses the conventions of the underlying OS. This enables portable resource locking (in theory!). Consider, for example: org.apache.commons.transaction.locking with: Interface LockManager at: http://jakarta.apache.org/commons/transaction/apidocs/org/apache/commons/transaction/locking/LockManager.html Or, more recently: java.util.concurrent.locks Interface Lock based on Doug Lea's code: http://kickjava.com/src/EDU/oswego/cs/dl/util/concurrent/ReadWriteLock.java.htm Should we incorporate a clean, portable design into serial port use, one that is consistent with current locking APIs? Basically, a comm port is a resource and resources are typically controlled by managers. Thus, I suggest that we make use of a CommPortManager to help control and centralize serial port usage. The question of how this is done remains open, IMHO, but using core API's like: java.util.concurrent.locks might not be amiss. High-level methods (getAllPorts, getAllSerialPorts, getAllParallelPorts, etc...) might be welcome additions. Basic questions like, "what if a port is in use?" remain open, hence my proposal for the new design pattern. Isn't it the CommPortManager's role to break the deadlock? Cheers! - Doug > >- During the lifetime of a port, it will usually be accessed from? >several different threads. Instance variables need to be set/read in? >synchronized regions to guarantee a correct operation based on the? >Java memory model. >- Synchronizing the access is usually handled on the application? >level (synchronizing the reads/writes is usually useless from the? >applications view because it is not a transaction mechanism). >[details end] > >I am very open to learn about other scenarios where your proposed? >design pattern applied to the port resource is beneficial to the? >application implementor. > >Best regards, >Joachim > >On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > >> Dmitry suggests that we acquire an implementation of >> a serial port reference, use it, then release it (i.e., check it? >> back in). >> > > Joachim says that making serial ports thread friendly might be a? >> good idea. >> >> This is a good idea. The design pattern that is close to this idea >> is the "Object Pool Design Pattern". >> # Object Pool > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Mon May 15 06:58:19 2006 From: joachim at buechse.de (Joachim Buechse) Date: Mon, 15 May 2006 14:58:19 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Doug, I agree fully, that locking of the system resource should be abstracted from the user (programmer). Currently this is already the case, but I agree it might be nice to extract the code into a separate class, which uses platform dependent providers to do its job. What I described in my email was not targeted at allocating the system resource, but at handling an already allocated system resource inside the framework. I agree that it may be possible to combine the two - however, I would suggest to do this in phase2. I can contribute a work over of RXTXPort.java which implements clean internal locking and proper close behavior (which I would call phase 1). I could do this this week. However I strongly believe that there is little sense in trying to do this as a series of patches. It will be closer to a rewrite than to a patch. I have already provided a number of suggested patches via Bugzilla, but this is quite inconvenient (for me). My working copy diverges more and more from the master and hence it gets more and more annoying to provide self contained patches. Best regards, Joachim From tjarvi at qbang.org Mon May 15 08:27:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 May 2006 08:27:51 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Mon, 15 May 2006, Joachim Buechse wrote: > Hello Doug, > > I agree fully, that locking of the system resource should be > abstracted from the user (programmer). Currently this is already the > case, but I agree it might be nice to extract the code into a > separate class, which uses platform dependent providers to do its job. > > What I described in my email was not targeted at allocating the > system resource, but at handling an already allocated system resource > inside the framework. I agree that it may be possible to combine the > two - however, I would suggest to do this in phase2. > > I can contribute a work over of RXTXPort.java which implements clean > internal locking and proper close behavior (which I would call phase > 1). I could do this this week. > > However I strongly believe that there is little sense in trying to do > this as a series of patches. It will be closer to a rewrite than to a > patch. I have already provided a number of suggested patches via > Bugzilla, but this is quite inconvenient (for me). My working copy > diverges more and more from the master and hence it gets more and > more annoying to provide self contained patches. > For methodical testing purposes (which does go on) the incremental patches are better. I'm lagging behind in bugzilla but thats soon to change (this week). It has just been rather chaotic up until now. I moved, purchased a house, and jumped into the fire of a feature freeze timeframe at a new job. btw, we see the Solaris close issues on 2.8 also. 9 and 10 are fine. I'll work towards making those test results public and allow others to run new rxtx code through them. We had the OK at one point but setting up the environment is involved. It isn't just a collection of java classes. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Tue May 16 02:01:47 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:01:47 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] Message-ID: <446986EB.209@willicon.de> Hi, any ideas for my problem? Hans -------- Original-Nachricht -------- Betreff: [Rxtx] Problem under Mac OSX 10.3.9 Datum: Mon, 08 May 2006 18:47:20 +0200 Von: WILLICon Antwort an: RXTX Developers and Users An: RXTX Developers and Users Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/b0741c2b/attachment-0008.html From joachim at buechse.de Tue May 16 02:15:08 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 10:15:08 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: Hello Hans, I am using RXTX on OS X for my own project. I do not see the problem you describe. I had some troubles installing it because the current version uses lock files which is non-standard on OS X. I have created a patched version which I currently use. This version does not need to modify user groups and hence does not need an installer. I just pop it in the application directory. If you send me a link where I can download your OSX installer, I will have a quick look. Regards, Joachim On 16.05.2006, at 10:01, WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we > have some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + > spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + > spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always > the value "false". > I can only get the status, while I open the port and catch the > exception. > > Any ideas? > > Hans > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail at willicon.de Tue May 16 02:26:53 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:26:53 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: References: <446986EB.209@willicon.de> Message-ID: <44698CCD.7050709@willicon.de> Joachim, tanks for the answer. I'll send You a mail. Hans Joachim Buechse schrieb: > Hello Hans, > > I am using RXTX on OS X for my own project. I do not see the problem > you describe. > > I had some troubles installing it because the current version uses > lock files which is non-standard on OS X. I have created a patched > version which I currently use. This version does not need to modify > user groups and hence does not need an installer. I just pop it in > the application directory. If you send me a link where I can download > your OSX installer, I will have a quick look. > > Regards, > Joachim > > On 16.05.2006, at 10:01, WILLICon wrote: > > >> Hi, >> >> any ideas for my problem? >> >> Hans >> >> -------- Original-Nachricht -------- >> Betreff: [Rxtx] Problem under Mac OSX 10.3.9 >> Datum: Mon, 08 May 2006 18:47:20 +0200 >> Von: WILLICon >> Antwort an: RXTX Developers and Users >> An: RXTX Developers and Users >> >> >> Hi, >> >> I use for RXTX for communicate with CyclingComputers. >> >> It works good under Win32, Sloaris and Linux but with Mac OSX we >> have some problems. >> >> My users install the Mac OSX serial lib from the actual binary. >> >> After starting the program, they get this error message: >> >> java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while >> loading gnu.io.RXTXCommDriver >> >> Remember, this error comes only under Mac OSX. >> >> That is the code for the error: >> >> Enumeration portList = CommPortIdentifier.getPortIdentifiers(); >> spInUse = getBundleStr("serialPortInUse"); >> spFree = getBundleStr("serialPortFree"); >> while (portList.hasMoreElements()) { >> CommPortIdentifier portId = (CommPortIdentifier) >> portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (osName != null && osName.startsWith("mac")) { >> if (!portId.getName().startsWith("dev/cu.")) { >> continue; >> } >> } >> if (portId.isCurrentlyOwned()) { >> serialPortNames.add(portId.getName() + " - " + >> spInUse); >> } >> else { >> serialPortNames.add(portId.getName() + " - " + >> spFree); >> } >> } >> } >> if (serialPortNames.size() == 0) { >> serialPortNames.add(getBundleStr("serialPortNotFound")); >> } >> >> BTW: The methode isCurrentlyOwned() is not working. I get always >> the value "false". >> I can only get the status, while I open the port and catch the >> exception. >> >> Any ideas? >> >> Hans >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/948333be/attachment-0008.html From jredman at ergotech.com Tue May 16 07:35:52 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 16 May 2006 07:35:52 -0600 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: <4469D538.6070408@ergotech.com> Hans, I have no direct insight, but would note that what you have is a "NoClassDefFoundError" not a "ClassNotFoundException". So the class javax/comm/CommDriver is found, but one of its dependencies is missing. NoClassDefFoundError are a bigger problem to resolve because you get no indication of the real problem. Jim WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we have > some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > * spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always the > value "false". > I can only get the status, while I open the port and catch the exception. > > Any ideas? > > Hans > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.de Tue May 16 08:01:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 16:01:21 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 In-Reply-To: <4469AFC3.6000002@willicon.de> References: <44698EBC.8000008@willicon.de> <8C5680C4-E2BA-42FF-B221-36E1124FA6A4@buechse.de> <4469AFC3.6000002@willicon.de> Message-ID: <9825A602-D6ED-4C28-BF33-9A7C984FACD5@buechse.de> Hallo Hans, you include RXTX 2.17 in your "bikeXexperience.jar" (2.17 uses Interfaces from gnu.io.* not javax.comm.*). Now inspect your error log closely: The class gnu.io.RXTXCommDriver tries to load javax.comm.CommDriver: this is only the case for RXTX 2.07. I assume, that the user has installed Version 2.07 into one of the java.ext.dirs . The VM always tries to load classes from the "system" path first. The current Mac installer distributed with RXTX in fact installs RXTXcomm.jar and librxtxSerial.jnilib into /Library/Java/Extensions. (I wrote some time ago that I consider this as a bad idea because of potential version conflicts-> thanks for delivering the example). For 2.07 it does so without installing the javax.comm classes it seems. I would recommend that you instruct your users to install version 2.17 only. Until RXTX is changed to use TIOCEXCL instead of lock files, you can hardly avoid the installer, as the user needs to be added to a special group and a lockfile directory needs be created. More precisely you are waiting for: http://bugzilla.qbang.org/show_bug.cgi?id=50 [RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL)] Regards, Joachim -------------- next part -------------- A non-text attachment was scrubbed... Name: log.tiff Type: image/tiff Size: 38394 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/e3e52128/log-0008.tiff -------------- next part -------------- > > Ich verwende RXTX 2.17. Das orginal RXTXcomm.jar ist in > CyclingDataManager.jar enthalten. > From tjarvi at qbang.org Wed May 17 23:18:15 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 May 2006 23:18:15 -0600 (MDT) Subject: [Rxtx] update Message-ID: So we have several patches and these have stacked up. I'd like to thank everyone for being patient. Tests for the most intrusive patches look good so far. I still have to get some bits together on my end but it looks like we can catch everything up in CVS this week. I'll try to post a normal list of what went in by whom with links Saturday. But I'm not seeing anything that raises flags yet. I also think I'll be able to submit a patch for nonstandard baud rates. I have to confirm w32 but I think its going to be a one line fix. I don't know if its bugzilla or people tinkering with patch files before submitting but patches are not applying cleanly. So the patches have to be done by hand. This may make things difficult for people hoping to add other patches on top. I'm trying to make that go well but ... -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Thu May 18 02:23:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 May 2006 10:23:47 +0200 Subject: [Rxtx] update In-Reply-To: References: Message-ID: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Hello Trent, in fact I tinkered with the patches (never used this mechanism before, usually I "communicate" via cvs) ... so sorry for any trouble you had applying them. Basicly I edited the patches to make them self contained. Having the tests run with different speeds on different platforms, may well be an effect of caching. I have seen quite interesting propagation delays for the closing flag on my PowerPC system, which makes me doubt, that the propagation of output_buffer_empty_flag works as it should. Maybe the communication mechanism between the two threads should be replaced by something like pthread_cond_*. Could you describe which problems you see on Solaris/SPARC? I'd be interested to see if they exist on OS X (PowerPC) as well... As you seem to work on the stuff at the moment I would like to suggest the following additions (it looks more than it is, I posted some context to make clear where to apply the change). See the comments in braces for what was changed Greetings, Joachim (1) The end of the drain loop could be: --- report("drain_loop: received EINTR in tcdrain\n"); --- (added "in tcdrain" to make debug output clearer) (2) The start of the drain loop should be: --- for(i=0;;i++) { report_verbose("drain_loop: looping\n"); #if defined(__sun__) /* FIXME: No time to test on all OS's for production */ if( eis->eventloop_interrupted ) { goto end; } if (usleep(5000)) { report("drain_loop: received EINTR"); } #else if (usleep(1000000)) { report("drain_loop: received EINTR"); } #endif /* __sun__ */ --- (added a check for "eis->eventloop_interrupted" before the sleep) (3) The end of interrupt_event_loop could (and maybe should) be: --- #if !defined(TIOCSERGETLSR) && !defined(WIN32) /* make sure that the drainloop unblocks from tcdrain */ pthread_kill(index->drain_tid, SIGABRT); /* TODO use wait/join/SIGCHLD/?? instead of sleep? */ usleep(50 * 1000); /* Under normal conditions, SIGABRT will unblock tcdrain. However a non-responding USB device combined with an unclean driver may still block. This is very ugly because it may block the call to close indefinetly. */ if (index->closing != 1) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); index->closing = 1; } #endif report("interruptEventLoop: interrupted\n"); --- (added some comments and pthread_cancel for resisting drain thread) On 18.05.2006, at 07:18, Trent Jarvi wrote: > > So we have several patches and these have stacked up. I'd like to > thank > everyone for being patient. > > Tests for the most intrusive patches look good so far. I still > have to > get some bits together on my end but it looks like we can catch > everything > up in CVS this week. > > I'll try to post a normal list of what went in by whom with links > Saturday. But I'm not seeing anything that raises flags yet. I also > think I'll be able to submit a patch for nonstandard baud rates. > I have > to confirm w32 but I think its going to be a one line fix. > > I don't know if its bugzilla or people tinkering with patch files > before > submitting but patches are not applying cleanly. So the patches > have to > be done by hand. This may make things difficult for people hoping > to add > other patches on top. I'm trying to make that go well but ... > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu May 18 22:28:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 18 May 2006 22:28:00 -0600 (MDT) Subject: [Rxtx] update In-Reply-To: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> References: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Message-ID: On Thu, 18 May 2006, Joachim Buechse wrote: > Hello Trent, > > in fact I tinkered with the patches (never used this mechanism > before, usually I "communicate" via cvs) ... so sorry for any trouble > you had applying them. Basicly I edited the patches to make them self > contained. I think we are close to moving towards that. > > Having the tests run with different speeds on different platforms, > may well be an effect of caching. I have seen quite interesting > propagation delays for the closing flag on my PowerPC system, which > makes me doubt, that the propagation of output_buffer_empty_flag > works as it should. Maybe the communication mechanism between the two > threads should be replaced by something like pthread_cond_*. Could > you describe which problems you see on Solaris/SPARC? I'd be > interested to see if they exist on OS X (PowerPC) as well... This is interesting. I have seen problems with output buffer empty in applications that require it. I'm trying to get a bug list and or test results open for everyone to see but that may take time. But missed output buffer events ... yep. With Sparc, we have seen a few things. One was a kernel race condition that went away when we reimaged and updated 2.8. RXTX was hanging on close, top showed no cpu use but there was 2 second delays just typing on console. The other is our tests now take ~4 times longer on Solaris. Someone is looking at timing just open, close, read, write, ... to see if they can find where the slowdown is. This happened after solaris 2.8. I'll try to share more when/if there is something interesting. This may well not be solvable in userland. > > As you seem to work on the stuff at the moment I would like to > suggest the following additions (it looks more than it is, I posted > some context to make clear where to apply the change). See the > comments in braces for what was changed I'll take a look. This could all come together Saturday but I also have an event to attend that day. I may not wrap this up until Sunday. -- Trent Jarvi tjarvi at qbang.org From andrewlord at internode.on.net Sun May 21 20:10:02 2006 From: andrewlord at internode.on.net (Andrew Lord) Date: Mon, 22 May 2006 11:40:02 +0930 Subject: [Rxtx] Kernel include files do not match kernel Message-ID: <200605221140.03271.andrewlord@internode.on.net> Hi, I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel 2.6.12-18 with the command: ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include However I get the message: ## checking java.version 1.5.0_06 ## checking os.version 2.6.12-18mdk ## ## WARNING: Kernel include files do not match the current kernel ## ## configure: creating ./config.status etc. Is there a problem with the way I'm specifying the 'include' directory ? If not, how else can I specify the correct directory for the include files please ? Cheers, Andrew From tjarvi at qbang.org Sun May 21 20:31:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 May 2006 20:31:31 -0600 (MDT) Subject: [Rxtx] Kernel include files do not match kernel In-Reply-To: <200605221140.03271.andrewlord@internode.on.net> References: <200605221140.03271.andrewlord@internode.on.net> Message-ID: On Mon, 22 May 2006, Andrew Lord wrote: > Hi, > > I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel > 2.6.12-18 with the command: > > ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk > CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include > > However I get the message: > > ## checking java.version 1.5.0_06 > ## checking os.version 2.6.12-18mdk > ## > ## WARNING: Kernel include files do not match the current kernel > ## > ## configure: creating ./config.status > etc. > > Is there a problem with the way I'm specifying the 'include' directory ? If > not, how else can I specify the correct directory for the include files > please ? > Hi Andrew I'm fairly sure your --with-kernel option does nothing. The CPPFLAGS should do what you want. Maybe put an #error message in /usr/src/linux.../incude/linux/version.h But I don't recall a recent problem with version missmatches. It should work. Distros will even ship include files that don't match versions exactly. In theory it should never matter for users. I used to compile new kernels by hand and really didnt have a distro. I didnt have a seperate package of kernel headers for users (myself). When changing a gateway from linux 1.2.12 to 2.1.77, I would worry about such messages. So if you are doing something that weird, the message may be of use to you. If you just see the message on a distro you installed, it is more than likely harmless. -- Trent Jarvi tjarvi at qbang.org From mrogers at spro.net Mon May 22 14:45:39 2006 From: mrogers at spro.net (Mike Rogers) Date: Mon, 22 May 2006 14:45:39 -0600 Subject: [Rxtx] Sun's CommAPI -- think May? Message-ID: <447222F3.9040302@spro.net> Hi, Any word from Sun about progress towards fixing the Java CommAPI v3 "incompatibilities" so RXTX 2.0 can operate within the framework's namespace (javax.comm)? I recall mention of a May time frame. Thanks, Mike From paul.klissner at sun.com Mon May 22 15:09:27 2006 From: paul.klissner at sun.com (Paul Klissner) Date: Mon, 22 May 2006 14:09:27 -0700 Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <447222F3.9040302@spro.net> References: <447222F3.9040302@spro.net> Message-ID: <44722887.8080308@sun.com> Mike Rogers wrote: > Hi, > > Any word from Sun about progress towards fixing the Java CommAPI v3 > "incompatibilities" so RXTX 2.0 can operate within the framework's > namespace (javax.comm)? I recall mention of a May time frame. > > Thanks, > > Mike > We've had a lot of work come in. This hasn't been the only priority. I'm running behind the plan in addressing this, but will be looking at it again soon. Rather than state a new, I'll just say it is in progress, and not off the table. I'll get this fixed as soon as I can. Good timing for asking as we just started discussing javax.comm plans today, and I'll have some cycles to work on it soon. Paul From yhua537 at cse.unsw.edu.au Mon May 22 16:03:05 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Tue, 23 May 2006 08:03:05 +1000 (EST) Subject: [Rxtx] install rxtx in XP Message-ID: Hi Guys, I am new to serial port programming, and have no experience on programming java in xp, but my project require me to builld a communication link between xp and a UART device. Most of the information in the web site seems for linux only. including the commands such as export and chmod. How do I install rxtx in xp? cheers YiQi Huang From mark at mdsh.com Tue May 23 01:24:20 2006 From: mark at mdsh.com (Mark Himsley) Date: Tue, 23 May 2006 08:24:20 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off , it includes DLLs for Windows and the JAR for Java. Follow the Windows instructions in the INSTALL. ie RXTXcomm.jar goes in \jre\lib\ext (under java) rxtxSerial.dll goes in \jre\bin So, assuming a fairly standard Java install, copy RXTXcomm.jar into C:\Program Files\Java\jre1.5.0_06\lib\ext and copy rxtxSerial.dll into C:\Program Files\Java\jre1.5.0_06\bin Yes, it really is that simple. On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > I am new to serial port programming, and have no experience on > programming java in xp, but my project require me to builld a > communication link between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang -- Mark Himsley From joachim at buechse.de Tue May 23 02:51:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 23 May 2006 10:51:47 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) Unless it is absolutely required you should NOT install RXTX in your global Java Runtime Environment. This will for sure create versioning conflicts - if not now, than in the future, if not on your system than at your clients. Instead put the dll in your application directory and include the RXTXcomm.jar in your classpath. This is much safer and not a bit more complicated. Regards, Joachim On 23.05.2006, at 09:24, Mark Himsley wrote: > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR > for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > >> I am new to serial port programming, and have no experience on >> programming java in xp, but my project require me to builld a >> communication link between xp and a UART device. >> >> Most of the information in the web site seems for linux only. >> including >> the commands such as export and chmod. How do I install rxtx in xp? >> >> cheers >> YiQi Huang > > > > -- > Mark Himsley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tod at todbot.com Tue May 23 03:12:22 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 02:12:22 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I totally agree: do not contaminate the Java installation. I put all the RXTX files in a directory and then change my java invocation to be: % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* Alternatively, use Launch4J to create a double-clickable application and keep the RXTX libraries in the directory of the application. -=tod On May 23, 2006, at 1:51 AM, Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > >> Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off >> , it includes DLLs for Windows and the JAR >> for Java. >> >> Follow the Windows instructions in the INSTALL. >> >> ie >> >> RXTXcomm.jar goes in \jre\lib\ext (under java) >> rxtxSerial.dll goes in \jre\bin >> >> So, assuming a fairly standard Java install, copy RXTXcomm.jar into >> C:\Program Files\Java\jre1.5.0_06\lib\ext >> and copy rxtxSerial.dll into >> C:\Program Files\Java\jre1.5.0_06\bin >> >> Yes, it really is that simple. >> >> >> >> On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: >> >>> I am new to serial port programming, and have no experience on >>> programming java in xp, but my project require me to builld a >>> communication link between xp and a UART device. >>> >>> Most of the information in the web site seems for linux only. >>> including >>> the commands such as export and chmod. How do I install rxtx in xp? >>> >>> cheers >>> YiQi Huang >> >> >> >> -- >> Mark Himsley >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From smontgomery at mediaspansoftware.com Tue May 23 08:46:53 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Tue, 23 May 2006 10:46:53 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: Message-ID: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Joachim and Tod mentioned how to keep the files RXTX requires on Windows XP out of the Java installations - thanks gentlemen! Are there similar suggestions for an RXTX install on OS X? The current "canonical" OS X installation instructions "contaminate the Java installation", to use Tod's words. Our app will run fine under 1.4.2 and 5.0 on OS X, and a lot of users will have both. We've already been burned by the recent switch from 1.4.2 to 5.0 as the platform default. Any suggestions welcomed. From tod at todbot.com Tue May 23 13:27:55 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 12:27:55 -0700 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <9BA0F670-A862-42E7-BB2C-130D775ABDF9@todbot.com> Hi Sean, It depends on how you build and deploy your code. If you're using shell scripts, you can do something like this: #!/bin/sh # pick one JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/ Commands/java #JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/ Commands/java $JAVA -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* That both picks which VM to use and uses the RXTX in the directory called 'rxtxlib'. If you want your shell script to be clever, you could test for the existence of the different 'java' executables and go from there (maybe even use different jar files). I am almost positive all OS X systems with Java 1.5 are guaranteed to also have Java 1.4.2. If you're using Jar Builder or XCode, you can specify which JVM to use and add the extra args in the Info.plist file. The paths specified in the 'java' invocation then are based off of the $JAVAROOT variable that the JavaApplicationStub sets for you. For my app, I've have been compiling two sets of jars, one compiled with 1.4.2 and one with 1.5, but they both run under 1.5. So I have a similar shell script that chooses a different 'javac' depending on the need. -=tod On May 23, 2006, at 7:46 AM, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From yhua537 at cse.unsw.edu.au Tue May 23 11:09:37 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 03:09:37 +1000 (EST) Subject: [Rxtx] install rxtx in XP (Mark Himsley, Joachim Buechse, Tod E. Kurt> In-Reply-To: References: Message-ID: > Message: 8 > Date: Tue, 23 May 2006 08:03:05 +1000 (EST) > From: YiQi Huang > Subject: [Rxtx] install rxtx in XP > To: rxtx at qbang.org > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > Hi Guys, > > I am new to serial port programming, and have no experience on programming > java in xp, but my project require me to builld a communication link > between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang > > > ------------------------------ > > Message: 9 > Date: Tue, 23 May 2006 08:24:20 +0100 > From: Mark Himsley > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=us-ascii; format=flowed > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > ------------------------------ > > Message: 10 > Date: Tue, 23 May 2006 10:51:47 +0200 > From: Joachim Buechse > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > > ------------------------------ > > Message: 11 > Date: Tue, 23 May 2006 02:12:22 -0700 > From: "Tod E. Kurt" > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I totally agree: do not contaminate the Java installation. > > I put all the RXTX files in a directory and then change my java > invocation to be: > > % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* > > Alternatively, use Launch4J to create a double-clickable application > and keep the RXTX libraries in the directory of the application. > > -=tod > > Hi, Thanks guys, I don't know if this is the correct way to reply your mecessage, if wrong, please point out. Thank you for Mark to give the detail instructions and Joachim to point out the cons ot installing in the java directory, and specially thanks for Tod to give the instrection in detail. Sorry to ask another stupid question: I have followed Tod's instruction. Now I think i am ready to start hacking. But where is the RXTX API documentation? Is it the same as using normal java comm API? btw, where could i find some examples to start with? Thanks very much cheers YiQi Huang From tjarvi at qbang.org Tue May 23 16:09:32 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 May 2006 16:09:32 -0600 (MDT) Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <44722887.8080308@sun.com> References: <447222F3.9040302@spro.net> <44722887.8080308@sun.com> Message-ID: > Good timing for asking as we just started discussing javax.comm plans > today, and I'll have some cycles to work on it soon. Hi Paul I assume you mean Sun is discussing plans concerning its own internal actions and there is no community involvment at this point. -- Trent Jarvi tjarvi at qbang.org From yhua537 at cse.unsw.edu.au Tue May 23 22:50:01 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 14:50:01 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } From mmester at sps.edu Tue May 23 22:58:21 2006 From: mmester at sps.edu (Michael Mester) Date: Wed, 24 May 2006 00:58:21 -0400 Subject: [Rxtx] install rxtx in XP References: Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below -----Original Message----- From: rxtx-bounces at qbang.org on behalf of YiQi Huang Sent: Wed 5/24/2006 12:50 AM To: RXTX Developers and Users Subject: Re: [Rxtx] install rxtx in XP Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3950 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060523/b36d0c63/attachment-0008.bin From yhua537 at cse.unsw.edu.au Tue May 23 23:05:50 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 15:05:50 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: Yes, Michael you are right, it should be semicolons, But it still can't find the correct library. On Wed, 24 May 2006, Michael Mester wrote: > I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below > > > -----Original Message----- > From: rxtx-bounces at qbang.org on behalf of YiQi Huang > Sent: Wed 5/24/2006 12:50 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] install rxtx in XP > > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > cheers YiQi Huang From tod at todbot.com Wed May 24 00:01:57 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 23:01:57 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Yes, sorry, classpath entries are semicolon-separated on Windows and colon-separated on everything else. Your example code below is importing the wrong set of classes. It should not "import javax.comm.*", instead it should "import gnu.io.*". When I make that change, your example program compiles. The "javax.comm" package is the one released by Sun, the "gnu.io" package is the RXTX one. You might've seen some discussion that the two will be merged or become compatible, but that hasn't happened yet. -=tod On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > > Yes, Michael you are right, it should be semicolons, But it still > can't > find the correct library. > > On Wed, 24 May 2006, Michael Mester wrote: > >> I believe the entries in the classpath need to be seperated with >> semicolons, not a colon as you have in your command below >> >> >> -----Original Message----- >> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >> Sent: Wed 5/24/2006 12:50 AM >> To: RXTX Developers and Users >> Subject: Re: [Rxtx] install rxtx in XP >> >> Hi, >> >> Sorry guys.I follow Tod's instruction, and here is what i did: >> >> put >> RXTXcomm.jar, >> rxtxParallel.dll, >> rxtxSerial.dll >> in >> C:\RXTX_files >> >> and I got a SimpleRead class attached below, compile it with : >> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >> it still saying "cannot find symbol". >> >> Is there anything I did wrong? Do I need the comm.jar from Sun? >> >> Thanks & regards >> YiQi Huang >> >> >> //////////////////////////////////////////////////////// >> // SimpleRead.java >> //////////////////////////////////////////////////////// >> >> import java.io.*; >> import java.util.*; >> import javax.comm.*; >> >> public class SimpleRead >> implements Runnable, SerialPortEventListener { >> static CommPortIdentifier portId; >> static Enumeration portList; >> InputStream inputStream; >> SerialPort serialPort; >> Thread readThread; >> public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == >> CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals("COM1")) { >> //if (portId.getName().equals("/dev/term/a")) { >> SimpleRead reader = new SimpleRead(); >> } >> } >> } >> } >> public SimpleRead() { >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", >> 2000); >> } catch (PortInUseException e) {} >> try { >> inputStream = serialPort.getInputStream(); >> } catch (IOException e) {} >> try { >> serialPort.addEventListener(this); >> } catch (TooManyListenersException e) {} >> serialPort.notifyOnDataAvailable(true); >> try { >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } catch (UnsupportedCommOperationException e) {} >> readThread = new Thread(this); >> readThread.start(); >> } >> public void run() { >> try { >> Thread.sleep(20000); >> } catch (InterruptedException e) {} >> } >> public void serialEvent(SerialPortEvent event) { >> switch(event.getEventType()) { >> case SerialPortEvent.BI: >> case SerialPortEvent.OE: >> case SerialPortEvent.FE: >> case SerialPortEvent.PE: >> case SerialPortEvent.CD: >> case SerialPortEvent.CTS: >> case SerialPortEvent.DSR: >> case SerialPortEvent.RI: >> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >> break; >> case SerialPortEvent.DATA_AVAILABLE: >> byte[] readBuffer = new byte[20]; >> try { >> while (inputStream.available() > 0) { >> int numBytes = inputStream.read(readBuffer); >> } >> System.out.print(new String(readBuffer)); >> } catch (IOException e) {} >> break; >> } >> } >> } >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > cheers > YiQi Huang > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From joachim at buechse.de Wed May 24 00:10:06 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:10:06 +0200 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Hi Sean, my preferred way of dealing with RXTX on OS X is to include the RXTX classes into my application jar and to put the RXTX lib in the same directory as this jar. To make it even more comfortable, you can include the lib in the jar and have some startup code extract it and write it to a temporary file from which you load it with System.load(). Unfortunately the current version of RXTX for OS X requires tinkering with user groups as it is based on lockfiles - and hence it needs the RXTX OS X installer or you need to duplicated this functionality in your own installer. I have created my own native version which is not based on lockfiles but tty locking (the standard way to do it on OSX). I hope that these patches will be integrated soon into the distribution. Regards, Joachim On 23.05.2006, at 16:46, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Wed May 24 00:16:12 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:16:12 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <7017ECFC-B13E-4806-B321-9FFCAC5830F0@buechse.de> I assume you downloaded rxtx-217 (not 207). Instead of importing javax.comm.* you must import gnu.io.* The classes have the same name, but they are not in the same package. On 24.05.2006, at 06:50, YiQi Huang wrote: > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From yhua537 at cse.unsw.edu.au Wed May 24 00:17:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 16:17:45 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Message-ID: Thanks Tod again, i kept reading "gnu.io.*" as "gun.io.*" last few hours after i read some commons from web. Thanks very much Tod. thanks YiQi Huang On Tue, 23 May 2006, Tod E. Kurt wrote: > Yes, sorry, classpath entries are semicolon-separated on Windows and > colon-separated on everything else. > > Your example code below is importing the wrong set of classes. It > should not "import javax.comm.*", instead it should "import > gnu.io.*". When I make that change, your example program compiles. > The "javax.comm" package is the one released by Sun, the "gnu.io" > package is the RXTX one. You might've seen some discussion that the > two will be merged or become compatible, but that hasn't happened yet. > > -=tod > > > On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > >> >> Yes, Michael you are right, it should be semicolons, But it still >> can't >> find the correct library. >> >> On Wed, 24 May 2006, Michael Mester wrote: >> >>> I believe the entries in the classpath need to be seperated with >>> semicolons, not a colon as you have in your command below >>> >>> >>> -----Original Message----- >>> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >>> Sent: Wed 5/24/2006 12:50 AM >>> To: RXTX Developers and Users >>> Subject: Re: [Rxtx] install rxtx in XP >>> >>> Hi, >>> >>> Sorry guys.I follow Tod's instruction, and here is what i did: >>> >>> put >>> RXTXcomm.jar, >>> rxtxParallel.dll, >>> rxtxSerial.dll >>> in >>> C:\RXTX_files >>> >>> and I got a SimpleRead class attached below, compile it with : >>> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >>> it still saying "cannot find symbol". >>> >>> Is there anything I did wrong? Do I need the comm.jar from Sun? >>> >>> Thanks & regards >>> YiQi Huang >>> >>> >>> //////////////////////////////////////////////////////// >>> // SimpleRead.java >>> //////////////////////////////////////////////////////// >>> >>> import java.io.*; >>> import java.util.*; >>> import javax.comm.*; >>> >>> public class SimpleRead >>> implements Runnable, SerialPortEventListener { >>> static CommPortIdentifier portId; >>> static Enumeration portList; >>> InputStream inputStream; >>> SerialPort serialPort; >>> Thread readThread; >>> public static void main(String[] args) { >>> portList = CommPortIdentifier.getPortIdentifiers(); >>> while (portList.hasMoreElements()) { >>> portId = (CommPortIdentifier) portList.nextElement(); >>> if (portId.getPortType() == >>> CommPortIdentifier.PORT_SERIAL) { >>> if (portId.getName().equals("COM1")) { >>> //if (portId.getName().equals("/dev/term/a")) { >>> SimpleRead reader = new SimpleRead(); >>> } >>> } >>> } >>> } >>> public SimpleRead() { >>> try { >>> serialPort = (SerialPort) portId.open("SimpleReadApp", >>> 2000); >>> } catch (PortInUseException e) {} >>> try { >>> inputStream = serialPort.getInputStream(); >>> } catch (IOException e) {} >>> try { >>> serialPort.addEventListener(this); >>> } catch (TooManyListenersException e) {} >>> serialPort.notifyOnDataAvailable(true); >>> try { >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, >>> SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> } catch (UnsupportedCommOperationException e) {} >>> readThread = new Thread(this); >>> readThread.start(); >>> } >>> public void run() { >>> try { >>> Thread.sleep(20000); >>> } catch (InterruptedException e) {} >>> } >>> public void serialEvent(SerialPortEvent event) { >>> switch(event.getEventType()) { >>> case SerialPortEvent.BI: >>> case SerialPortEvent.OE: >>> case SerialPortEvent.FE: >>> case SerialPortEvent.PE: >>> case SerialPortEvent.CD: >>> case SerialPortEvent.CTS: >>> case SerialPortEvent.DSR: >>> case SerialPortEvent.RI: >>> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >>> break; >>> case SerialPortEvent.DATA_AVAILABLE: >>> byte[] readBuffer = new byte[20]; >>> try { >>> while (inputStream.available() > 0) { >>> int numBytes = inputStream.read(readBuffer); >>> } >>> System.out.print(new String(readBuffer)); >>> } catch (IOException e) {} >>> break; >>> } >>> } >>> } >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> >> cheers >> YiQi Huang >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From smontgomery at mediaspansoftware.com Wed May 24 10:24:13 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 12:24:13 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: Tod & Joachim, Thanks for the info, that's very helpful. I'll give that a whirl when I move to rxtx 2.1. I'm still using the older 2.0.7 version for now (don't ask), which probably requires the Sun comm.jar, javax.comm.properties and librxtxSerial.jnilib to be in very specific places in each jvm's file hierarchy. From tjarvi at qbang.org Wed May 24 11:59:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 11:59:16 -0600 (MDT) Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: On Wed, 24 May 2006, Sean Montgomery wrote: > Tod & Joachim, > > Thanks for the info, that's very helpful. I'll give that a whirl > when I move to rxtx 2.1. I'm still using the older 2.0.7 version for > now (don't ask), which probably requires the Sun comm.jar, > javax.comm.properties and librxtxSerial.jnilib to be in very specific > places in each jvm's file hierarchy. > You will need comm.jar from Sun then. It must be Sun's version 2.* or older for Linux or Solaris. I assume they have this in download archives. The default offering from Sun is version 3.0. This version currently does not support rxtx. The older version will probably be fine for your needs. -- Trent Jarvi tjarvi at qbang.org From smontgomery at mediaspansoftware.com Wed May 24 12:19:06 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 14:19:06 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: <3939EFB8-11E1-4E3E-A684-5B3C525577CD@mediaspansoftware.com> Yup, that's right, thanks Trent. I've been using these files for quite a while now. Thanks for bringing it up. I almost didn't mention using 2.0.7 because I didn't want to give any new members of the list the wrong idea! :-) On May 24, 2006, at 1:59 PM, Trent Jarvi wrote: > On Wed, 24 May 2006, Sean Montgomery wrote: > >> Tod & Joachim, >> >> Thanks for the info, that's very helpful. I'll give that a whirl >> when I move to rxtx 2.1. I'm still using the older 2.0.7 version for >> now (don't ask), which probably requires the Sun comm.jar, >> javax.comm.properties and librxtxSerial.jnilib to be in very specific >> places in each jvm's file hierarchy. >> > > You will need comm.jar from Sun then. It must be Sun's version 2.* or > older for Linux or Solaris. I assume they have this in download > archives. > > The default offering from Sun is version 3.0. This version > currently does > not support rxtx. > > The older version will probably be fine for your needs. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mark at mdsh.com Wed May 24 15:55:46 2006 From: mark at mdsh.com (Mark Himsley) Date: Wed, 24 May 2006 22:55:46 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <37B0FC4B1F3237321F093ABE@MacMini.local> On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) That's no problem. BUT, do note that the instructions I elaborated on are in the INSTALL file within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone please update the INSTALL file? > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > > , it includes DLLs for Windows and the JAR > > for Java. > > > > Follow the Windows instructions in the INSTALL. > > > > ie > > > > RXTXcomm.jar goes in \jre\lib\ext (under java) > > rxtxSerial.dll goes in \jre\bin > > > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > > C:\Program Files\Java\jre1.5.0_06\lib\ext > > and copy rxtxSerial.dll into > > C:\Program Files\Java\jre1.5.0_06\bin > > > > Yes, it really is that simple. > > > > > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > > > >> I am new to serial port programming, and have no experience on > >> programming java in xp, but my project require me to builld a > >> communication link between xp and a UART device. > >> > >> Most of the information in the web site seems for linux only. > >> including > >> the commands such as export and chmod. How do I install rxtx in xp? > >> > >> cheers > >> YiQi Huang > > > > > > > > -- > > Mark Himsley > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Mark Himsley From tjarvi at qbang.org Wed May 24 16:41:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 16:41:46 -0600 (MDT) Subject: [Rxtx] install rxtx in XP In-Reply-To: <37B0FC4B1F3237321F093ABE@MacMini.local> References: <37B0FC4B1F3237321F093ABE@MacMini.local> Message-ID: On Wed, 24 May 2006, Mark Himsley wrote: > > > On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > >> I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > That's no problem. > > BUT, do note that the instructions I elaborated on are in the INSTALL file > within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone > please update the INSTALL file? > > The INSTALL file may be updated by anyone at anytime. http://rxtx.qbang.org/wiki/index.php/Installation We are moving it to the wiki so end users may put the type of answers they would like to see in. Sometimes it's best if developers don't give what appears to be cryptic answers. You can even put in that jre/lib/ext is not the right place but you don't understand the classpath solution mentioned on the mail-list and then we know what to add. -- Trent Jarvi tjarvi at qbang.org From stramit at gmail.com Wed May 24 21:45:31 2006 From: stramit at gmail.com (Tim Cooper) Date: Thu, 25 May 2006 13:45:31 +1000 Subject: [Rxtx] Accessing Virtual Com Port Message-ID: Hi, I have to develop an application that talks to a virtual com port (in this case com3) which translates any messages sent across a USB cable to a micro. Using C++ I can talk to this com port and I know that it is configured, present, and working. For the application that I am trying to write I want to use RXTX for the communication. My problem is that the configured virtual port (in windows) is not showing up when I do an enumeration over the available ports. The output I get is (com 3 is not present) : Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 PORT FOUND: COM1 PORT FOUND: LPT1 Is there anything that I need to do to make com3 available to RXTX and my application? Timothy Cooper -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060524/c5591648/attachment-0008.html From antonio.luis at iscte.pt Thu May 25 01:39:13 2006 From: antonio.luis at iscte.pt (=?ISO-8859-1?Q?Ant=F3nio_Lopes?=) Date: Thu, 25 May 2006 08:39:13 +0100 Subject: [Rxtx] RXTX on Pocket PC Message-ID: <44755F21.8060103@iscte.pt> Hello everyone, I've been using RXTX to communicate with serial ports in Windows and it's been quite successful. However, I'm now considering porting my application from Windows to Pocket PC but I can't seem to find the RXTX binaries (*.jar and *.dll) to use in Pocket PC. I've been "digging" on the mailing list's archives and also on the web and I can't find these anywhere. Can anyone in this mailing list give me some pointers on this? Where can I find the necessary files and basic installation instructions? Thanks very much for your help. I very much appreciate any help that you can provide me. Regards, -- Ant?nio Lopes @contact: antonio.luis at iscte.pt @work: ADETTI - ISCTE @web: http://antonio.lopes.googlepages.com/home From doug at dupreeinc.com Fri May 26 15:45:50 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Fri, 26 May 2006 14:45:50 -0700 Subject: [Rxtx] rxtx slow startup Message-ID: <4477770E.9010400@dupreeinc.com> Hello, I hope there are people still reading this mailing list. The archive appeared to not have anything new after 4/2005. I was using the commapi from sun for a project where a java application reads data from test equipment connected to the serial port. I had to upgrade the ftdi vcp driver on my pc and the old sun commapi no longer works with hardware flow control. as an experiment I replaced the javax.com with gnu.io in the SerialDemo.java project that was included with the commapi. This compiled fine using JBuilder 2006 and JRE 1.5.0_05. RXTX also works with the latest ftdi drivers so life is wonderful again... almost... When using the commapi jar the SerialDemo program starts in about 1 second on my system. Using the RXTX jar it takes over 56 seconds to start. Has anyone else seen this problem? Is there a workaround to get the startup performance close to the old commapi? The last thing printed to the console before this delay is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks for your time! Doug From yhua537 at cse.unsw.edu.au Sat May 27 05:46:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 21:46:45 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <4477770E.9010400@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> Message-ID: hi Doug The archive hasn't been update for a long time, But people certainly still reading the list. I don't have enough experience to help on your problem, but without any detail about what your problem doing during that 56 seconds, it is hard to target the your question, I think. cheers YiQi On Fri, 26 May 2006, Doug Thistlethwaite wrote: > Hello, > > I hope there are people still reading this mailing list. The archive > appeared to not have anything new after 4/2005. > > I was using the commapi from sun for a project where a java application > reads data from test equipment connected to the serial port. I had to > upgrade the ftdi vcp driver on my pc and the old sun commapi no longer > works with hardware flow control. as an experiment I replaced the > javax.com with gnu.io in the SerialDemo.java project that was included > with the commapi. This compiled fine using JBuilder 2006 and JRE > 1.5.0_05. RXTX also works with the latest ftdi drivers so life is > wonderful again... almost... > > When using the commapi jar the SerialDemo program starts in about 1 > second on my system. Using the RXTX jar it takes over 56 seconds to > start. Has anyone else seen this problem? Is there a workaround to get > the startup performance close to the old commapi? > > The last thing printed to the console before this delay is: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Thanks for your time! > > Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------- Just a student, Still a student ------------------------------- From yhua537 at cse.unsw.edu.au Sat May 27 06:04:26 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 22:04:26 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: Sorry, I don't think you could understand what I mean .I mean this: Without any detail about what your program is doing during that 56 seconds, it is hard for anyone to target the problem. On Sat, 27 May 2006, YiQi Huang wrote: > hi Doug > > The archive hasn't been update for a long time, But people certainly still > reading the list. > > I don't have enough experience to help on your problem, but without any > detail about what your problem doing during that 56 seconds, it is hard to > target the your question, I think. > > cheers > YiQi > > On Fri, 26 May 2006, Doug Thistlethwaite wrote: > >> Hello, >> >> I hope there are people still reading this mailing list. The archive >> appeared to not have anything new after 4/2005. >> >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From jredman at ergotech.com Sat May 27 08:32:02 2006 From: jredman at ergotech.com (Jim Redman) Date: Sat, 27 May 2006 08:32:02 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: <447862E2.4080506@ergotech.com> Doug, Since you mentioned it, we have a system that is also seems slow. From memory (I don't have one of the slow systems around), I'm not sure that it's consistent, it seems that sometimes it may take longer than others. Since it's part of the bootup it hasn't raised a flag and I haven't researched it. The same code runs much faster on other systems, so now you've got me wondering what's different. The slow system boots DSL (http://www.damnsmalllinux.org/) from a compact flash. FC4 is on my desktop where I haven't noticed a slow down. I think that the rxtx code is the same in both cases with lock files disabled. The slow system has a bunch of serial ports defined, including 4 USB serial ports that do not exist - they are not plugged in. Any clues in there? Jim > On Fri, 26 May 2006, Doug Thistlethwaite wrote: >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Sat May 27 10:41:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 May 2006 10:41:54 -0600 (MDT) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447862E2.4080506@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: On Sat, 27 May 2006, Jim Redman wrote: > Doug, > > Since you mentioned it, we have a system that is also seems slow. From > memory (I don't have one of the slow systems around), I'm not sure that > it's consistent, it seems that sometimes it may take longer than others. > Since it's part of the bootup it hasn't raised a flag and I haven't > researched it. > > The same code runs much faster on other systems, so now you've got me > wondering what's different. > > The slow system boots DSL (http://www.damnsmalllinux.org/) from a > compact flash. FC4 is on my desktop where I haven't noticed a slow > down. I think that the rxtx code is the same in both cases with lock > files disabled. > > The slow system has a bunch of serial ports defined, including 4 USB > serial ports that do not exist - they are not plugged in. > > Any clues in there? > rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. When it does this, it will try to open each port and do a timed out read. most systems will not have entries in device if the port is not there. But some minimal systems will just put all the device files there in case hardware is added. The list of devices scanned used to be ~10-20 times longer than it is today. That was getting very slow. I suspect moving the device files not used to a backup directory would increase the enumeration. I'll look into why the mail-list archive is not updating. The last update was about when I thought I 'fixed' the cron jobs. I probably didn't actually fix it but rather moved the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon May 29 19:46:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 May 2006 19:46:47 -0600 (MDT) Subject: [Rxtx] Mail-List Archives are updating. Message-ID: It was pointed out earlier that the archive is dated. This was a missing crontab entry. The list is currently archived by the week on the web page. It is updated once a day. So every 7 days it starts a new link and updates it daily. I've been limited in what I could do while my cable modem was disconnected this last week. rxtx.org is something I do on my own time. The patches and credits will be comming next. Many of these can be seen in bugzilla right now. -- Trent Jarvi tjarvi at qbang.org From doug at dupreeinc.com Tue May 30 11:18:41 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 10:18:41 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: <447C7E71.4080204@dupreeinc.com> Trent, YiQi, and Jim: Thanks to all for the replies and information! I am just back from a long weekend and I am now trying to figure out what I was doing! :) As for more information. First off, this example is being run under windows XP. I am developing test equipment that communicates with a java application via a serial port. I have been using the commapi for several years and have not had a problem. Recently, I have started a design modification that will replace the RS232 connection with a USB port. I am using the ftdi module for prototyping and I discovered that their virtual com port driver was not compatible with the commapi that Sun released. It turns out that it has problems with hardware flow control ( it works on incoming but not outgoing communications). The way I figured this out was by experimenting with the SerialDemo that was included with the Sum commapi. One nice thing about this example is it has the ability to set incoming and outgoing flow control independently. After I installed RXTX into my JBuilder 2006 IDE, I just replaced all all instances of javax.comm with gnu.io and it compiled and runs without a hitch (except for the slow startup). I Paused the JBuilder IDE during this long pause and the last few entries in the stack trace are: testRead() : -1, gnu.io.RXTXCommDriver registerValidPorts() : 255, gnu.io.RXTXCommDriver registerScannedPorts() : 777, gnu.io.RXTXCommDriver This was all initiated by the following call in the programs init routine: Enumeration en = CommPortIdentifier.getPortIdentifiers(); After looking at this, My guess is that Trent is correct in that the delay is in scanning for ports. I guess one solution would be to not scan for ports, though it would be nice to detect what is available on the system. Is there any way to reduce the number of ports scanned by this function in windows XP? Thanks again for your time, Doug Trent Jarvi wrote: >On Sat, 27 May 2006, Jim Redman wrote: > > > >>Doug, >> >>Since you mentioned it, we have a system that is also seems slow. From >>memory (I don't have one of the slow systems around), I'm not sure that >>it's consistent, it seems that sometimes it may take longer than others. >>Since it's part of the bootup it hasn't raised a flag and I haven't >>researched it. >> >>The same code runs much faster on other systems, so now you've got me >>wondering what's different. >> >>The slow system boots DSL (http://www.damnsmalllinux.org/) from a >>compact flash. FC4 is on my desktop where I haven't noticed a slow >>down. I think that the rxtx code is the same in both cases with lock >>files disabled. >> >>The slow system has a bunch of serial ports defined, including 4 USB >>serial ports that do not exist - they are not plugged in. >> >>Any clues in there? >> >> >> > >rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. > >When it does this, it will try to open each port and do a timed out read. >most systems will not have entries in device if the port is not there. >But some minimal systems will just put all the device files there in case >hardware is added. > >The list of devices scanned used to be ~10-20 times longer than it is >today. That was getting very slow. > >I suspect moving the device files not used to a backup directory would >increase the enumeration. > >I'll look into why the mail-list archive is not updating. The last update >was about when I thought I 'fixed' the cron jobs. I probably didn't >actually fix it but rather moved the problem. > >-- >Trent Jarvi >tjarvi at qbang.org > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/86796453/attachment-0008.html From doug at dupreeinc.com Tue May 30 14:36:09 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 13:36:09 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447C7E71.4080204@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com> Message-ID: <447CACB9.1000801@dupreeinc.com> Hello all, I also notice this pause (not as long however) when I call: CommPortIdentifier.getPortIdentifier(PortName); I would think that if I supply the name of the port, it would not have to go through the same discovery process. If you have any ideas of how to get rid of this startup delay, I would really appreciate it. Thanks, Doug Doug Thistlethwaite wrote: > Trent, YiQi, and Jim: > > Thanks to all for the replies and information! I am just back from a > long weekend and I am now trying to figure out what I was doing! :) > > As for more information. First off, this example is being run under > windows XP. I am developing test equipment that communicates with a > java application via a serial port. I have been using the commapi for > several years and have not had a problem. Recently, I have started a > design modification that will replace the RS232 connection with a USB > port. I am using the ftdi module for prototyping and I discovered > that their virtual com port driver was not compatible with the commapi > that Sun released. It turns out that it has problems with hardware > flow control ( it works on incoming but not outgoing communications). > The way I figured this out was by experimenting with the SerialDemo > that was included with the Sum commapi. One nice thing about this > example is it has the ability to set incoming and outgoing flow > control independently. > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup). > > I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are: > > testRead() : -1, gnu.io.RXTXCommDriver > registerValidPorts() : 255, gnu.io.RXTXCommDriver > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > This was all initiated by the following call in the programs init routine: > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > After looking at this, My guess is that Trent is correct in that the > delay is in scanning for ports. I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system. Is there any way to reduce the number of ports scanned by > this function in windows XP? > > Thanks again for your time, > > Doug > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/edaa5c3c/attachment-0008.html From lynn at swcp.com Tue May 30 15:07:18 2006 From: lynn at swcp.com (lynn@swcp.com) Date: Tue, 30 May 2006 21:07:18 -0000 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CACB9.1000801@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: *IF* the name of the port is supplied, we might want to use the preferences mechanism (java.util.prefs) where we could have previously saved the info for the port. We could do a quick check to see that things have not changed before using it. If things have changed (or never been defined) we would do a full port scan and save detected ports in the preferences. This way if the hardware is not changed, you only pay the time penalty one time. just an idea... Lynn Doug Thistlethwaite said: > This is a multi-part message in MIME format. > --------------070808020900080005070500 > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > Content-Transfer-Encoding: 7bit > > Hello all, > > I also notice this pause (not as long however) when I call: > > CommPortIdentifier.getPortIdentifier(PortName); > > I would think that if I supply the name of the port, it would not have > to go through the same discovery process. If you have any ideas of how > to get rid of this startup delay, I would really appreciate it. > > Thanks, > > Doug > > Doug Thistlethwaite wrote: > > > Trent, YiQi, and Jim: > > > > Thanks to all for the replies and information! I am just back from a > > long weekend and I am now trying to figure out what I was doing! :) > > > > As for more information. First off, this example is being run under > > windows XP. I am developing test equipment that communicates with a > > java application via a serial port. I have been using the commapi for > > several years and have not had a problem. Recently, I have started a > > design modification that will replace the RS232 connection with a USB > > port. I am using the ftdi module for prototyping and I discovered > > that their virtual com port driver was not compatible with the commapi > > that Sun released. It turns out that it has problems with hardware > > flow control ( it works on incoming but not outgoing communications). > > The way I figured this out was by experimenting with the SerialDemo > > that was included with the Sum commapi. One nice thing about this > > example is it has the ability to set incoming and outgoing flow > > control independently. > > > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > > all instances of javax.comm with gnu.io and it compiled and runs > > without a hitch (except for the slow startup). > > > > I Paused the JBuilder IDE during this long pause and the last few > > entries in the stack trace are: > > > > testRead() : -1, gnu.io.RXTXCommDriver > > registerValidPorts() : 255, gnu.io.RXTXCommDriver > > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > > > This was all initiated by the following call in the programs init routine: > > > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > > > After looking at this, My guess is that Trent is correct in that the > > delay is in scanning for ports. I guess one solution would be to not > > scan for ports, though it would be nice to detect what is available on > > the system. Is there any way to reduce the number of ports scanned by > > this function in windows XP? > > > > Thanks again for your time, > > > > Doug > > > > --------------070808020900080005070500 > Content-Type: text/html; charset=ISO-8859-1 > Content-Transfer-Encoding: 7bit > > > > > > > > > Hello all,
>
> I also notice this pause (not as long however) when I call:
>
>          CommPortIdentifier.getPortIdentifier(PortName);
>
> I would think that if I supply the name of the port, it would not have > to go through the same discovery process.  If you have any ideas of how > to get rid of this startup delay, I would really appreciate it.
>
> Thanks,
>
> Doug
>
> Doug Thistlethwaite wrote: >
> > Trent, YiQi, and Jim:
>
> Thanks to all for the replies and information!  I am just back from a > long weekend and I am now trying to figure out what I was doing! :)
>
> As for more information.  First off, this example is being run under > windows XP.  I am developing test equipment that communicates with a > java application via a serial port.  I have been using the commapi for > several years and have not had a problem.  Recently, I have started a > design modification that will replace the RS232 connection with a USB > port.  I am using the ftdi module for prototyping and I discovered that > their virtual com port driver was not compatible with the commapi that > Sun released.  It turns out that it has problems with hardware flow > control ( it works on incoming but not outgoing communications).  The > way I figured this out was by experimenting with the SerialDemo that > was included with the Sum commapi.  One nice thing about this example > is it has the ability to set incoming and outgoing flow control > independently.
>
> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup).
>
> I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are:
>
> testRead() : -1, gnu.io.RXTXCommDriver
> registerValidPorts() : 255, gnu.io.RXTXCommDriver
> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>
> This was all initiated by the following call in the programs init > routine:
>
> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>
> After looking at this,  My guess is that Trent is correct in that the > delay is in scanning for ports.  I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system.  Is there any way to reduce the number of ports scanned by > this function in windows XP? 
>
> Thanks again for your time,
>
> Doug
>
>
> > > > --------------070808020900080005070500-- > -- From jredman at ergotech.com Tue May 30 15:42:35 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 30 May 2006 15:42:35 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: <447CBC4B.2080206@ergotech.com> Lynn, If I understand your idea correctly, I don't think that this would work well for, say, USB ports since these can be easily added/removed by the end user. Jim lynn at swcp.com wrote: > *IF* the name of the port is supplied, we might want to use the preferences > mechanism (java.util.prefs) where we could have previously saved the info for > the port. We could do a quick check to see that things have not changed > before using it. If things have changed (or never been defined) we would do a > full port scan and save detected ports in the preferences. > > This way if the hardware is not changed, you only pay the time penalty one time. > > just an idea... > Lynn > > > Doug Thistlethwaite said: > >> This is a multi-part message in MIME format. >> --------------070808020900080005070500 >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >> Content-Transfer-Encoding: 7bit >> >> Hello all, >> >> I also notice this pause (not as long however) when I call: >> >> CommPortIdentifier.getPortIdentifier(PortName); >> >> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process. If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it. >> >> Thanks, >> >> Doug >> >> Doug Thistlethwaite wrote: >> >>> Trent, YiQi, and Jim: >>> >>> Thanks to all for the replies and information! I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :) >>> >>> As for more information. First off, this example is being run under >>> windows XP. I am developing test equipment that communicates with a >>> java application via a serial port. I have been using the commapi for >>> several years and have not had a problem. Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port. I am using the ftdi module for prototyping and I discovered >>> that their virtual com port driver was not compatible with the commapi >>> that Sun released. It turns out that it has problems with hardware >>> flow control ( it works on incoming but not outgoing communications). >>> The way I figured this out was by experimenting with the SerialDemo >>> that was included with the Sum commapi. One nice thing about this >>> example is it has the ability to set incoming and outgoing flow >>> control independently. >>> >>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup). >>> >>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are: >>> >>> testRead() : -1, gnu.io.RXTXCommDriver >>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>> >>> This was all initiated by the following call in the programs init routine: >>> >>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>> >>> After looking at this, My guess is that Trent is correct in that the >>> delay is in scanning for ports. I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system. Is there any way to reduce the number of ports scanned by >>> this function in windows XP? >>> >>> Thanks again for your time, >>> >>> Doug >>> >> --------------070808020900080005070500 >> Content-Type: text/html; charset=ISO-8859-1 >> Content-Transfer-Encoding: 7bit >> >> >> >> >> >> >> >> >> Hello all,
>>
>> I also notice this pause (not as long however) when I call:
>>
>>         >  CommPortIdentifier.getPortIdentifier(PortName);
>>
>> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process.  If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it.
>>
>> Thanks,
>>
>> Doug
>>
>> Doug Thistlethwaite wrote: >>
>> >> Trent, YiQi, and Jim:
>>
>> Thanks to all for the replies and information!  I am just back from a >> long weekend and I am now trying to figure out what I was doing! :)
>>
>> As for more information.  First off, this example is being run under >> windows XP.  I am developing test equipment that communicates with a >> java application via a serial port.  I have been using the commapi for >> several years and have not had a problem.  Recently, I have started a >> design modification that will replace the RS232 connection with a USB >> port.  I am using the ftdi module for prototyping and I discovered that >> their virtual com port driver was not compatible with the commapi that >> Sun released.  It turns out that it has problems with hardware flow >> control ( it works on incoming but not outgoing communications).  The >> way I figured this out was by experimenting with the SerialDemo that >> was included with the Sum commapi.  One nice thing about this example >> is it has the ability to set incoming and outgoing flow control >> independently.
>>
>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >> all instances of javax.comm with gnu.io and it compiled and runs >> without a hitch (except for the slow startup).
>>
>> I Paused the JBuilder IDE during this long pause and the last few >> entries in the stack trace are:
>>
>> testRead() : -1, gnu.io.RXTXCommDriver
>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>
>> This was all initiated by the following call in the programs init >> routine:
>>
>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>
>> After looking at this,  My guess is that Trent is correct in that the >> delay is in scanning for ports.  I guess one solution would be to not >> scan for ports, though it would be nice to detect what is available on >> the system.  Is there any way to reduce the number of ports scanned by >> this function in windows XP? 
>>
>> Thanks again for your time,
>>
>> Doug
>>
>>
>> >> >> >> --------------070808020900080005070500-- >> > > > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From yhua537 at cse.unsw.edu.au Tue May 30 18:10:23 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 31 May 2006 10:10:23 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CBC4B.2080206@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: Doug, In the SerialDemo, it allow us to save the parameters into a file, and use it when your program start up. Would this help? YiQi On Tue, 30 May 2006, Jim Redman wrote: > Lynn, > > If I understand your idea correctly, I don't think that this would work > well for, say, USB ports since these can be easily added/removed by the > end user. > > Jim > > lynn at swcp.com wrote: >> *IF* the name of the port is supplied, we might want to use the preferences >> mechanism (java.util.prefs) where we could have previously saved the info for >> the port. We could do a quick check to see that things have not changed >> before using it. If things have changed (or never been defined) we would do a >> full port scan and save detected ports in the preferences. >> >> This way if the hardware is not changed, you only pay the time penalty one time. >> >> just an idea... >> Lynn >> >> >> Doug Thistlethwaite said: >> >>> This is a multi-part message in MIME format. >>> --------------070808020900080005070500 >>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>> Content-Transfer-Encoding: 7bit >>> >>> Hello all, >>> >>> I also notice this pause (not as long however) when I call: >>> >>> CommPortIdentifier.getPortIdentifier(PortName); >>> >>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process. If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it. >>> >>> Thanks, >>> >>> Doug >>> >>> Doug Thistlethwaite wrote: >>> >>>> Trent, YiQi, and Jim: >>>> >>>> Thanks to all for the replies and information! I am just back from a >>>> long weekend and I am now trying to figure out what I was doing! :) >>>> >>>> As for more information. First off, this example is being run under >>>> windows XP. I am developing test equipment that communicates with a >>>> java application via a serial port. I have been using the commapi for >>>> several years and have not had a problem. Recently, I have started a >>>> design modification that will replace the RS232 connection with a USB >>>> port. I am using the ftdi module for prototyping and I discovered >>>> that their virtual com port driver was not compatible with the commapi >>>> that Sun released. It turns out that it has problems with hardware >>>> flow control ( it works on incoming but not outgoing communications). >>>> The way I figured this out was by experimenting with the SerialDemo >>>> that was included with the Sum commapi. One nice thing about this >>>> example is it has the ability to set incoming and outgoing flow >>>> control independently. >>>> >>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>> all instances of javax.comm with gnu.io and it compiled and runs >>>> without a hitch (except for the slow startup). >>>> >>>> I Paused the JBuilder IDE during this long pause and the last few >>>> entries in the stack trace are: >>>> >>>> testRead() : -1, gnu.io.RXTXCommDriver >>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>> >>>> This was all initiated by the following call in the programs init routine: >>>> >>>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>> >>>> After looking at this, My guess is that Trent is correct in that the >>>> delay is in scanning for ports. I guess one solution would be to not >>>> scan for ports, though it would be nice to detect what is available on >>>> the system. Is there any way to reduce the number of ports scanned by >>>> this function in windows XP? >>>> >>>> Thanks again for your time, >>>> >>>> Doug >>>> >>> --------------070808020900080005070500 >>> Content-Type: text/html; charset=ISO-8859-1 >>> Content-Transfer-Encoding: 7bit >>> >>> >>> >>> >>> >>> >>> >>> >>> Hello all,
>>>
>>> I also notice this pause (not as long however) when I call:
>>>
>>>         >>  CommPortIdentifier.getPortIdentifier(PortName);
>>>
>>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process.  If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it.
>>>
>>> Thanks,
>>>
>>> Doug
>>>
>>> Doug Thistlethwaite wrote: >>>
>>> >>> Trent, YiQi, and Jim:
>>>
>>> Thanks to all for the replies and information!  I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :)
>>>
>>> As for more information.  First off, this example is being run under >>> windows XP.  I am developing test equipment that communicates with a >>> java application via a serial port.  I have been using the commapi for >>> several years and have not had a problem.  Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port.  I am using the ftdi module for prototyping and I discovered that >>> their virtual com port driver was not compatible with the commapi that >>> Sun released.  It turns out that it has problems with hardware flow >>> control ( it works on incoming but not outgoing communications).  The >>> way I figured this out was by experimenting with the SerialDemo that >>> was included with the Sum commapi.  One nice thing about this example >>> is it has the ability to set incoming and outgoing flow control >>> independently.
>>>
>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup).
>>>
>>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are:
>>>
>>> testRead() : -1, gnu.io.RXTXCommDriver
>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>
>>> This was all initiated by the following call in the programs init >>> routine:
>>>
>>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>
>>> After looking at this,  My guess is that Trent is correct in that the >>> delay is in scanning for ports.  I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system.  Is there any way to reduce the number of ports scanned by >>> this function in windows XP? 
>>>
>>> Thanks again for your time,
>>>
>>> Doug
>>>
>>>
>>> >>> >>> >>> --------------070808020900080005070500-- >>> >> >> >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From halbleib at rechnerbetriebsgruppe.de Wed May 31 02:06:16 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 10:06:16 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp Message-ID: <447D4E78.30302@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, I getting an error while reloading my app in tomcat. At the first start everything runs well, but if i reload mit webapp by tomcat manager i get the following error. java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader Is there a possibility to unload the native library rxtxSerial.dll? thx for all help! regards tom -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 b8FT80HQ1xlbDLnRecDANCc= =heb1 -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 02:52:17 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 10:52:17 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D4E78.30302@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> Message-ID: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Hello Tom, To the best of my knowledge it is impossible to unload native libraries once loaded into the JVM. The exception you see stems from the fact, that Tomcat creates a new classloader when you "reload" the weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar is loaded from the session class loader. Try to add RXTXComm.jar to your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. Regards, Joachim On 31.05.2006, at 10:06, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 > b8FT80HQ1xlbDLnRecDANCc= > =heb1 > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From halbleib at rechnerbetriebsgruppe.de Wed May 31 03:28:35 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 11:28:35 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Message-ID: <447D61C3.1030807@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Joachim, I'm still not getting it. How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml-file? Perhaps web.xml? Regards, Tom Joachim Buechse schrieb: > Hello Tom, > > To the best of my knowledge it is impossible to unload native > libraries once loaded into the JVM. The exception you see stems from > the fact, that Tomcat creates a new classloader when you "reload" the > weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar > is loaded from the session class loader. Try to add RXTXComm.jar to > your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. > > Regards, > Joachim > > On 31.05.2006, at 10:06, Tom Halbleib wrote: > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL tzNy+/0iIUfkYYgt1+UT1ko= =pkpY -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 04:03:42 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 12:03:42 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D61C3.1030807@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> <447D61C3.1030807@rechnerbetriebsgruppe.de> Message-ID: -Xbootclasspath/a: is a start option to the java vm. Google is your friend in finding how to modfiy it and what it means: tomcat modifying bootclasspath Regards, Joachim On 31.05.2006, at 11:28, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Joachim, > > I'm still not getting it. > How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml- > file? > Perhaps web.xml? > > Regards, > Tom > > Joachim Buechse schrieb: >> Hello Tom, >> >> To the best of my knowledge it is impossible to unload native >> libraries once loaded into the JVM. The exception you see stems from >> the fact, that Tomcat creates a new classloader when you "reload" the >> weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar >> is loaded from the session class loader. Try to add RXTXComm.jar to >> your bootlclasspath (-Xbootclasspath/a:) and the problem should go >> away. >> >> Regards, >> Joachim >> >> On 31.05.2006, at 10:06, Tom Halbleib wrote: >> >> Hi all, >> >> I getting an error while reloading my app in tomcat. At the first >> start >> everything runs well, but if i reload mit webapp by tomcat manager >> i get >> the following error. >> >> java.lang.UnsatisfiedLinkError: Native Library >> C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in >> another classloader thrown while loading gnu.io.RXTXCommDriver >> Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: >> Native >> Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already >> loaded >> in another classloader >> >> >> Is there a possibility to unload the native library rxtxSerial.dll? >> >> thx for all help! >> >> regards >> >> tom > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL > tzNy+/0iIUfkYYgt1+UT1ko= > =pkpY > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From impakt01 at optusnet.com.au Wed May 31 06:55:42 2006 From: impakt01 at optusnet.com.au (Daren) Date: Wed, 31 May 2006 22:55:42 +1000 Subject: [Rxtx] (no subject) Message-ID: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/ade7ad37/attachment-0008.html From doug at dupreeinc.com Wed May 31 10:19:19 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 31 May 2006 09:19:19 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: <447DC207.3070702@dupreeinc.com> I am not sure what you are saying. The Save parameters menu option saves the current settings (baud, data bits, etc.). The long pause (~60 seconds) is when the application first starts (before loading the saved parameters). This does bring up a question, though I hate this type of kludge approach to getting this library to work... What exactly is a PortIdentifier? Is it always the same? If I stored the results from "CommPortIdentifier.getPortIdentifier(PortName);" in a file, could I use this the next time the program is executed? In this case I am using a virtual com port driver to connect to the device through a USB port. Doug YiQi Huang wrote: >Doug, > >In the SerialDemo, it allow us to save the parameters into a file, and use >it when your program start up. Would this help? > >YiQi > >On Tue, 30 May 2006, Jim Redman wrote: > > > >>Lynn, >> >>If I understand your idea correctly, I don't think that this would work >>well for, say, USB ports since these can be easily added/removed by the >>end user. >> >>Jim >> >>lynn at swcp.com wrote: >> >> >>>*IF* the name of the port is supplied, we might want to use the preferences >>>mechanism (java.util.prefs) where we could have previously saved the info for >>>the port. We could do a quick check to see that things have not changed >>>before using it. If things have changed (or never been defined) we would do a >>>full port scan and save detected ports in the preferences. >>> >>>This way if the hardware is not changed, you only pay the time penalty one time. >>> >>>just an idea... >>>Lynn >>> >>> >>>Doug Thistlethwaite said: >>> >>> >>> >>>>This is a multi-part message in MIME format. >>>>--------------070808020900080005070500 >>>>Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>>>Content-Transfer-Encoding: 7bit >>>> >>>>Hello all, >>>> >>>>I also notice this pause (not as long however) when I call: >>>> >>>> CommPortIdentifier.getPortIdentifier(PortName); >>>> >>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process. If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it. >>>> >>>>Thanks, >>>> >>>>Doug >>>> >>>>Doug Thistlethwaite wrote: >>>> >>>> >>>> >>>>>Trent, YiQi, and Jim: >>>>> >>>>>Thanks to all for the replies and information! I am just back from a >>>>>long weekend and I am now trying to figure out what I was doing! :) >>>>> >>>>>As for more information. First off, this example is being run under >>>>>windows XP. I am developing test equipment that communicates with a >>>>>java application via a serial port. I have been using the commapi for >>>>>several years and have not had a problem. Recently, I have started a >>>>>design modification that will replace the RS232 connection with a USB >>>>>port. I am using the ftdi module for prototyping and I discovered >>>>>that their virtual com port driver was not compatible with the commapi >>>>>that Sun released. It turns out that it has problems with hardware >>>>>flow control ( it works on incoming but not outgoing communications). >>>>>The way I figured this out was by experimenting with the SerialDemo >>>>>that was included with the Sum commapi. One nice thing about this >>>>>example is it has the ability to set incoming and outgoing flow >>>>>control independently. >>>>> >>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>>without a hitch (except for the slow startup). >>>>> >>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>>entries in the stack trace are: >>>>> >>>>>testRead() : -1, gnu.io.RXTXCommDriver >>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>>> >>>>>This was all initiated by the following call in the programs init routine: >>>>> >>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>>> >>>>>After looking at this, My guess is that Trent is correct in that the >>>>>delay is in scanning for ports. I guess one solution would be to not >>>>>scan for ports, though it would be nice to detect what is available on >>>>>the system. Is there any way to reduce the number of ports scanned by >>>>>this function in windows XP? >>>>> >>>>>Thanks again for your time, >>>>> >>>>>Doug >>>>> >>>>> >>>>> >>>>--------------070808020900080005070500 >>>>Content-Type: text/html; charset=ISO-8859-1 >>>>Content-Transfer-Encoding: 7bit >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>>Hello all,
>>>>
>>>>I also notice this pause (not as long however) when I call:
>>>>
>>>>        >>>> >>>> >>> CommPortIdentifier.getPortIdentifier(PortName);
>>> >>> >>>>
>>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process.  If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it.
>>>>
>>>>Thanks,
>>>>
>>>>Doug
>>>>
>>>>Doug Thistlethwaite wrote: >>>>
>>>> >>>>Trent, YiQi, and Jim:
>>>>
>>>>Thanks to all for the replies and information!  I am just back from a >>>>long weekend and I am now trying to figure out what I was doing! :)
>>>>
>>>>As for more information.  First off, this example is being run under >>>>windows XP.  I am developing test equipment that communicates with a >>>>java application via a serial port.  I have been using the commapi for >>>>several years and have not had a problem.  Recently, I have started a >>>>design modification that will replace the RS232 connection with a USB >>>>port.  I am using the ftdi module for prototyping and I discovered that >>>>their virtual com port driver was not compatible with the commapi that >>>>Sun released.  It turns out that it has problems with hardware flow >>>>control ( it works on incoming but not outgoing communications).  The >>>>way I figured this out was by experimenting with the SerialDemo that >>>>was included with the Sum commapi.  One nice thing about this example >>>>is it has the ability to set incoming and outgoing flow control >>>>independently.
>>>>
>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>without a hitch (except for the slow startup).
>>>>
>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>entries in the stack trace are:
>>>>
>>>>testRead() : -1, gnu.io.RXTXCommDriver
>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>>
>>>>This was all initiated by the following call in the programs init >>>>routine:
>>>>
>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>>
>>>>After looking at this,  My guess is that Trent is correct in that the >>>>delay is in scanning for ports.  I guess one solution would be to not >>>>scan for ports, though it would be nice to detect what is available on >>>>the system.  Is there any way to reduce the number of ports scanned by >>>>this function in windows XP? 
>>>>
>>>>Thanks again for your time,
>>>>
>>>>Doug
>>>>
>>>>
>>>> >>>> >>>> >>>>--------------070808020900080005070500-- >>>> >>>> >>>> >>> >>> >>> >>-- >>Jim Redman >>(505) 662 5156 x85 >>http://www.ergotech.com >>_______________________________________________ >>Rxtx mailing list >>Rxtx at qbang.org >>http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > >cheers >YiQi Huang >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/61d4d4c9/attachment-0008.html From impakt01 at optusnet.com.au Wed May 31 17:02:54 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 09:02:54 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Message-ID: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Hi all, I downloaded 2.1.7-pre16 and managed to build it and get it going. I made the changes as suggested by Peter Smith in an old post, by adding his code to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. Still not working, it opens the port at 9600 according to portmon.exe . Has anyone managed to get this going at a custom rate? Here is the post I'm referring to: http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 Thanks, Daren ________________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Daren Sent: Wednesday, 31 May 2006 10:56 PM To: rxtx at qbang.org Subject: [Rxtx] (no subject) Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren From tjarvi at qbang.org Wed May 31 21:44:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 May 2006 21:44:01 -0600 (MDT) Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> References: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Message-ID: On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org From impakt01 at optusnet.com.au Wed May 31 22:06:04 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 14:06:04 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: Message-ID: <200606010406.k51464X2010447@mail03.syd.optusnet.com.au> Trent, I have managed to successfully open the port at this speed using Realterm (available on sourceforge). From memory this uses DLPortIO. Using portmon.exe with realterm, even there it says that the port has opened at 1953. I changed termios.c:560 to dcb->BaudRate = 1953 ; and it still opens the port at 9600. Daren -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Thursday, 1 June 2006 1:44 PM To: RXTX Developers and Users Subject: Re: [Rxtx] custom baud rate win32 On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From smontgomery at mediaspansoftware.com Mon May 1 09:52:28 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 11:52:28 -0400 Subject: [Rxtx] RXTX, Java COMM and Windows Server 2003 on x64 experiences? Message-ID: Just wondering if anybody here has had to deploy RXTX or the javax.comm on Windows Server 2003 machines running on x64 (i.e. Xeon EM64T) and would like to relate how things went. From Sun's site, the Supported System Configurations pages give the options for that system: Java 5.0: - 32-bit Java 5.0 running on the OS in the 32-bit mode - 64-bit Java 5.0 running on the OS in the 64-bit native mode Java 1.4.2: - no options listed for EM64T processors, but potentially the standard 32-bit Java 1.4.2 could run on the OS in 32-bit mode? I guess the two main points of failure would be 1) the JVM itself and 2) the jni components. Make that three: there's gotta be hardware vendor driver support for the OS in the various modes, too. Guess I better go look at Keyspan's website... Thanks in advance for any info anyone might be able to provide. From smontgomery at mediaspansoftware.com Mon May 1 10:18:33 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 12:18:33 -0400 Subject: [Rxtx] Mailing list archive out of date? Message-ID: The mailing list archive at: http://mailman.qbang.org/pipermail/rxtx/ only shows emails through the end of March. Is there a new archive somewhere else? Didn't see anything mentioned on the wiki. From p.cain at phasefale.com.au Mon May 1 22:33:09 2006 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 02 May 2006 14:33:09 +1000 Subject: [Rxtx] RXTX and the Linux kernel. Message-ID: <4456E105.5080106@phasefale.com.au> Hi, First off the problem I am having isn't caused by RXTX itself but I'm hoping someone out there may have some knowledge that may help me. Background: I have an application monitoring a control system through a standard PC serial port which I talk to with rxtx-2.0.5. The application runs on RedHat7.3 kernel version 2.4.18 using Java 1.4. This configuration has been in use for several years and has proved to be stable. But it has become necessary for me to upgrade the OS but I'm running into problems with the serial communications. Its not that the comms don't work on the new OS (its never that simple) the comms work for a variable period of time (sometimes several hours) and then just stop, nothing on the data lines and control lines all indicate that data could flow. The new OS is Ubuntu 5.10 running kernel version 2.6.12. I have installed the OS and software on a PC and had it perform ok, then install the new OS and same software on the very same hardware and experienced the problems of them comms stopping. In the new OS I'm using Java5 to run the app but since I have experience the problem I reverted back to Java1.4 which didn't fix the problem. I've moved the app to a different system RedHat FC3 running 2.6.14 had experienced the problem. Not wanting to go through all the thing I have tried but I have established that it seems to be the 2.6 versions of the kernel that seem to be the problem and not an individual distribution of Linux. I should point out that I am using the same jar and library files for each java and OS combination. So I'm just wondering if anyone has had or heard of problems similar to these ? Or perhaps might know of what changed in the Linux serial driver (something I'm having a hard time establishing). I'm starting to run low on ideas of what to try so any help would be much appreciated. -- Peter Cain Senior Programmer Phasefale Pty Ltd From tjarvi at qbang.org Wed May 3 07:31:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 May 2006 07:31:00 -0600 (MDT) Subject: [Rxtx] Re: Concering ircomm and RXTX In-Reply-To: References: Message-ID: On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From legolas.w at gmail.com Wed May 3 08:46:23 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 19:16:23 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <4458C23F.2000003@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From legolas.w at gmail.com Wed May 3 13:10:57 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 23:40:57 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <44590041.80706@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From Lars.Hennig at wow-portal.com Thu May 4 00:39:15 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Thu, 4 May 2006 08:39:15 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: Message-ID: Hi, I could not find any solution. I therefore decided to to my own native implementation. Allthough it only supports the functions I need, it works pretty well now for me. I think the main problem there is the use of a wrong Windows API function and not setting an timeout. Regards, Lars Hennig W?rth Online World GmbH Tel. (0049)7181-258183 Mob. (0049)160-3522889 Fax. (0049)7940-153299 Lars.Hennig at wow-portal.com Gesendet von: rxtx-bounces at qbang.org 09.04.2006 10:42 Bitte antworten zu RXTX Developers and Users An d.herwald at dsh-elektronik.de, RXTX Developers and Users Kopie Thema Re: [Rxtx] USB Serialport - disconnection problems WV Proj./Teilpr.: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/7b39f374/attachment-0009.html From Pawan.Kharbanda at dot.state.co.us Thu May 4 11:00:58 2006 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Thu, 4 May 2006 11:00:58 -0600 Subject: [Rxtx] Dangling Lock Files Message-ID: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Hi, I have been using RXTX API's for the Serial Communication for quite some time now and for some of the devices we are opening and closing the connection every 2 minutes. This works great for few days and then suddenly I start seeing some "Port in Use Exception" and I see that the Lock files are still in the /var/lock folder after manually removing the lock files it works good for few hours and I see the same problem again. Can somebody explain me the scenarios why I am seeing the dangling Lock files? I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise Servers. Thanks Pawan Kharbanda -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/ba0e9261/attachment-0009.html From tjarvi at qbang.org Thu May 4 14:10:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:10:30 -0600 (MDT) Subject: [Rxtx] Dangling Lock Files In-Reply-To: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> References: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Message-ID: On Thu, 4 May 2006, Kharbanda, Pawan wrote: > Hi, > I have been using RXTX API's for the Serial Communication for quite > some time now and for some of the devices we are opening and closing the > connection every 2 minutes. This works great for few days and then > suddenly I start seeing some "Port in Use Exception" and I see that the > Lock files are still in the /var/lock folder after manually removing the > lock files it works good for few hours and I see the same problem again. > Can somebody explain me the scenarios why I am seeing the dangling Lock > files? > > I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise > Servers. Hi Pawan The next time it happens, look in the lockfile. There will be a pid. ps aux |grep 'pid' I think you will see that the application is still running for some reason. RXTX does a kill -0 on the pid to see if its alive. If not, it will remove the lockfile. So I suspect the previous program did not exit as you expected. -- Trent Jarvi tjarvi at qbang.org From Scott.Hughes at dalsemi.com Thu May 4 14:23:11 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 4 May 2006 15:23:11 -0500 Subject: [Rxtx] Wiki instructions... Message-ID: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire demo apps, when I stumbled across this tip on the wiki to add yourself to the uucp group: It may be simpler to just run usermod -G uucp jarvi Taken from: http://rxtx.qbang.org/wiki/index.php/Installation This does not work as advertised. I should have read the man page for usermod before I tried that out. If there are any groups which are not listed after the -G switch, the user is removed from those groups. On Ubuntu, this is bad... I removed myself from the Admin group, which removed my sudo priviledges. Ubuntu has no root account, so I've disabled the only account which could fix it. Anyone know of a good workaround? Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor From tjarvi at qbang.org Thu May 4 14:32:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:32:09 -0600 (MDT) Subject: [Rxtx] Wiki instructions... In-Reply-To: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> Message-ID: On Thu, 4 May 2006, Scott Hughes wrote: > I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire > demo apps, when I stumbled across this tip on the wiki to add yourself to > the uucp group: > > It may be simpler to just run > > usermod -G uucp jarvi > > Taken from: > http://rxtx.qbang.org/wiki/index.php/Installation > > This does not work as advertised. I should have read the man page for > usermod before I tried that out. If there are any groups which are not > listed after the -G switch, the user is removed from those groups. On > Ubuntu, this is bad... I removed myself from the Admin group, which removed > my sudo priviledges. Ubuntu has no root account, so I've disabled the only > account which could fix it. > > Anyone know of a good workaround? > Yikes This will get your permissions back: in grub/lilo/.. pass the following option to the kernel init=/bin/sh You are now root. when it boots, mount -o remount,rw / add yourself to the groups, reboot to get normal init going. Thats about all I can think of without sudo/root. -- Trent Jarvi tjarvi at qbang.org From Gettings at earth.utah.edu Thu May 4 14:41:22 2006 From: Gettings at earth.utah.edu (Paul Gettings) Date: Thu, 4 May 2006 14:41:22 -0600 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <20060504204122.GA6534@earth.utah.edu> When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get messages on stdout from the JVM: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 As the only change was the version of RXTX (from 2.1.6), I am unsure why the messages suddenly appeared. Anyone know how to get rid of them? Thanks. -- 101 USES FOR A DEAD MICROPROCESSOR (23) Dead cat brush From mmester at sps.edu Mon May 1 21:22:28 2006 From: mmester at sps.edu (Michael Mester) Date: Mon, 1 May 2006 23:22:28 -0400 Subject: [Rxtx] Windows PortInUseException Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> I'm trying to get simple serial communication going with RxTx under Windows XP. I can enumerate the ports fine, but I always run into problems when I try to open one. I get a PortInUseException, but the owner application is "Unknown" and the port is never open. I've tried this on several different systems and all of them give the same behavior. The only thing I can thiunk of that might be causing the problem is that fact that I had to put the serial .dll file in system32 instead of the reccommended folder, because it didn't work in the folder the documentation gives. The library loads fine, though, so I'm not sure whether that makes sense, and I don't know how to fix it anyway. Any help is greatly appreciated. Below is the output of the program, right up to the PortInUseException and the NullPointerException it causes (because the serial port object is not instantiated). C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI Starting GPSTalkerGUI... Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 gnu.io.PortInUseException: Unknown Application Exception in thread "main" java.lang.NullPointerException at GPSTalkerGUI.(GPSTalkerGUI.java:102) at GPSTalkerGUI.main(GPSTalkerGUI.java:161) Again, thank you very much for any help you can give. From lshellman at qwest.net Wed May 3 01:38:34 2006 From: lshellman at qwest.net (Lucious Shellman) Date: Wed, 03 May 2006 01:38:34 -0600 Subject: [Rxtx] Help needed: Project using parallel port Message-ID: <1146641914.8337.14.camel@localhost.localdomain> I was looking for a way to access the parallel port on a PC using Java. Searching the Internet, I came across this site (rxtx.org). What I am trying to do is detect logic levels from a TTL logic IC on the parallel port. I am not trying to do classic parallel port communication. I just want to detect whether a line(s) is (are) high or low. I am using Windows 98. Can rxtx be used to do this? If yes, is there a tutorial for using rxtx posted on the Internet that someone can direct me to. If you need more information, feel free to e-mail me. Unfortunately for me, I need the information ASAP. Thanks. lshellman at qwest.net From webmaster at egyhelp.com Wed May 3 18:43:39 2006 From: webmaster at egyhelp.com (Mohamed Samy) Date: Thu, 4 May 2006 02:43:39 +0200 Subject: [Rxtx] RE: Concering ircomm and RXTX In-Reply-To: Message-ID: <20060503184362.SM01044@Geek> Hey, I issue the command "modprobe ircomm-tty" yet no ttyircomm appears, while the ircomm appear by "modprobe ircomm" so forgive me but I am bit lost. Even searching google for the keyword "ttyircomm" only returns 3 matches. So any way I can start the ttyircomm???? Thanks a lot. -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Wednesday, May 03, 2006 3:31 PM To: Mohamed Samy; rxtx at qbang.org Cc: taj at www.linux.org.uk Subject: Re: Concering ircomm and RXTX On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 4 15:49:49 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 15:49:49 -0600 (MDT) Subject: [Rxtx] Windows PortInUseException In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> Message-ID: On Mon, 1 May 2006, Michael Mester wrote: > > I'm trying to get simple serial communication going with RxTx under > Windows XP. I can enumerate the ports fine, but I always run into > problems when I try to open one. I get a PortInUseException, but the > owner application is "Unknown" and the port is never open. I've tried > this on several different systems and all of them give the same > behavior. The only thing I can thiunk of that might be causing the > problem is that fact that I had to put the serial .dll file in system32 > instead of the reccommended folder, because it didn't work in the folder > the documentation gives. The library loads fine, though, so I'm not sure > whether that makes sense, and I don't know how to fix it anyway. Any > help is greatly appreciated. Below is the output of the program, right > up to the PortInUseException and the NullPointerException it causes > (because the serial port object is not instantiated). > > C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI > Starting GPSTalkerGUI... > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > gnu.io.PortInUseException: Unknown Application > Exception in thread "main" java.lang.NullPointerException > at GPSTalkerGUI.(GPSTalkerGUI.java:102) > at GPSTalkerGUI.main(GPSTalkerGUI.java:161) > Perhaps you are trying to open the port twice in your code? rxtx does open the ports, do a timed out read and then close the ports during enumeration. I think the port is being opened fine. The Unknown Application is always reported. On linux, there is some code that finds the actual application but on windows, its always unknown. If the port enumeration is returning the ports you expect, rxtx has opened the port and closed it with success. The port should open. There is also example code in the contrib directory that comes with rxtx source that has examples you can modify to work. -- Trent Jarvi tjarvi at qbang.org From Christian.Klemke at t-online.de Thu May 4 23:37:23 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Fri, 5 May 2006 07:37:23 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu> Message-ID: <004f01c67005$fc72fee0$016a10ac@NB600> Hi Paul, I was wondering about the same question some days ago and took a look at the source files. Unfortunately, I found that you can only get rid of that messages by altering and recompiling the Java code. There is a final static boolean variable called "devel" in the file "RXTXCommDriver.java" which is set to "true". This constellation causes the output after the native libraries have been loaded. No mechanism exists to suppress them otherwise :-(. Trent, does that mean that 2.1.7 is still officially a "development" version ? When will this value be changed to "false" by default ? With 2.1.8 ? It would be nice to provide a means to suppress such messages besides that static flag (maybe by setting a property called "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The output can indeed by annoying, especially when used with console applications, where the message potentially appears "in the middle" of your own output. Another possibility would be not to use System.out directly, but instead some PrintStream field which is initially set to System.out but can programatically be changed. That would allow for any kind of redirection or suppression by implementing appropriate user-defined PrintStream subclasses and making RXTX use that stream. What do you think ? Best regards, Christian ----- Original Message ----- From: "Paul Gettings" To: Sent: Thursday, May 04, 2006 10:41 PM Subject: [Rxtx] RXTX causing stdout messages > When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get > messages on stdout from the JVM: > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > As the only change was the version of RXTX (from 2.1.6), I am unsure > why the messages suddenly appeared. Anyone know how to get rid of > them? > > Thanks. > > -- > 101 USES FOR A DEAD MICROPROCESSOR > (23) Dead cat brush > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri May 5 06:09:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 06:09:46 -0600 (MDT) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <004f01c67005$fc72fee0$016a10ac@NB600> References: <20060504204122.GA6534@earth.utah.edu> <004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: On Fri, 5 May 2006, Christian Klemke wrote: > Hi Paul, > > I was wondering about the same question some days ago and took a look at the > source files. Unfortunately, I found that you can only get rid of that > messages by altering and recompiling the Java code. There is a final static > boolean variable called "devel" in the file "RXTXCommDriver.java" which is > set to "true". This constellation causes the output after the native > libraries have been loaded. No mechanism exists to suppress them otherwise > :-(. > > Trent, does that mean that 2.1.7 is still officially a "development" version > ? When will this value be changed to "false" by default ? With 2.1.8 ? It > would be nice to provide a means to suppress such messages besides that > static flag (maybe by setting a property called > "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The > output can indeed by annoying, especially when used with console > applications, where the message potentially appears "in the middle" of your > own output. Another possibility would be not to use System.out directly, but > instead some PrintStream field which is initially set to System.out but can > programatically be changed. That would allow for any kind of redirection or > suppression by implementing appropriate user-defined PrintStream subclasses > and making RXTX use that stream. What do you think ? > A patch for using properties would be accepted I'm sure. The reason the default is to display the message is not related to the development state of rxtx anymore. The problem is that people first using rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. The message prevents a great deal of email thats easily explained by the message. I question if we should support rxtx 2.0 at all anymore. If you post a patch in bugzilla, we'll put it into CVS this weekend. we'll be going through and doing such things anyhow. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri May 5 13:23:56 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 13:23:56 -0600 (MDT) Subject: [Rxtx] How to read from RxTx parallel port in Win XP In-Reply-To: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> References: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> Message-ID: On Thu, 27 Apr 2006, Worsley, Bob (Development Engineer) wrote: > I'm sorry if this is a dumb question, but I didn't find the answer in > the archives. > > I'm using the RxTx binaries for Windows on a reasonably current notebook > PC running Windows XP. I can send stuff to a printer on the parallel > port (LPT1), but I can't get anything back. > > I wrote a class that has the methods listed below. I write some data to > the printer with the "write" method and then try to read a response > using the "read" method, but I never get any data. I'd greatly > appreciate any help you can give! > > Bob Worsley > bobwoyid2 at yahoo.com > > > > > private ParallelPort parallelPort = null; > private RXTXCommDriver parallelPortDriver = null; > > > public boolean initialize() throws IOException { > if (parallelPort != null) { > return false; // Already initialized > } > > // Create the parallel port; > parallelPortDriver = new RXTXCommDriver(); > parallelPort = > (ParallelPort)parallelPortDriver.getCommPort(address, > CommPortIdentifier.PORT_PARALLEL); > > // Set the parallel port parameters. > try { > parallelPort.enableReceiveTimeout(READ_TIMEOUT); > parallelPort.disableReceiveFraming(); > parallelPort.disableReceiveThreshold(); > //parallelPort.setMode(mode); !!!!errors > } catch (UnsupportedCommOperationException e) { > throw (new IOException("Parallel port with address '" + > address > + "' cannot be configured as specified")); > } > > return true; > } > > > > public void write(final byte[] bytes) throws IOException { > initialize(); > while (busyReading) { > Thread.yield(); > } > busyWriting = true; > if (bytes.length < 1) { > return; > } > OutputStream outputStream = parallelPort.getOutputStream(); > outputStream.write(bytes); > outputStream.flush(); > outputStream.close(); > Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); > busyWriting = false; > } > > > public byte[] read() throws IOException { > > // Read up to MAX_BYTES bytes. > initialize(); > while (busyWriting) { > Thread.yield(); > } > busyReading = true; > byte[] buff = new byte[MAX_BYTES_READ]; > InputStream inputStream = parallelPort.getInputStream(); > // This read blocks until input data is available > int bytesRead = inputStream.read(buff); > inputStream.close(); > // If no data read, create empty array > if (bytesRead == -1) { > bytesRead = 0; > } > byte[] deviceBytes = new byte[bytesRead]; > System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); > if (bytesRead > 0) { > Debug.p("PPIOP.read - got data: '" + new > String(deviceBytes) + "'"); > } > busyReading = false; > return deviceBytes; > } > Hi Bob I've only used rxtx to test a hello world page printing but there are others that have used it. PPIOP? hmm what is this? :) The rxtx parallel support is behind the serial support but should be OK. As you note, the setting of modes is not supported. rxtx uses what is provided when the port is open. Are your asserting the pin for the printer being online? I suspect what often happens is people try to just use the data pins but the C API rxtx uses wants the printer to be online. There should be some posts relating to this in the rxtx mail-list archive. Some APIs are probably reading and writing from the port address (also suggested in your code as something you are looking at). RXTX currently uses a higher level C/C++ API for port access. This can still work if the API thinks the 'printer' is there. -- Trent Jarvi tjarvi at qbang.org From agrodellic at gmail.com Sat May 6 08:39:40 2006 From: agrodellic at gmail.com (Leigh Stewart) Date: Sat, 6 May 2006 10:39:40 -0400 Subject: [Rxtx] sun commapi 3 Message-ID: I think I read here: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html that rxtx-2.0 is basically fracked for now? Does anyone know of a workaround? ie can i somehow get an older version of sun's comm api and use that (not easy to find)? i mean 2.0 must be working for someone...how is it being tested. 2.1 isnt working for me....im getting nasty native exceptions etc, which is why im so set on 2.0... any ideas? From tjarvi at qbang.org Sun May 7 15:40:27 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 7 May 2006 15:40:27 -0600 (MDT) Subject: [Rxtx] sun commapi 3 In-Reply-To: References: Message-ID: On Sat, 6 May 2006, Leigh Stewart wrote: > > 2.1 isnt working for me....im getting nasty native exceptions etc, > which is why im so set on 2.0... any ideas? > Hi Leigh What native exceptions are you seeing? Which OS? The native code is almost identical between rxtx 2.0 and 2.1. Only the names have been changed to protect the inocent. :) ie: javax_comm_... vs gnu_io_... So the odds are very likely that even if you do find commapi 2.0 and get it installed, you will run into the same error. It would be better to just find and fix the problem. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Mon May 8 10:47:20 2006 From: mail at willicon.de (WILLICon) Date: Mon, 08 May 2006 18:47:20 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 Message-ID: <445F7618.3070303@willicon.de> Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/ef37e8ec/attachment-0009.html From tjarvi at qbang.org Mon May 8 16:14:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 May 2006 16:14:51 -0600 (MDT) Subject: [Rxtx] Screenshot of Application using RXTX (fwd) Message-ID: Just though someone may end up searching for 0x0D and 0x0A. Here are the details from his system. SuSE Linux 10.0 (x86_64) Kernel 2.6.13-15.8 j2se 1.4.2_11 (i586) Sun: comm3.0_u1 rxtx: rxtx-2.1-7 ---------- Forwarded message ---------- Date: Sat, 6 May 2006 20:01:46 +0200 From: Michael Poppitz To: taj at www.linux.org.uk Subject: Screenshot of Application using RXTX Hi Trent, the rxtx package works like a charm. Sun's package seemed to replace all 0x0D with 0x0A in received data on my Linux box, which is really annoying when transfering binary data. But rxtx came and saved the day - and turned out to be a lot more convenient as it does not require a configuration file. I use it for connecting to a home made logic analyzer. (http://www.sump.org/projects/analyzer/) Thanks for your great job, Michael -------------- next part -------------- A non-text attachment was scrubbed... Name: la_client.png Type: image/png Size: 16592 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/45494fbb/la_client-0009.png From tjarvi at qbang.org Tue May 9 14:56:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 May 2006 14:56:05 -0600 (MDT) Subject: [Rxtx] RXTX javax.comm: which one to install? In-Reply-To: <20060509161742.43547.qmail@web53814.mail.yahoo.com> References: <20060509161742.43547.qmail@web53814.mail.yahoo.com> Message-ID: On Tue, 9 May 2006, Adenilson Cavalcanti wrote: > Dear Trent Jarvi > > I'm trying to write a small Java app running in linux that interfaces with a device connected to serial port. > > I do have some questions about RXTX and javax.comm state of affairs, since I'm new to Java programming (used to program in plain old C writting to devices using termios and open/write/read syscalls, but this is another story). > > I ask you the favor to clarify this issues (if possible...): > > a) Sun offers to download a file (comm3.0_u1_PUTAUNIXVERSION.zip) which does contain .so files. Does it work out of box? > > b) Case negative, its there that we should use 'librxtx*.so' provided by your site? > > c) Sun's comm3 API version does work with which version of rxtx? > > I already searched google and read documentation available in rxtx site ("Java Comm Serial API How-to") but still have this issues unsolved. Any help will be appreciated. > > Best regards > > Adenilson Hi Adenilson, RXTX does not currently support javax.comm in Sun's CommAPI 3.0. I would recommend using package gnu.io provided by rxtx 2.1. -- Trent Jarvi tjarvi at qbang.org From chris.develder at intec.ugent.be Wed May 10 08:45:40 2006 From: chris.develder at intec.ugent.be (Chris Develder) Date: Wed, 10 May 2006 16:45:40 +0200 Subject: [Rxtx] rxtx troubles on ARM Message-ID: <4461FC94.6040909@intec.ugent.be> Hi all, Sorry to bother you, but I don't seem to get RXTX working on an ARM processor (xscale ixp 425, big endian). I managed to crosscompile the rxtx libs and moved it over to the ARM. Using jamvm (which is the only open source java VM we got working on the ARM), I get the following error result when running SimpleRead from Sun's javax.comm examples (commapi\examples\Simple\SimpleRead) -- see bottom of mail for complete output: "java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver" However, output shows that the RXTXCommDriver code is accessible (cf. debug and devel output of lib versions). So it doesn't seem to be a missing lib/jar issue. The error happens before RXTXCommDriver.initialize() is called, since the first line there is System.out.println("RXTXCommDriver:initialize()"); Any ideas? Cheers, Chris ---------------------------- [root at xxx(ttyp1) /work/cdvelder/xscale/test]# jamvm -Djava.library.path=/work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/jre/lib/arm -classpath /work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/lib/ext/RXTXcomm.jar:./comm.jar:. SimpleRead RXTXCommDriver {} Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTXCommDriver: Jar version = RXTX-2.1-7 native lib Version = RXTX-2.1-7 java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver gnu/io/RXTXCommDriver at javax.comm.CommPortIdentifier.loadDriver (CommPortIdentifier.java:239) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:109) at SimpleRead.main (Unknown Source) java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive (Native Method) at com.sun.comm.Portmapping.registerCommPorts (Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase (Portmapping.java:100) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:138) at SimpleRead.main (Unknown Source) From joachim at buechse.de Fri May 12 00:44:48 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 08:44:48 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) Message-ID: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Good day, I guess that only a selected few (hi Trent) will be able to answer this question, but the answer might be interesting for anyone trying to debug or understand the code. Apparently the MonitorThread is started and stopped in RXTXPort.addEventListener and RXTXPort.removeEventListener. This would indicate that (originally?) the MonitorThread is only required when there is an EventListener. However the MonitorThread is also started in the RXTXPort constructor, which could mean that RXTX won't work at all if it isn't there. It seems to me, that if anyone would add an event listener and later on remove it, he could potentially wreak the port. Because the second action would kill the MonitorThread. For the moment I am only trying to understand the role of and idea behind the MonitorThread. But of course there is a deeper reason thor my question: If the MonitorThread needs to exist anyway, it could be the thread that cleans up the port (ie calls nativeClose) - this would eliminate (a further) problem I am seeing with some USB drivers on Mac OSX. (Close blocks (after releasing the tty, but still) in the USB driver if the device is "not responding"). Greetings, Joachim From tjarvi at qbang.org Fri May 12 07:10:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 12 May 2006 07:10:59 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Fri, 12 May 2006, Joachim Buechse wrote: > Good day, > > I guess that only a selected few (hi Trent) will be able to answer > this question, but the answer might be interesting for anyone trying > to debug or understand the code. > > Apparently the MonitorThread is started and stopped in > RXTXPort.addEventListener and RXTXPort.removeEventListener. This > would indicate that (originally?) the MonitorThread is only required > when there is an EventListener. However the MonitorThread is also > started in the RXTXPort constructor, which could mean that RXTX won't > work at all if it isn't there. > > It seems to me, that if anyone would add an event listener and later > on remove it, he could potentially wreak the port. Because the second > action would kill the MonitorThread. > > > For the moment I am only trying to understand the role of and idea > behind the MonitorThread. But of course there is a deeper reason thor > my question: > > If the MonitorThread needs to exist anyway, it could be the thread > that cleans up the port (ie calls nativeClose) - this would eliminate > (a further) problem I am seeing with some USB drivers on Mac OSX. > (Close blocks (after releasing the tty, but still) in the USB driver > if the device is "not responding"). > Hi Jaochim Before commapi, rxtx did not support events. You could read, write and change port settings. The MonitorThread was added as an afterthought to support commapi events. So the way things are now his historical spaghetti not a well devised plan. It is my opinion that the MonitorThread should exist as long as the port is open. The odd starting of the thread in the constructor and addEventListener was just to get past the obvious problem of people using the port without adding listeners. -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Fri May 12 07:59:50 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 15:59:50 +0200 Subject: [Rxtx] MonitorThread -> ChangeRequest In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: <2B1E508C-8CEE-4AB7-914D-E7BA25C871A2@buechse.de> In this case I suggest removing the starting/stopping of MonitorThread in addEventListener / removeEventListener. This should not affect existing projects. On 12.05.2006, at 15:10, Trent Jarvi wrote: > It is my opinion that the MonitorThread should exist as long as the > port > is open. The odd starting of the thread in the constructor and > addEventListener was just to get past the obvious problem of people > using > the port without adding listeners. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Fri May 12 11:43:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 19:43:21 +0200 Subject: [Rxtx] Spring Cleaning - some suggestions Message-ID: The current implementation of RXTX contains quite a lot of code that will break if it is used from several threads (especially on a multi processor machine). I think it would be nice to clean this up. I suggest the following changes (which keep the current semantics and should not influence existing projects in a negative way): - InterruptedException will never be ignored or reset - read methods will be protected with a Monitor - write methods will be protected with a (separate) Monitor - close() sets the read and write monitors into a "closed" state which will lead to IOExceptions for any following call to RXTXPort.read/write. - close() will wait a finite amount of time (maybe 500ms) for the release of the read and write monitors after that, it will trigger the closing of the file descriptor to abort any pending read or write. - close() will not call close(file_desc). Instead it will "interrupt" (ie set a flag and then, pthread_kill(ABRT)) the MonitorThread, the MonitorThread will call close(file_desc). - the monitors are properly released in a finally block the try of which starts directly after obtaining the monitor. - finally will not call close(file_desc) it will only "interrupt" the MonitorThread (see above) - the native-code (esp read) does not use SA_RESTART but checks Thread.interrupted() when it receives a SIGNAL (ie system call returns with EINTR or other signalling method). The read/write monitors will be allocated from a factory whose mode can be set to fast/normal/advanced. In fast-mode it will create "non thread safe, non synchronized" pseudo-monitors. In default mode, the monitors will store the owning thread. In "advanced" mode setting the monitors into closed state will "interrupt()" threads which are blocked in a native read/write. {Reasoning close behaviour: Calling close on a file descriptor in Windows unblocks any read() or write() on the same file descriptor with an error. On Solaris < 2.7 and MacOS X however the close() will/ can block - until the read or write have finished:-(( Even the JDK people have trouble with this. I dont know how Linux reacts in this case. The best practice for BSD/Solaris is to send a signal to the thread which will usually unblock the read/write with an EINTR - this however is not guarenteed as it also depends on the device driver. So the only resolution that will certainly not block the thread calling RXTXPort.close() (which will often enough be the AWT event dispatcher or the VM finalizer thread) is to call close(fd) from another thread.} {Reasoning read behaviour: It is rather uncommon to receive a signal while reading or writing - it will happen, but checking Thread.interrupted() when it happens will not degrade performance. The checking of Thread.interrupted() can be handled by returning to Java and potententially reentering into the native code if the thread was not interrupted or by calling back into the VM from the native code. On top of this, many functions like read(byte[]) or read(byte [], int, int) are allowed to return less than the requested amount of data. Only int read() is a bit more tricky. } [Trent: From the code I can tell, that you experimented quite a bit with signals. Do you know if the Java Thread.interrupt() triggers a unix signal on Linux/Solaris? If so, which one?? References: - http://java.sun.com/docs/hotspot/VMOptions.html - http://www.hp.com/products1/unix/java/infolibrary/prog_guide/ signals.html ] On OS X (hotspot client jdk-1.4.2) I did not see any signal propagated to the SELECT of the event_loop/MonitorThread (ie no EINTR) when I call monThread.interrupt(). This is a pitty, but thats the way it is. I simply assume this is true for most system calls. How to handle this? Of course it would be possible to install/ deinstall a specific signal handler before/after every native read and to natively send an ABRT signal if RXTXPort.close is called. A more elegant solution might be to have an additional "signaling" socket which is always included in the SELECT. Or the simplest solution: cap the timeout of the select to 500 ms (the loop around it exists already) after every timeout check the Thread.interrupted() flag. From a performance perspective this should be completely invisible... On the other hand, all write() calls need to be preceeded by a SELECT as well, to avoid running into a blocking write. Best regards, Joachim From lyon at docjava.com Sat May 13 05:54:52 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 13 May 2006 07:54:52 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Dmitry suggests that we acquire an implementation of a serial port reference, use it, then release it (i.e., check it back in). Joachim says that making serial ports thread friendly might be a good idea. This is a good idea. The design pattern that is close to this idea is the "Object Pool Design Pattern". # Object Pool Manage the reuse of objects for a type of object that is expensive to create or only a limited number of a kind of object can be created. It has been described at: http://www.developer.com/java/ent/article.php/626171 and in Marks' book, Patterns in Java, Volume 1. However, the Object Pool is intended to pool objects so that each object is just like every other object. The intent of the Parametric Singleton is to enable others to access the same resource at the same time (as long as the same parameters were used in construction). It sounds like we need a NEW Design Pattern (Oh no, Doug is doing it again!). Yes friends, you got me on a role (roll) :) If you like design patterns, you can thank me later. If you don't like design patterns, blame Dmitry, it was his idea ;) And Dave, thanks for the feedback on Singleton abuse. It has led me to change the way I think about application contexts, which we will see, below. We need (drum roll please): The Parametric Object Pool Design Pattern (POP) By Douglas A. Lyon ABSTRACT The goal of the Parametric Singleton design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values, in a given context. In comparison, the goal of the POP design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values and that only one reference to the class is checked out at a time, in a given context. A context is a namespace for holding identifiers during execution. In Java, A context can be changed in any of several ways. For example, creation of a new class loader, the deserialization of an old POP or the creation of a new process all create a new namespace. The POP Design Pattern combines the Parametric Singleton Design Pattern with the check out mechanism of the Object Pool Design Pattern. This enables unique creation of instances of a class. These instances are cached in a table. When a clients asks for an instance with these parameters, the cache is checked. If the instance is not in the cache it is created. If the instance is available, the clients checks out the instance. A reference is left to the clients that checked out the instance. The POP has the role of creating objects uniquely, from parameters. It also has the role of keeping track of which clients has checked out a given object. This is just like a library keeping track of who borrowed a book. If a resource is left unavailable in a system, a deadlock can occur. Deadlock debugging is facilitated by mapping a resource to the clients that have checked it out. We apply our POP Design Pattern to the retrieval of serial ports. The goal of our system is to make sure that serial ports are checked out to only one client at a time, and that they be checked back in when the client is done. The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. Users are discouraged from calling this the Parametric Object Oriented Pool (POOP). Introduction The intent of the POP Design Pattern is to ensure that a class has only one instance for a given set of parameter values. It also provides a point of access that is global to a given context. The POP uses the Singleton Design Pattern to ensure that there is only one POP, in the given context. The POP DP is responsible for checking out a reference to a given instance, and keeping track of that instance. The instance is responsible for sharing that instance. POP requires that users of the DP implement an interface that enables a recall facility. Thus, if there is a contention for a consumed resource, the deadlock can be resolved in an orderly fashion. Motivation A system cannot tolerate multiple instances of some classes with identical parameters used by different instances at the same time. For example, you cannot have two instances use the same serial port, at the same time. You cannot have two instances that are trying to listen to the same socket connection. You cannot have two instances writing to the same file structure at the same time. Further, once a serial port is checked out by a client, it is assigned to the client. This is like the spin-lock service provided by the operating system, only in the application layer. Naturally, deadlock will occur if a resource is not released, therefore the client of the resource is tracked. Recalling a resource is required for the POP DP by virtue of the implementation of an interface. The policy on how to break a deadlock (by honoring the recall) is application specific. As the operating system is often thought of as the arbiter of consumed resources (i.e., tape drives, serial ports, etc.) we frequently leave it to an operating system implementation to resolve these contention issues. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on naming conventions (which are not well standardized). The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. The POP Design Pattern can take on the role of the peer method mapper that homogenizes the API for different operating environments. That is, it can wrapper the different locking mechanisms used in different operating systems. POP that is responsible for keeping track of the instances created and the client that has checked them out. The POP Design Pattern is implemented using the Singleton Design Pattern. In Java, the POP implementation is declared final, so that it cannot be subclassed. The class also has a private constructor, so that other classes cannot instance it. The new design pattern is called the POP design pattern and it provides a way to check out and create instances with given parameters. Applicability Use the POP Design Pattern when: 1. There must be exactly one instance of a class with the given parameters in a given context. 2. The instances must be accessible to clients from a well-known access point. 3. The instances are reusable. 4. Only one client can check out an instance at a time. Structure Insert UML diagram here. Participants The POP Clients that need instances 1. The POP defines an instance upon request from a client, if, and only if, the instance does not already exist. 2. The POP returns the instance to the client. 3. The POP is responsible for creating unique instances from given parameters. 4. The POP is responsible to recalling instances from clients. Collaborations Clients obtain a reference to a POP instance only through the singleton design pattern. If the POP instance is left in an improper state (e.g., the serial port was left open) it is NOT the role of the POP to close the IO port. However, the POP can be requested to get the instance released. Nor is it the role of the POP Design Pattern to open the port. That role is delegate to some other part of the system. Further, it is the role of the POP Design Pattern to check out resources. However, it is still possible to have, multiple threads that have multiple references to the same resource at the same time. Checkout and resource requests are MUTEX locked (i.e., synchronized). Consequences The POP Design Pattern has several benefits: 1. Controlled access to parametrically defined instances. Since the POP encapsulates its instances, there is some limited control over how and when clients access it. 2. Reduced name space. The POP pattern avoids global variables that store instances created from the same parameter. Implementation Here are implementation issues to consider when using the POP pattern: 1. Unique mapping of parameters. The POP pattern requires that there be a mean to isomorphically map the parameter space into the instance space and back again. 2. Ensure unique instances. The POP pattern makes unique instances from parameters, and it does so only once. 3. Cache instances for fast retrieval. The POP must be able to look up instances, given some set of parameters, and do so from some data structure. That is, there must be enough space to hold references to all the instances the program will need. Also, a mechanism is needed to look up and retrieve the instances quickly enough to satisfy the clients. Sample Code To be written....any volunteers? Thanks! - Doug >I don't think I get it > >On Mar 22, 2006, at 9:36 AM, David Garnier wrote: >>Using the singleton pattern in this case is >>just convenient for the programmer. Problems >>arises >>pretty quickly, especially if you attempt to unit-test your classes. > > >so you're saying that something isn't so good >because you can not test it in the convenient >way? >if that's true, I'm totally disagree >change your test, debug whatever, but if >software is efficient at runtime, works fine and >only problem is some unit test >(which is some kind of framework for testing) >then dump that unit test , dump that unit >framework and make something appropriate to the >software >you're testing > >so if Douglas want to use singletons, what's the problem? >and what do you mean by abusing of singleton usage? > >of course singleton doesn't prevent concurrent >access to the resource across the processes >unless >you're using some OS facility to prevent it, besides >singleton as it was introduced is relevant only >and only inside of the same process >otherwise it's not singleton it's something else >(let's say network singleton: so you have remote >invocation facility >and some factory method that return object created by that facility) > >I don't have any problem with using any kind of singletons. > Parametric Singleton idea (if I understand it >right) could be easily implemented in the >following way: >use a map >populate map with instances of some class and key is your parameter >(you can use lazy population too) > >if somebody ask the key check the value if it's null so resource is taken >if somebody returns the resource put it back to the map > >public synchronized static Object getSomeResource(Object parameter); >public synchronized static void returnResource(Object parameter); > >getSomeResource (inside of the same process) could return null in 2 cases >1. if somebody (from other thread for example) already took that resource >2. if OS API said that resource corresponded to >that parameter (serial port with parameter = 1 >(port #)) >is locked and unavailable; >I'm not sure that in case of serial ports we >even need those Parametric Singletons >(unless lock checking is a very expensive operation) >just ask the OS about availability of that >resource and if it's available give it away >and then OS will lock it and therefore in next >time somebody ask it just answer that resource >is locked >and return null > >for example system has 2 serial ports available >so I ask getResource("tty"); >or I ask getResource("Bluetooth-Modem"); > >and if OS is ok you can give tty or Bluetooth-Modem or both > >no need for any additional pattern I think > >back to the problem >mac os x doesn't recognize locking via files, so >it handles locking via some API >an instance of the singleton in each process >should recognize that resource is locked >(by using that API) that's all >we don't have to make things more complicate >then they are just because there is some nice >design pattern or nice unit test framework or whatever >keep things simple, make them work fast, don't introduce middle layers >unless you have really good reason to do so > >of course I could be entirely wrong, so sorry about that in advance > >thanks > > >Dmitry Markman > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx >Good day, > >I guess that only a selected few (hi Trent) will be able to answer? >this question, but the answer might be interesting for anyone trying? >to debug or understand the code. > >Apparently the MonitorThread is started and stopped in? >RXTXPort.addEventListener and RXTXPort.removeEventListener. This? >would indicate that (originally?) the MonitorThread is only required? >when there is an EventListener. However the MonitorThread is also? >started in the RXTXPort constructor, which could mean that RXTX won't? >work at all if it isn't there. > >It seems to me, that if anyone would add an event listener and later? >on remove it, he could potentially wreak the port. Because the second? >action would kill the MonitorThread. > > >For the moment I am only trying to understand the role of and idea? >behind the MonitorThread. But of course there is a deeper reason thor? >my question: > >If the MonitorThread needs to exist anyway, it could be the thread? >that cleans up the port (ie calls nativeClose) - this would eliminate? >(a further) problem I am seeing with some USB drivers on Mac OSX.? >(Close blocks (after releasing the tty, but still) in the USB driver? >if the device is "not responding"). > >Greetings, >Joachim > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Sat May 13 10:07:37 2006 From: joachim at buechse.de (Joachim Buechse) Date: Sat, 13 May 2006 18:07:37 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Douglas, Looking at the current code, leaves me with the feeling, that there is a lot to do. Defining an API that wraps javax.comm to provide what you describe is certainly possible, but I wonder how much benefit it will actually provide. Personally I think the API defined by javax.comm "request/lock" a port with: cp= new CommunicationPort(identifier) "release" a port with: cp.close(); works quite nice for 99% of the applications. In my experience, the most efficient and elegant implementation is to wrap a port/socket/.. into a business object which declares the remote operations that are possible. Ie "uploadFile", "waitForPrompt", "getSerialNumber", "sendContact", "executeCommand", etc Those methods are then either synchronized or guarded by a monitor. I do not see how your design pattern applied to the port resource would help implementing this. [details start, skip if you agree to the above] When I talked about "thread-safe" I didn't mean several independent "sessions" accessing the port concurrently. I think this is a very rare usage. I believe the most common use case for serial ports today is the control of an external device from a PC running a GUI based application. To implement a clean Swing/AWT-GUI one needs to pass any action that can block to a "worker" thread (else the GUI blocks, the application appears dead). While it is possible to use own prespawned thread that will accept Runnables which operate on the port, this is not very elegant. It is more common to spawn a new thread for every action triggered by the user. Additionally the ABORT of a running operation is often implemented via a port.close() delegated to a different thread. - During the lifetime of a port, it will usually be accessed from several different threads. Instance variables need to be set/read in synchronized regions to guarantee a correct operation based on the Java memory model. - Synchronizing the access is usually handled on the application level (synchronizing the reads/writes is usually useless from the applications view because it is not a transaction mechanism). [details end] I am very open to learn about other scenarios where your proposed design pattern applied to the port resource is beneficial to the application implementor. Best regards, Joachim On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > Dmitry suggests that we acquire an implementation of > a serial port reference, use it, then release it (i.e., check it > back in). > > Joachim says that making serial ports thread friendly might be a > good idea. > > This is a good idea. The design pattern that is close to this idea > is the "Object Pool Design Pattern". > # Object Pool From jredman at ergotech.com Sun May 14 14:28:24 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 14:28:24 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers Message-ID: <446792E8.4000506@ergotech.com> Does anyone know of any work to make RXTX work with Ethernet (telent) Terminal Servers? If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? We've used RXTX with upwards of 100 virtual COM ports on Windows and it works well. Linux is more problematic. It would be good to have an OS independent solution to accesses remote Ethernet serial ports. Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From legolas.w at gmail.com Sun May 14 14:26:34 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:56:34 +0430 Subject: [Rxtx] does any one have a working sample of RXTX and LPT port Message-ID: <4467927A.4000008@gmail.com> Hi Thank you for reading my post does any one has a working sample for RXTX and LPT port ? Thanks From legolas.w at gmail.com Sun May 14 14:27:29 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:57:29 +0430 Subject: [Rxtx] does RXTX support Trigerr on parallel port? Message-ID: <446792B1.4040905@gmail.com> Hi does RXTX support trigger on LPT port ? if so , how i can use it ? Thanks From tjarvi at qbang.org Sun May 14 17:40:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 17:40:59 -0600 (MDT) Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: <446792E8.4000506@ergotech.com> References: <446792E8.4000506@ergotech.com> Message-ID: On Sun, 14 May 2006, Jim Redman wrote: > Does anyone know of any work to make RXTX work with Ethernet (telent) > Terminal Servers? > > If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 > Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? > Hi Jim It appears the author of NVTCom has decided to release the library into the public domain. Integration with rxtx is possible but it would be best to contact the author and find out what his intent is. I would suggest contacting the author with a proposal of what you would like to do and take it from there. We could 'take' public domain software but its better to show respect to the authors and respect their wishes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:10:23 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:10:23 -0600 (MDT) Subject: [Rxtx] does any one have a working sample of RXTX and LPT port In-Reply-To: <4467927A.4000008@gmail.com> References: <4467927A.4000008@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > Thank you for reading my post > does any one has a working sample for RXTX and LPT port ? > Thanks Hi Legolas LPT port support in rxtx is spotty. That means some people have sent in patches for what they do and it works well for them. The original code was not very good. It may have been 3 hours work :/ To get started, Sun has some demo programs with their commapi. With rxtx 2.1 you can change their code from using javax.com to gnu.io and it -should- work. But if it does not you can post here and on bugzilla. There has been more interest lately off the list and maybe there will be enough community resources to get what you need going. If you do get a sample program together, we would gladly put it in the contrib directory so the next person can get things going faster. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:12:12 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:12:12 -0600 (MDT) Subject: [Rxtx] does RXTX support Trigerr on parallel port? In-Reply-To: <446792B1.4040905@gmail.com> References: <446792B1.4040905@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > does RXTX support trigger on LPT port ? > if so , how i can use it ? > Hi Legolas As mentioned in the previous post, rxtx parallel support is not very mature. But if you can point to something that describes the trigger feature, we can probably make sure its there and give a quick code example. -- Trent Jarvi tjarvi at qbang.org From jredman at ergotech.com Sun May 14 22:22:48 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 22:22:48 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: References: <446792E8.4000506@ergotech.com> Message-ID: <44680218.4080008@ergotech.com> Trent, Trent Jarvi wrote: > On Sun, 14 May 2006, Jim Redman wrote: > >> Does anyone know of any work to make RXTX work with Ethernet (telent) >> Terminal Servers? >> >> If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 >> Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? >> > > Hi Jim > > It appears the author of NVTCom has decided to release the library into > the public domain. Integration with rxtx is possible but it would be best > to contact the author and find out what his intent is. > > I would suggest contacting the author with a proposal of what you would > like to do and take it from there. We could 'take' public domain software > but its better to show respect to the authors and respect their wishes. > I sent Marco(?), the author of the library, a note before asking the list - I'll let you know the response. If anyone is already working on it, or has an interest and more time and energy than me, I'd hate to duplicate the efforts. If no one is, and no one objects, maybe I'll see what I can do. Jim > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From Christian.Klemke at t-online.de Mon May 15 02:23:06 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Mon, 15 May 2006 10:23:06 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu><004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: <008a01c677f8$cae18590$02fea8c0@NB600> Hi Trent, Hi Paul, I finally found some time to create a simple patch to enable the optional suppression of version output to the console. It is based on a new system property called "gnu.io.rxtx.NoVersionOutput" which can by set to "true" if necessary. I had some problems accessing CVS, therefore I downloaded the rxtx-2.1-7r2 source archive from ftp.qbang.org (which is linked on the rxtx.org download page) and worked with that release. Please find my proposed patch in the attachment ! Regards, Christian ----- Original Message ----- From: "Trent Jarvi" To: "RXTX Developers and Users" Cc: ""Paul Gettings"" Sent: Friday, May 05, 2006 2:09 PM Subject: Re: [Rxtx] RXTX causing stdout messages > On Fri, 5 May 2006, Christian Klemke wrote: > >> Hi Paul, >> >> I was wondering about the same question some days ago and took a look at >> the >> source files. Unfortunately, I found that you can only get rid of that >> messages by altering and recompiling the Java code. There is a final >> static >> boolean variable called "devel" in the file "RXTXCommDriver.java" which >> is >> set to "true". This constellation causes the output after the native >> libraries have been loaded. No mechanism exists to suppress them >> otherwise >> :-(. >> >> Trent, does that mean that 2.1.7 is still officially a "development" >> version >> ? When will this value be changed to "false" by default ? With 2.1.8 ? It >> would be nice to provide a means to suppress such messages besides that >> static flag (maybe by setting a property called >> "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The >> output can indeed by annoying, especially when used with console >> applications, where the message potentially appears "in the middle" of >> your >> own output. Another possibility would be not to use System.out directly, >> but >> instead some PrintStream field which is initially set to System.out but >> can >> programatically be changed. That would allow for any kind of redirection >> or >> suppression by implementing appropriate user-defined PrintStream >> subclasses >> and making RXTX use that stream. What do you think ? >> > > A patch for using properties would be accepted I'm sure. > > The reason the default is to display the message is not related to the > development state of rxtx anymore. The problem is that people first using > rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. > The message prevents a great deal of email thats easily explained by the > message. > > I question if we should support rxtx 2.0 at all anymore. > > If you post a patch in bugzilla, we'll put it into CVS this weekend. > we'll be going through and doing such things anyhow. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_version_output_patch.diff Type: application/octet-stream Size: 991 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060515/3173c2b6/rxtx_version_output_patch-0009.obj From lyon at docjava.com Mon May 15 06:06:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 May 2006 08:06:21 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Joachim makes several good points. Let me see if I can address some of them below: >Hello Douglas, > >Looking at the current code, leaves me with the feeling, that there? >is a lot to do. Yes! >Defining an API that wraps javax.comm to provide what? >you describe is certainly possible, but I wonder how much benefit it? >will actually provide. > >Personally I think the API defined by javax.comm > >"request/lock" a port with: > cp= new CommunicationPort(identifier) >"release" a port with: > cp.close(); > >works quite nice for 99% of the applications. I don't know what percentage of applications turn off locking, the way that I do in my version of the RXTX lib. I do know that this is not safe practice. I also know that it was motivated by the multi-platform nature of my code and that this was the only way I could make things work, at the time. Java does not appear to have a cross-platform standard for locking resources on various platforms. Each OS appears to have its own standard. The question of who breaks deadlocks and how this is done remains open, as this is not an easy question to resolve. Let me continue, below: > >In my experience, the most efficient and elegant implementation is to? >wrap a port/socket/.. into a business object which declares the? >remote operations that are possible. Ie "uploadFile",? >"waitForPrompt", "getSerialNumber", "sendContact", "executeCommand",? >etc Those methods are then either synchronized or guarded by a? >monitor. I do not see how your design pattern applied to the port? >resource would help implementing this. I have no problem with high-level wrappers that are application specific. That is a very good idea, but orthogonal with respect to the issue of deadlocks. More below: > >[details start, skip if you agree to the above] >When I talked about "thread-safe" I didn't mean several independent? >"sessions" accessing the port concurrently. I think this is a very? >rare usage. That is probably why turning locking off works so well! On the other hand, it is not safe and I shouldn't do it. >I believe the most common use case for serial ports today? >is the control of an external device from a PC running a GUI based? >application. To implement a clean Swing/AWT-GUI one needs to pass any? >action that can block to a "worker" thread (else the GUI blocks, the? >application appears dead). While it is possible to use own prespawned? >thread that will accept Runnables which operate on the port, this is? >not very elegant. It is more common to spawn a new thread for every? >action triggered by the user. Additionally the ABORT of a running? >operation is often implemented via a port.close() delegated to a? >different thread. Here lies the heart of serial port concern. An application opens a serial port and then dies. The application is restarted and finds the port locked. How do we clear the lock? Must the application's user reside in the UUCP group? Must installers of the serial port add users to the UUCP group? Should locking be handled at a high-level of abstraction in an operating system independent way? Should the implementation of the locking mechanism be translated into an API that is dependent on the OS convention? Suppose that we restrict the discussion to serial ports. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on inconsistent naming conventions. Hence my feeling that we need to mirror what is done in other API's; we need a locking toolkit that references peer methods, IMHO. >From the Java programming point of view, the locking API is portable across different platforms, but has, as its implementation, a native peer method that uses the conventions of the underlying OS. This enables portable resource locking (in theory!). Consider, for example: org.apache.commons.transaction.locking with: Interface LockManager at: http://jakarta.apache.org/commons/transaction/apidocs/org/apache/commons/transaction/locking/LockManager.html Or, more recently: java.util.concurrent.locks Interface Lock based on Doug Lea's code: http://kickjava.com/src/EDU/oswego/cs/dl/util/concurrent/ReadWriteLock.java.htm Should we incorporate a clean, portable design into serial port use, one that is consistent with current locking APIs? Basically, a comm port is a resource and resources are typically controlled by managers. Thus, I suggest that we make use of a CommPortManager to help control and centralize serial port usage. The question of how this is done remains open, IMHO, but using core API's like: java.util.concurrent.locks might not be amiss. High-level methods (getAllPorts, getAllSerialPorts, getAllParallelPorts, etc...) might be welcome additions. Basic questions like, "what if a port is in use?" remain open, hence my proposal for the new design pattern. Isn't it the CommPortManager's role to break the deadlock? Cheers! - Doug > >- During the lifetime of a port, it will usually be accessed from? >several different threads. Instance variables need to be set/read in? >synchronized regions to guarantee a correct operation based on the? >Java memory model. >- Synchronizing the access is usually handled on the application? >level (synchronizing the reads/writes is usually useless from the? >applications view because it is not a transaction mechanism). >[details end] > >I am very open to learn about other scenarios where your proposed? >design pattern applied to the port resource is beneficial to the? >application implementor. > >Best regards, >Joachim > >On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > >> Dmitry suggests that we acquire an implementation of >> a serial port reference, use it, then release it (i.e., check it? >> back in). >> > > Joachim says that making serial ports thread friendly might be a? >> good idea. >> >> This is a good idea. The design pattern that is close to this idea >> is the "Object Pool Design Pattern". >> # Object Pool > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Mon May 15 06:58:19 2006 From: joachim at buechse.de (Joachim Buechse) Date: Mon, 15 May 2006 14:58:19 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Doug, I agree fully, that locking of the system resource should be abstracted from the user (programmer). Currently this is already the case, but I agree it might be nice to extract the code into a separate class, which uses platform dependent providers to do its job. What I described in my email was not targeted at allocating the system resource, but at handling an already allocated system resource inside the framework. I agree that it may be possible to combine the two - however, I would suggest to do this in phase2. I can contribute a work over of RXTXPort.java which implements clean internal locking and proper close behavior (which I would call phase 1). I could do this this week. However I strongly believe that there is little sense in trying to do this as a series of patches. It will be closer to a rewrite than to a patch. I have already provided a number of suggested patches via Bugzilla, but this is quite inconvenient (for me). My working copy diverges more and more from the master and hence it gets more and more annoying to provide self contained patches. Best regards, Joachim From tjarvi at qbang.org Mon May 15 08:27:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 May 2006 08:27:51 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Mon, 15 May 2006, Joachim Buechse wrote: > Hello Doug, > > I agree fully, that locking of the system resource should be > abstracted from the user (programmer). Currently this is already the > case, but I agree it might be nice to extract the code into a > separate class, which uses platform dependent providers to do its job. > > What I described in my email was not targeted at allocating the > system resource, but at handling an already allocated system resource > inside the framework. I agree that it may be possible to combine the > two - however, I would suggest to do this in phase2. > > I can contribute a work over of RXTXPort.java which implements clean > internal locking and proper close behavior (which I would call phase > 1). I could do this this week. > > However I strongly believe that there is little sense in trying to do > this as a series of patches. It will be closer to a rewrite than to a > patch. I have already provided a number of suggested patches via > Bugzilla, but this is quite inconvenient (for me). My working copy > diverges more and more from the master and hence it gets more and > more annoying to provide self contained patches. > For methodical testing purposes (which does go on) the incremental patches are better. I'm lagging behind in bugzilla but thats soon to change (this week). It has just been rather chaotic up until now. I moved, purchased a house, and jumped into the fire of a feature freeze timeframe at a new job. btw, we see the Solaris close issues on 2.8 also. 9 and 10 are fine. I'll work towards making those test results public and allow others to run new rxtx code through them. We had the OK at one point but setting up the environment is involved. It isn't just a collection of java classes. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Tue May 16 02:01:47 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:01:47 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] Message-ID: <446986EB.209@willicon.de> Hi, any ideas for my problem? Hans -------- Original-Nachricht -------- Betreff: [Rxtx] Problem under Mac OSX 10.3.9 Datum: Mon, 08 May 2006 18:47:20 +0200 Von: WILLICon Antwort an: RXTX Developers and Users An: RXTX Developers and Users Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/b0741c2b/attachment-0009.html From joachim at buechse.de Tue May 16 02:15:08 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 10:15:08 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: Hello Hans, I am using RXTX on OS X for my own project. I do not see the problem you describe. I had some troubles installing it because the current version uses lock files which is non-standard on OS X. I have created a patched version which I currently use. This version does not need to modify user groups and hence does not need an installer. I just pop it in the application directory. If you send me a link where I can download your OSX installer, I will have a quick look. Regards, Joachim On 16.05.2006, at 10:01, WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we > have some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + > spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + > spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always > the value "false". > I can only get the status, while I open the port and catch the > exception. > > Any ideas? > > Hans > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail at willicon.de Tue May 16 02:26:53 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:26:53 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: References: <446986EB.209@willicon.de> Message-ID: <44698CCD.7050709@willicon.de> Joachim, tanks for the answer. I'll send You a mail. Hans Joachim Buechse schrieb: > Hello Hans, > > I am using RXTX on OS X for my own project. I do not see the problem > you describe. > > I had some troubles installing it because the current version uses > lock files which is non-standard on OS X. I have created a patched > version which I currently use. This version does not need to modify > user groups and hence does not need an installer. I just pop it in > the application directory. If you send me a link where I can download > your OSX installer, I will have a quick look. > > Regards, > Joachim > > On 16.05.2006, at 10:01, WILLICon wrote: > > >> Hi, >> >> any ideas for my problem? >> >> Hans >> >> -------- Original-Nachricht -------- >> Betreff: [Rxtx] Problem under Mac OSX 10.3.9 >> Datum: Mon, 08 May 2006 18:47:20 +0200 >> Von: WILLICon >> Antwort an: RXTX Developers and Users >> An: RXTX Developers and Users >> >> >> Hi, >> >> I use for RXTX for communicate with CyclingComputers. >> >> It works good under Win32, Sloaris and Linux but with Mac OSX we >> have some problems. >> >> My users install the Mac OSX serial lib from the actual binary. >> >> After starting the program, they get this error message: >> >> java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while >> loading gnu.io.RXTXCommDriver >> >> Remember, this error comes only under Mac OSX. >> >> That is the code for the error: >> >> Enumeration portList = CommPortIdentifier.getPortIdentifiers(); >> spInUse = getBundleStr("serialPortInUse"); >> spFree = getBundleStr("serialPortFree"); >> while (portList.hasMoreElements()) { >> CommPortIdentifier portId = (CommPortIdentifier) >> portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (osName != null && osName.startsWith("mac")) { >> if (!portId.getName().startsWith("dev/cu.")) { >> continue; >> } >> } >> if (portId.isCurrentlyOwned()) { >> serialPortNames.add(portId.getName() + " - " + >> spInUse); >> } >> else { >> serialPortNames.add(portId.getName() + " - " + >> spFree); >> } >> } >> } >> if (serialPortNames.size() == 0) { >> serialPortNames.add(getBundleStr("serialPortNotFound")); >> } >> >> BTW: The methode isCurrentlyOwned() is not working. I get always >> the value "false". >> I can only get the status, while I open the port and catch the >> exception. >> >> Any ideas? >> >> Hans >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/948333be/attachment-0009.html From jredman at ergotech.com Tue May 16 07:35:52 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 16 May 2006 07:35:52 -0600 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: <4469D538.6070408@ergotech.com> Hans, I have no direct insight, but would note that what you have is a "NoClassDefFoundError" not a "ClassNotFoundException". So the class javax/comm/CommDriver is found, but one of its dependencies is missing. NoClassDefFoundError are a bigger problem to resolve because you get no indication of the real problem. Jim WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we have > some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > * spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always the > value "false". > I can only get the status, while I open the port and catch the exception. > > Any ideas? > > Hans > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.de Tue May 16 08:01:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 16:01:21 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 In-Reply-To: <4469AFC3.6000002@willicon.de> References: <44698EBC.8000008@willicon.de> <8C5680C4-E2BA-42FF-B221-36E1124FA6A4@buechse.de> <4469AFC3.6000002@willicon.de> Message-ID: <9825A602-D6ED-4C28-BF33-9A7C984FACD5@buechse.de> Hallo Hans, you include RXTX 2.17 in your "bikeXexperience.jar" (2.17 uses Interfaces from gnu.io.* not javax.comm.*). Now inspect your error log closely: The class gnu.io.RXTXCommDriver tries to load javax.comm.CommDriver: this is only the case for RXTX 2.07. I assume, that the user has installed Version 2.07 into one of the java.ext.dirs . The VM always tries to load classes from the "system" path first. The current Mac installer distributed with RXTX in fact installs RXTXcomm.jar and librxtxSerial.jnilib into /Library/Java/Extensions. (I wrote some time ago that I consider this as a bad idea because of potential version conflicts-> thanks for delivering the example). For 2.07 it does so without installing the javax.comm classes it seems. I would recommend that you instruct your users to install version 2.17 only. Until RXTX is changed to use TIOCEXCL instead of lock files, you can hardly avoid the installer, as the user needs to be added to a special group and a lockfile directory needs be created. More precisely you are waiting for: http://bugzilla.qbang.org/show_bug.cgi?id=50 [RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL)] Regards, Joachim -------------- next part -------------- A non-text attachment was scrubbed... Name: log.tiff Type: image/tiff Size: 38394 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/e3e52128/log-0009.tiff -------------- next part -------------- > > Ich verwende RXTX 2.17. Das orginal RXTXcomm.jar ist in > CyclingDataManager.jar enthalten. > From tjarvi at qbang.org Wed May 17 23:18:15 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 May 2006 23:18:15 -0600 (MDT) Subject: [Rxtx] update Message-ID: So we have several patches and these have stacked up. I'd like to thank everyone for being patient. Tests for the most intrusive patches look good so far. I still have to get some bits together on my end but it looks like we can catch everything up in CVS this week. I'll try to post a normal list of what went in by whom with links Saturday. But I'm not seeing anything that raises flags yet. I also think I'll be able to submit a patch for nonstandard baud rates. I have to confirm w32 but I think its going to be a one line fix. I don't know if its bugzilla or people tinkering with patch files before submitting but patches are not applying cleanly. So the patches have to be done by hand. This may make things difficult for people hoping to add other patches on top. I'm trying to make that go well but ... -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Thu May 18 02:23:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 May 2006 10:23:47 +0200 Subject: [Rxtx] update In-Reply-To: References: Message-ID: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Hello Trent, in fact I tinkered with the patches (never used this mechanism before, usually I "communicate" via cvs) ... so sorry for any trouble you had applying them. Basicly I edited the patches to make them self contained. Having the tests run with different speeds on different platforms, may well be an effect of caching. I have seen quite interesting propagation delays for the closing flag on my PowerPC system, which makes me doubt, that the propagation of output_buffer_empty_flag works as it should. Maybe the communication mechanism between the two threads should be replaced by something like pthread_cond_*. Could you describe which problems you see on Solaris/SPARC? I'd be interested to see if they exist on OS X (PowerPC) as well... As you seem to work on the stuff at the moment I would like to suggest the following additions (it looks more than it is, I posted some context to make clear where to apply the change). See the comments in braces for what was changed Greetings, Joachim (1) The end of the drain loop could be: --- report("drain_loop: received EINTR in tcdrain\n"); --- (added "in tcdrain" to make debug output clearer) (2) The start of the drain loop should be: --- for(i=0;;i++) { report_verbose("drain_loop: looping\n"); #if defined(__sun__) /* FIXME: No time to test on all OS's for production */ if( eis->eventloop_interrupted ) { goto end; } if (usleep(5000)) { report("drain_loop: received EINTR"); } #else if (usleep(1000000)) { report("drain_loop: received EINTR"); } #endif /* __sun__ */ --- (added a check for "eis->eventloop_interrupted" before the sleep) (3) The end of interrupt_event_loop could (and maybe should) be: --- #if !defined(TIOCSERGETLSR) && !defined(WIN32) /* make sure that the drainloop unblocks from tcdrain */ pthread_kill(index->drain_tid, SIGABRT); /* TODO use wait/join/SIGCHLD/?? instead of sleep? */ usleep(50 * 1000); /* Under normal conditions, SIGABRT will unblock tcdrain. However a non-responding USB device combined with an unclean driver may still block. This is very ugly because it may block the call to close indefinetly. */ if (index->closing != 1) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); index->closing = 1; } #endif report("interruptEventLoop: interrupted\n"); --- (added some comments and pthread_cancel for resisting drain thread) On 18.05.2006, at 07:18, Trent Jarvi wrote: > > So we have several patches and these have stacked up. I'd like to > thank > everyone for being patient. > > Tests for the most intrusive patches look good so far. I still > have to > get some bits together on my end but it looks like we can catch > everything > up in CVS this week. > > I'll try to post a normal list of what went in by whom with links > Saturday. But I'm not seeing anything that raises flags yet. I also > think I'll be able to submit a patch for nonstandard baud rates. > I have > to confirm w32 but I think its going to be a one line fix. > > I don't know if its bugzilla or people tinkering with patch files > before > submitting but patches are not applying cleanly. So the patches > have to > be done by hand. This may make things difficult for people hoping > to add > other patches on top. I'm trying to make that go well but ... > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu May 18 22:28:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 18 May 2006 22:28:00 -0600 (MDT) Subject: [Rxtx] update In-Reply-To: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> References: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Message-ID: On Thu, 18 May 2006, Joachim Buechse wrote: > Hello Trent, > > in fact I tinkered with the patches (never used this mechanism > before, usually I "communicate" via cvs) ... so sorry for any trouble > you had applying them. Basicly I edited the patches to make them self > contained. I think we are close to moving towards that. > > Having the tests run with different speeds on different platforms, > may well be an effect of caching. I have seen quite interesting > propagation delays for the closing flag on my PowerPC system, which > makes me doubt, that the propagation of output_buffer_empty_flag > works as it should. Maybe the communication mechanism between the two > threads should be replaced by something like pthread_cond_*. Could > you describe which problems you see on Solaris/SPARC? I'd be > interested to see if they exist on OS X (PowerPC) as well... This is interesting. I have seen problems with output buffer empty in applications that require it. I'm trying to get a bug list and or test results open for everyone to see but that may take time. But missed output buffer events ... yep. With Sparc, we have seen a few things. One was a kernel race condition that went away when we reimaged and updated 2.8. RXTX was hanging on close, top showed no cpu use but there was 2 second delays just typing on console. The other is our tests now take ~4 times longer on Solaris. Someone is looking at timing just open, close, read, write, ... to see if they can find where the slowdown is. This happened after solaris 2.8. I'll try to share more when/if there is something interesting. This may well not be solvable in userland. > > As you seem to work on the stuff at the moment I would like to > suggest the following additions (it looks more than it is, I posted > some context to make clear where to apply the change). See the > comments in braces for what was changed I'll take a look. This could all come together Saturday but I also have an event to attend that day. I may not wrap this up until Sunday. -- Trent Jarvi tjarvi at qbang.org From andrewlord at internode.on.net Sun May 21 20:10:02 2006 From: andrewlord at internode.on.net (Andrew Lord) Date: Mon, 22 May 2006 11:40:02 +0930 Subject: [Rxtx] Kernel include files do not match kernel Message-ID: <200605221140.03271.andrewlord@internode.on.net> Hi, I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel 2.6.12-18 with the command: ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include However I get the message: ## checking java.version 1.5.0_06 ## checking os.version 2.6.12-18mdk ## ## WARNING: Kernel include files do not match the current kernel ## ## configure: creating ./config.status etc. Is there a problem with the way I'm specifying the 'include' directory ? If not, how else can I specify the correct directory for the include files please ? Cheers, Andrew From tjarvi at qbang.org Sun May 21 20:31:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 May 2006 20:31:31 -0600 (MDT) Subject: [Rxtx] Kernel include files do not match kernel In-Reply-To: <200605221140.03271.andrewlord@internode.on.net> References: <200605221140.03271.andrewlord@internode.on.net> Message-ID: On Mon, 22 May 2006, Andrew Lord wrote: > Hi, > > I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel > 2.6.12-18 with the command: > > ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk > CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include > > However I get the message: > > ## checking java.version 1.5.0_06 > ## checking os.version 2.6.12-18mdk > ## > ## WARNING: Kernel include files do not match the current kernel > ## > ## configure: creating ./config.status > etc. > > Is there a problem with the way I'm specifying the 'include' directory ? If > not, how else can I specify the correct directory for the include files > please ? > Hi Andrew I'm fairly sure your --with-kernel option does nothing. The CPPFLAGS should do what you want. Maybe put an #error message in /usr/src/linux.../incude/linux/version.h But I don't recall a recent problem with version missmatches. It should work. Distros will even ship include files that don't match versions exactly. In theory it should never matter for users. I used to compile new kernels by hand and really didnt have a distro. I didnt have a seperate package of kernel headers for users (myself). When changing a gateway from linux 1.2.12 to 2.1.77, I would worry about such messages. So if you are doing something that weird, the message may be of use to you. If you just see the message on a distro you installed, it is more than likely harmless. -- Trent Jarvi tjarvi at qbang.org From mrogers at spro.net Mon May 22 14:45:39 2006 From: mrogers at spro.net (Mike Rogers) Date: Mon, 22 May 2006 14:45:39 -0600 Subject: [Rxtx] Sun's CommAPI -- think May? Message-ID: <447222F3.9040302@spro.net> Hi, Any word from Sun about progress towards fixing the Java CommAPI v3 "incompatibilities" so RXTX 2.0 can operate within the framework's namespace (javax.comm)? I recall mention of a May time frame. Thanks, Mike From paul.klissner at sun.com Mon May 22 15:09:27 2006 From: paul.klissner at sun.com (Paul Klissner) Date: Mon, 22 May 2006 14:09:27 -0700 Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <447222F3.9040302@spro.net> References: <447222F3.9040302@spro.net> Message-ID: <44722887.8080308@sun.com> Mike Rogers wrote: > Hi, > > Any word from Sun about progress towards fixing the Java CommAPI v3 > "incompatibilities" so RXTX 2.0 can operate within the framework's > namespace (javax.comm)? I recall mention of a May time frame. > > Thanks, > > Mike > We've had a lot of work come in. This hasn't been the only priority. I'm running behind the plan in addressing this, but will be looking at it again soon. Rather than state a new, I'll just say it is in progress, and not off the table. I'll get this fixed as soon as I can. Good timing for asking as we just started discussing javax.comm plans today, and I'll have some cycles to work on it soon. Paul From yhua537 at cse.unsw.edu.au Mon May 22 16:03:05 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Tue, 23 May 2006 08:03:05 +1000 (EST) Subject: [Rxtx] install rxtx in XP Message-ID: Hi Guys, I am new to serial port programming, and have no experience on programming java in xp, but my project require me to builld a communication link between xp and a UART device. Most of the information in the web site seems for linux only. including the commands such as export and chmod. How do I install rxtx in xp? cheers YiQi Huang From mark at mdsh.com Tue May 23 01:24:20 2006 From: mark at mdsh.com (Mark Himsley) Date: Tue, 23 May 2006 08:24:20 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off , it includes DLLs for Windows and the JAR for Java. Follow the Windows instructions in the INSTALL. ie RXTXcomm.jar goes in \jre\lib\ext (under java) rxtxSerial.dll goes in \jre\bin So, assuming a fairly standard Java install, copy RXTXcomm.jar into C:\Program Files\Java\jre1.5.0_06\lib\ext and copy rxtxSerial.dll into C:\Program Files\Java\jre1.5.0_06\bin Yes, it really is that simple. On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > I am new to serial port programming, and have no experience on > programming java in xp, but my project require me to builld a > communication link between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang -- Mark Himsley From joachim at buechse.de Tue May 23 02:51:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 23 May 2006 10:51:47 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) Unless it is absolutely required you should NOT install RXTX in your global Java Runtime Environment. This will for sure create versioning conflicts - if not now, than in the future, if not on your system than at your clients. Instead put the dll in your application directory and include the RXTXcomm.jar in your classpath. This is much safer and not a bit more complicated. Regards, Joachim On 23.05.2006, at 09:24, Mark Himsley wrote: > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR > for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > >> I am new to serial port programming, and have no experience on >> programming java in xp, but my project require me to builld a >> communication link between xp and a UART device. >> >> Most of the information in the web site seems for linux only. >> including >> the commands such as export and chmod. How do I install rxtx in xp? >> >> cheers >> YiQi Huang > > > > -- > Mark Himsley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tod at todbot.com Tue May 23 03:12:22 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 02:12:22 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I totally agree: do not contaminate the Java installation. I put all the RXTX files in a directory and then change my java invocation to be: % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* Alternatively, use Launch4J to create a double-clickable application and keep the RXTX libraries in the directory of the application. -=tod On May 23, 2006, at 1:51 AM, Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > >> Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off >> , it includes DLLs for Windows and the JAR >> for Java. >> >> Follow the Windows instructions in the INSTALL. >> >> ie >> >> RXTXcomm.jar goes in \jre\lib\ext (under java) >> rxtxSerial.dll goes in \jre\bin >> >> So, assuming a fairly standard Java install, copy RXTXcomm.jar into >> C:\Program Files\Java\jre1.5.0_06\lib\ext >> and copy rxtxSerial.dll into >> C:\Program Files\Java\jre1.5.0_06\bin >> >> Yes, it really is that simple. >> >> >> >> On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: >> >>> I am new to serial port programming, and have no experience on >>> programming java in xp, but my project require me to builld a >>> communication link between xp and a UART device. >>> >>> Most of the information in the web site seems for linux only. >>> including >>> the commands such as export and chmod. How do I install rxtx in xp? >>> >>> cheers >>> YiQi Huang >> >> >> >> -- >> Mark Himsley >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From smontgomery at mediaspansoftware.com Tue May 23 08:46:53 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Tue, 23 May 2006 10:46:53 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: Message-ID: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Joachim and Tod mentioned how to keep the files RXTX requires on Windows XP out of the Java installations - thanks gentlemen! Are there similar suggestions for an RXTX install on OS X? The current "canonical" OS X installation instructions "contaminate the Java installation", to use Tod's words. Our app will run fine under 1.4.2 and 5.0 on OS X, and a lot of users will have both. We've already been burned by the recent switch from 1.4.2 to 5.0 as the platform default. Any suggestions welcomed. From tod at todbot.com Tue May 23 13:27:55 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 12:27:55 -0700 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <9BA0F670-A862-42E7-BB2C-130D775ABDF9@todbot.com> Hi Sean, It depends on how you build and deploy your code. If you're using shell scripts, you can do something like this: #!/bin/sh # pick one JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/ Commands/java #JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/ Commands/java $JAVA -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* That both picks which VM to use and uses the RXTX in the directory called 'rxtxlib'. If you want your shell script to be clever, you could test for the existence of the different 'java' executables and go from there (maybe even use different jar files). I am almost positive all OS X systems with Java 1.5 are guaranteed to also have Java 1.4.2. If you're using Jar Builder or XCode, you can specify which JVM to use and add the extra args in the Info.plist file. The paths specified in the 'java' invocation then are based off of the $JAVAROOT variable that the JavaApplicationStub sets for you. For my app, I've have been compiling two sets of jars, one compiled with 1.4.2 and one with 1.5, but they both run under 1.5. So I have a similar shell script that chooses a different 'javac' depending on the need. -=tod On May 23, 2006, at 7:46 AM, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From yhua537 at cse.unsw.edu.au Tue May 23 11:09:37 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 03:09:37 +1000 (EST) Subject: [Rxtx] install rxtx in XP (Mark Himsley, Joachim Buechse, Tod E. Kurt> In-Reply-To: References: Message-ID: > Message: 8 > Date: Tue, 23 May 2006 08:03:05 +1000 (EST) > From: YiQi Huang > Subject: [Rxtx] install rxtx in XP > To: rxtx at qbang.org > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > Hi Guys, > > I am new to serial port programming, and have no experience on programming > java in xp, but my project require me to builld a communication link > between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang > > > ------------------------------ > > Message: 9 > Date: Tue, 23 May 2006 08:24:20 +0100 > From: Mark Himsley > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=us-ascii; format=flowed > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > ------------------------------ > > Message: 10 > Date: Tue, 23 May 2006 10:51:47 +0200 > From: Joachim Buechse > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > > ------------------------------ > > Message: 11 > Date: Tue, 23 May 2006 02:12:22 -0700 > From: "Tod E. Kurt" > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I totally agree: do not contaminate the Java installation. > > I put all the RXTX files in a directory and then change my java > invocation to be: > > % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* > > Alternatively, use Launch4J to create a double-clickable application > and keep the RXTX libraries in the directory of the application. > > -=tod > > Hi, Thanks guys, I don't know if this is the correct way to reply your mecessage, if wrong, please point out. Thank you for Mark to give the detail instructions and Joachim to point out the cons ot installing in the java directory, and specially thanks for Tod to give the instrection in detail. Sorry to ask another stupid question: I have followed Tod's instruction. Now I think i am ready to start hacking. But where is the RXTX API documentation? Is it the same as using normal java comm API? btw, where could i find some examples to start with? Thanks very much cheers YiQi Huang From tjarvi at qbang.org Tue May 23 16:09:32 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 May 2006 16:09:32 -0600 (MDT) Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <44722887.8080308@sun.com> References: <447222F3.9040302@spro.net> <44722887.8080308@sun.com> Message-ID: > Good timing for asking as we just started discussing javax.comm plans > today, and I'll have some cycles to work on it soon. Hi Paul I assume you mean Sun is discussing plans concerning its own internal actions and there is no community involvment at this point. -- Trent Jarvi tjarvi at qbang.org From yhua537 at cse.unsw.edu.au Tue May 23 22:50:01 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 14:50:01 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } From mmester at sps.edu Tue May 23 22:58:21 2006 From: mmester at sps.edu (Michael Mester) Date: Wed, 24 May 2006 00:58:21 -0400 Subject: [Rxtx] install rxtx in XP References: Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below -----Original Message----- From: rxtx-bounces at qbang.org on behalf of YiQi Huang Sent: Wed 5/24/2006 12:50 AM To: RXTX Developers and Users Subject: Re: [Rxtx] install rxtx in XP Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3950 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060523/b36d0c63/attachment-0009.bin From yhua537 at cse.unsw.edu.au Tue May 23 23:05:50 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 15:05:50 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: Yes, Michael you are right, it should be semicolons, But it still can't find the correct library. On Wed, 24 May 2006, Michael Mester wrote: > I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below > > > -----Original Message----- > From: rxtx-bounces at qbang.org on behalf of YiQi Huang > Sent: Wed 5/24/2006 12:50 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] install rxtx in XP > > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > cheers YiQi Huang From tod at todbot.com Wed May 24 00:01:57 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 23:01:57 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Yes, sorry, classpath entries are semicolon-separated on Windows and colon-separated on everything else. Your example code below is importing the wrong set of classes. It should not "import javax.comm.*", instead it should "import gnu.io.*". When I make that change, your example program compiles. The "javax.comm" package is the one released by Sun, the "gnu.io" package is the RXTX one. You might've seen some discussion that the two will be merged or become compatible, but that hasn't happened yet. -=tod On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > > Yes, Michael you are right, it should be semicolons, But it still > can't > find the correct library. > > On Wed, 24 May 2006, Michael Mester wrote: > >> I believe the entries in the classpath need to be seperated with >> semicolons, not a colon as you have in your command below >> >> >> -----Original Message----- >> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >> Sent: Wed 5/24/2006 12:50 AM >> To: RXTX Developers and Users >> Subject: Re: [Rxtx] install rxtx in XP >> >> Hi, >> >> Sorry guys.I follow Tod's instruction, and here is what i did: >> >> put >> RXTXcomm.jar, >> rxtxParallel.dll, >> rxtxSerial.dll >> in >> C:\RXTX_files >> >> and I got a SimpleRead class attached below, compile it with : >> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >> it still saying "cannot find symbol". >> >> Is there anything I did wrong? Do I need the comm.jar from Sun? >> >> Thanks & regards >> YiQi Huang >> >> >> //////////////////////////////////////////////////////// >> // SimpleRead.java >> //////////////////////////////////////////////////////// >> >> import java.io.*; >> import java.util.*; >> import javax.comm.*; >> >> public class SimpleRead >> implements Runnable, SerialPortEventListener { >> static CommPortIdentifier portId; >> static Enumeration portList; >> InputStream inputStream; >> SerialPort serialPort; >> Thread readThread; >> public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == >> CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals("COM1")) { >> //if (portId.getName().equals("/dev/term/a")) { >> SimpleRead reader = new SimpleRead(); >> } >> } >> } >> } >> public SimpleRead() { >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", >> 2000); >> } catch (PortInUseException e) {} >> try { >> inputStream = serialPort.getInputStream(); >> } catch (IOException e) {} >> try { >> serialPort.addEventListener(this); >> } catch (TooManyListenersException e) {} >> serialPort.notifyOnDataAvailable(true); >> try { >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } catch (UnsupportedCommOperationException e) {} >> readThread = new Thread(this); >> readThread.start(); >> } >> public void run() { >> try { >> Thread.sleep(20000); >> } catch (InterruptedException e) {} >> } >> public void serialEvent(SerialPortEvent event) { >> switch(event.getEventType()) { >> case SerialPortEvent.BI: >> case SerialPortEvent.OE: >> case SerialPortEvent.FE: >> case SerialPortEvent.PE: >> case SerialPortEvent.CD: >> case SerialPortEvent.CTS: >> case SerialPortEvent.DSR: >> case SerialPortEvent.RI: >> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >> break; >> case SerialPortEvent.DATA_AVAILABLE: >> byte[] readBuffer = new byte[20]; >> try { >> while (inputStream.available() > 0) { >> int numBytes = inputStream.read(readBuffer); >> } >> System.out.print(new String(readBuffer)); >> } catch (IOException e) {} >> break; >> } >> } >> } >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > cheers > YiQi Huang > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From joachim at buechse.de Wed May 24 00:10:06 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:10:06 +0200 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Hi Sean, my preferred way of dealing with RXTX on OS X is to include the RXTX classes into my application jar and to put the RXTX lib in the same directory as this jar. To make it even more comfortable, you can include the lib in the jar and have some startup code extract it and write it to a temporary file from which you load it with System.load(). Unfortunately the current version of RXTX for OS X requires tinkering with user groups as it is based on lockfiles - and hence it needs the RXTX OS X installer or you need to duplicated this functionality in your own installer. I have created my own native version which is not based on lockfiles but tty locking (the standard way to do it on OSX). I hope that these patches will be integrated soon into the distribution. Regards, Joachim On 23.05.2006, at 16:46, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Wed May 24 00:16:12 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:16:12 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <7017ECFC-B13E-4806-B321-9FFCAC5830F0@buechse.de> I assume you downloaded rxtx-217 (not 207). Instead of importing javax.comm.* you must import gnu.io.* The classes have the same name, but they are not in the same package. On 24.05.2006, at 06:50, YiQi Huang wrote: > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From yhua537 at cse.unsw.edu.au Wed May 24 00:17:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 16:17:45 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Message-ID: Thanks Tod again, i kept reading "gnu.io.*" as "gun.io.*" last few hours after i read some commons from web. Thanks very much Tod. thanks YiQi Huang On Tue, 23 May 2006, Tod E. Kurt wrote: > Yes, sorry, classpath entries are semicolon-separated on Windows and > colon-separated on everything else. > > Your example code below is importing the wrong set of classes. It > should not "import javax.comm.*", instead it should "import > gnu.io.*". When I make that change, your example program compiles. > The "javax.comm" package is the one released by Sun, the "gnu.io" > package is the RXTX one. You might've seen some discussion that the > two will be merged or become compatible, but that hasn't happened yet. > > -=tod > > > On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > >> >> Yes, Michael you are right, it should be semicolons, But it still >> can't >> find the correct library. >> >> On Wed, 24 May 2006, Michael Mester wrote: >> >>> I believe the entries in the classpath need to be seperated with >>> semicolons, not a colon as you have in your command below >>> >>> >>> -----Original Message----- >>> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >>> Sent: Wed 5/24/2006 12:50 AM >>> To: RXTX Developers and Users >>> Subject: Re: [Rxtx] install rxtx in XP >>> >>> Hi, >>> >>> Sorry guys.I follow Tod's instruction, and here is what i did: >>> >>> put >>> RXTXcomm.jar, >>> rxtxParallel.dll, >>> rxtxSerial.dll >>> in >>> C:\RXTX_files >>> >>> and I got a SimpleRead class attached below, compile it with : >>> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >>> it still saying "cannot find symbol". >>> >>> Is there anything I did wrong? Do I need the comm.jar from Sun? >>> >>> Thanks & regards >>> YiQi Huang >>> >>> >>> //////////////////////////////////////////////////////// >>> // SimpleRead.java >>> //////////////////////////////////////////////////////// >>> >>> import java.io.*; >>> import java.util.*; >>> import javax.comm.*; >>> >>> public class SimpleRead >>> implements Runnable, SerialPortEventListener { >>> static CommPortIdentifier portId; >>> static Enumeration portList; >>> InputStream inputStream; >>> SerialPort serialPort; >>> Thread readThread; >>> public static void main(String[] args) { >>> portList = CommPortIdentifier.getPortIdentifiers(); >>> while (portList.hasMoreElements()) { >>> portId = (CommPortIdentifier) portList.nextElement(); >>> if (portId.getPortType() == >>> CommPortIdentifier.PORT_SERIAL) { >>> if (portId.getName().equals("COM1")) { >>> //if (portId.getName().equals("/dev/term/a")) { >>> SimpleRead reader = new SimpleRead(); >>> } >>> } >>> } >>> } >>> public SimpleRead() { >>> try { >>> serialPort = (SerialPort) portId.open("SimpleReadApp", >>> 2000); >>> } catch (PortInUseException e) {} >>> try { >>> inputStream = serialPort.getInputStream(); >>> } catch (IOException e) {} >>> try { >>> serialPort.addEventListener(this); >>> } catch (TooManyListenersException e) {} >>> serialPort.notifyOnDataAvailable(true); >>> try { >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, >>> SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> } catch (UnsupportedCommOperationException e) {} >>> readThread = new Thread(this); >>> readThread.start(); >>> } >>> public void run() { >>> try { >>> Thread.sleep(20000); >>> } catch (InterruptedException e) {} >>> } >>> public void serialEvent(SerialPortEvent event) { >>> switch(event.getEventType()) { >>> case SerialPortEvent.BI: >>> case SerialPortEvent.OE: >>> case SerialPortEvent.FE: >>> case SerialPortEvent.PE: >>> case SerialPortEvent.CD: >>> case SerialPortEvent.CTS: >>> case SerialPortEvent.DSR: >>> case SerialPortEvent.RI: >>> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >>> break; >>> case SerialPortEvent.DATA_AVAILABLE: >>> byte[] readBuffer = new byte[20]; >>> try { >>> while (inputStream.available() > 0) { >>> int numBytes = inputStream.read(readBuffer); >>> } >>> System.out.print(new String(readBuffer)); >>> } catch (IOException e) {} >>> break; >>> } >>> } >>> } >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> >> cheers >> YiQi Huang >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From smontgomery at mediaspansoftware.com Wed May 24 10:24:13 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 12:24:13 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: Tod & Joachim, Thanks for the info, that's very helpful. I'll give that a whirl when I move to rxtx 2.1. I'm still using the older 2.0.7 version for now (don't ask), which probably requires the Sun comm.jar, javax.comm.properties and librxtxSerial.jnilib to be in very specific places in each jvm's file hierarchy. From tjarvi at qbang.org Wed May 24 11:59:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 11:59:16 -0600 (MDT) Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: On Wed, 24 May 2006, Sean Montgomery wrote: > Tod & Joachim, > > Thanks for the info, that's very helpful. I'll give that a whirl > when I move to rxtx 2.1. I'm still using the older 2.0.7 version for > now (don't ask), which probably requires the Sun comm.jar, > javax.comm.properties and librxtxSerial.jnilib to be in very specific > places in each jvm's file hierarchy. > You will need comm.jar from Sun then. It must be Sun's version 2.* or older for Linux or Solaris. I assume they have this in download archives. The default offering from Sun is version 3.0. This version currently does not support rxtx. The older version will probably be fine for your needs. -- Trent Jarvi tjarvi at qbang.org From smontgomery at mediaspansoftware.com Wed May 24 12:19:06 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 14:19:06 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: <3939EFB8-11E1-4E3E-A684-5B3C525577CD@mediaspansoftware.com> Yup, that's right, thanks Trent. I've been using these files for quite a while now. Thanks for bringing it up. I almost didn't mention using 2.0.7 because I didn't want to give any new members of the list the wrong idea! :-) On May 24, 2006, at 1:59 PM, Trent Jarvi wrote: > On Wed, 24 May 2006, Sean Montgomery wrote: > >> Tod & Joachim, >> >> Thanks for the info, that's very helpful. I'll give that a whirl >> when I move to rxtx 2.1. I'm still using the older 2.0.7 version for >> now (don't ask), which probably requires the Sun comm.jar, >> javax.comm.properties and librxtxSerial.jnilib to be in very specific >> places in each jvm's file hierarchy. >> > > You will need comm.jar from Sun then. It must be Sun's version 2.* or > older for Linux or Solaris. I assume they have this in download > archives. > > The default offering from Sun is version 3.0. This version > currently does > not support rxtx. > > The older version will probably be fine for your needs. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mark at mdsh.com Wed May 24 15:55:46 2006 From: mark at mdsh.com (Mark Himsley) Date: Wed, 24 May 2006 22:55:46 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <37B0FC4B1F3237321F093ABE@MacMini.local> On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) That's no problem. BUT, do note that the instructions I elaborated on are in the INSTALL file within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone please update the INSTALL file? > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > > , it includes DLLs for Windows and the JAR > > for Java. > > > > Follow the Windows instructions in the INSTALL. > > > > ie > > > > RXTXcomm.jar goes in \jre\lib\ext (under java) > > rxtxSerial.dll goes in \jre\bin > > > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > > C:\Program Files\Java\jre1.5.0_06\lib\ext > > and copy rxtxSerial.dll into > > C:\Program Files\Java\jre1.5.0_06\bin > > > > Yes, it really is that simple. > > > > > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > > > >> I am new to serial port programming, and have no experience on > >> programming java in xp, but my project require me to builld a > >> communication link between xp and a UART device. > >> > >> Most of the information in the web site seems for linux only. > >> including > >> the commands such as export and chmod. How do I install rxtx in xp? > >> > >> cheers > >> YiQi Huang > > > > > > > > -- > > Mark Himsley > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Mark Himsley From tjarvi at qbang.org Wed May 24 16:41:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 16:41:46 -0600 (MDT) Subject: [Rxtx] install rxtx in XP In-Reply-To: <37B0FC4B1F3237321F093ABE@MacMini.local> References: <37B0FC4B1F3237321F093ABE@MacMini.local> Message-ID: On Wed, 24 May 2006, Mark Himsley wrote: > > > On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > >> I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > That's no problem. > > BUT, do note that the instructions I elaborated on are in the INSTALL file > within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone > please update the INSTALL file? > > The INSTALL file may be updated by anyone at anytime. http://rxtx.qbang.org/wiki/index.php/Installation We are moving it to the wiki so end users may put the type of answers they would like to see in. Sometimes it's best if developers don't give what appears to be cryptic answers. You can even put in that jre/lib/ext is not the right place but you don't understand the classpath solution mentioned on the mail-list and then we know what to add. -- Trent Jarvi tjarvi at qbang.org From stramit at gmail.com Wed May 24 21:45:31 2006 From: stramit at gmail.com (Tim Cooper) Date: Thu, 25 May 2006 13:45:31 +1000 Subject: [Rxtx] Accessing Virtual Com Port Message-ID: Hi, I have to develop an application that talks to a virtual com port (in this case com3) which translates any messages sent across a USB cable to a micro. Using C++ I can talk to this com port and I know that it is configured, present, and working. For the application that I am trying to write I want to use RXTX for the communication. My problem is that the configured virtual port (in windows) is not showing up when I do an enumeration over the available ports. The output I get is (com 3 is not present) : Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 PORT FOUND: COM1 PORT FOUND: LPT1 Is there anything that I need to do to make com3 available to RXTX and my application? Timothy Cooper -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060524/c5591648/attachment-0009.html From antonio.luis at iscte.pt Thu May 25 01:39:13 2006 From: antonio.luis at iscte.pt (=?ISO-8859-1?Q?Ant=F3nio_Lopes?=) Date: Thu, 25 May 2006 08:39:13 +0100 Subject: [Rxtx] RXTX on Pocket PC Message-ID: <44755F21.8060103@iscte.pt> Hello everyone, I've been using RXTX to communicate with serial ports in Windows and it's been quite successful. However, I'm now considering porting my application from Windows to Pocket PC but I can't seem to find the RXTX binaries (*.jar and *.dll) to use in Pocket PC. I've been "digging" on the mailing list's archives and also on the web and I can't find these anywhere. Can anyone in this mailing list give me some pointers on this? Where can I find the necessary files and basic installation instructions? Thanks very much for your help. I very much appreciate any help that you can provide me. Regards, -- Ant?nio Lopes @contact: antonio.luis at iscte.pt @work: ADETTI - ISCTE @web: http://antonio.lopes.googlepages.com/home From doug at dupreeinc.com Fri May 26 15:45:50 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Fri, 26 May 2006 14:45:50 -0700 Subject: [Rxtx] rxtx slow startup Message-ID: <4477770E.9010400@dupreeinc.com> Hello, I hope there are people still reading this mailing list. The archive appeared to not have anything new after 4/2005. I was using the commapi from sun for a project where a java application reads data from test equipment connected to the serial port. I had to upgrade the ftdi vcp driver on my pc and the old sun commapi no longer works with hardware flow control. as an experiment I replaced the javax.com with gnu.io in the SerialDemo.java project that was included with the commapi. This compiled fine using JBuilder 2006 and JRE 1.5.0_05. RXTX also works with the latest ftdi drivers so life is wonderful again... almost... When using the commapi jar the SerialDemo program starts in about 1 second on my system. Using the RXTX jar it takes over 56 seconds to start. Has anyone else seen this problem? Is there a workaround to get the startup performance close to the old commapi? The last thing printed to the console before this delay is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks for your time! Doug From yhua537 at cse.unsw.edu.au Sat May 27 05:46:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 21:46:45 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <4477770E.9010400@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> Message-ID: hi Doug The archive hasn't been update for a long time, But people certainly still reading the list. I don't have enough experience to help on your problem, but without any detail about what your problem doing during that 56 seconds, it is hard to target the your question, I think. cheers YiQi On Fri, 26 May 2006, Doug Thistlethwaite wrote: > Hello, > > I hope there are people still reading this mailing list. The archive > appeared to not have anything new after 4/2005. > > I was using the commapi from sun for a project where a java application > reads data from test equipment connected to the serial port. I had to > upgrade the ftdi vcp driver on my pc and the old sun commapi no longer > works with hardware flow control. as an experiment I replaced the > javax.com with gnu.io in the SerialDemo.java project that was included > with the commapi. This compiled fine using JBuilder 2006 and JRE > 1.5.0_05. RXTX also works with the latest ftdi drivers so life is > wonderful again... almost... > > When using the commapi jar the SerialDemo program starts in about 1 > second on my system. Using the RXTX jar it takes over 56 seconds to > start. Has anyone else seen this problem? Is there a workaround to get > the startup performance close to the old commapi? > > The last thing printed to the console before this delay is: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Thanks for your time! > > Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------- Just a student, Still a student ------------------------------- From yhua537 at cse.unsw.edu.au Sat May 27 06:04:26 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 22:04:26 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: Sorry, I don't think you could understand what I mean .I mean this: Without any detail about what your program is doing during that 56 seconds, it is hard for anyone to target the problem. On Sat, 27 May 2006, YiQi Huang wrote: > hi Doug > > The archive hasn't been update for a long time, But people certainly still > reading the list. > > I don't have enough experience to help on your problem, but without any > detail about what your problem doing during that 56 seconds, it is hard to > target the your question, I think. > > cheers > YiQi > > On Fri, 26 May 2006, Doug Thistlethwaite wrote: > >> Hello, >> >> I hope there are people still reading this mailing list. The archive >> appeared to not have anything new after 4/2005. >> >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From jredman at ergotech.com Sat May 27 08:32:02 2006 From: jredman at ergotech.com (Jim Redman) Date: Sat, 27 May 2006 08:32:02 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: <447862E2.4080506@ergotech.com> Doug, Since you mentioned it, we have a system that is also seems slow. From memory (I don't have one of the slow systems around), I'm not sure that it's consistent, it seems that sometimes it may take longer than others. Since it's part of the bootup it hasn't raised a flag and I haven't researched it. The same code runs much faster on other systems, so now you've got me wondering what's different. The slow system boots DSL (http://www.damnsmalllinux.org/) from a compact flash. FC4 is on my desktop where I haven't noticed a slow down. I think that the rxtx code is the same in both cases with lock files disabled. The slow system has a bunch of serial ports defined, including 4 USB serial ports that do not exist - they are not plugged in. Any clues in there? Jim > On Fri, 26 May 2006, Doug Thistlethwaite wrote: >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Sat May 27 10:41:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 May 2006 10:41:54 -0600 (MDT) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447862E2.4080506@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: On Sat, 27 May 2006, Jim Redman wrote: > Doug, > > Since you mentioned it, we have a system that is also seems slow. From > memory (I don't have one of the slow systems around), I'm not sure that > it's consistent, it seems that sometimes it may take longer than others. > Since it's part of the bootup it hasn't raised a flag and I haven't > researched it. > > The same code runs much faster on other systems, so now you've got me > wondering what's different. > > The slow system boots DSL (http://www.damnsmalllinux.org/) from a > compact flash. FC4 is on my desktop where I haven't noticed a slow > down. I think that the rxtx code is the same in both cases with lock > files disabled. > > The slow system has a bunch of serial ports defined, including 4 USB > serial ports that do not exist - they are not plugged in. > > Any clues in there? > rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. When it does this, it will try to open each port and do a timed out read. most systems will not have entries in device if the port is not there. But some minimal systems will just put all the device files there in case hardware is added. The list of devices scanned used to be ~10-20 times longer than it is today. That was getting very slow. I suspect moving the device files not used to a backup directory would increase the enumeration. I'll look into why the mail-list archive is not updating. The last update was about when I thought I 'fixed' the cron jobs. I probably didn't actually fix it but rather moved the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon May 29 19:46:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 May 2006 19:46:47 -0600 (MDT) Subject: [Rxtx] Mail-List Archives are updating. Message-ID: It was pointed out earlier that the archive is dated. This was a missing crontab entry. The list is currently archived by the week on the web page. It is updated once a day. So every 7 days it starts a new link and updates it daily. I've been limited in what I could do while my cable modem was disconnected this last week. rxtx.org is something I do on my own time. The patches and credits will be comming next. Many of these can be seen in bugzilla right now. -- Trent Jarvi tjarvi at qbang.org From doug at dupreeinc.com Tue May 30 11:18:41 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 10:18:41 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: <447C7E71.4080204@dupreeinc.com> Trent, YiQi, and Jim: Thanks to all for the replies and information! I am just back from a long weekend and I am now trying to figure out what I was doing! :) As for more information. First off, this example is being run under windows XP. I am developing test equipment that communicates with a java application via a serial port. I have been using the commapi for several years and have not had a problem. Recently, I have started a design modification that will replace the RS232 connection with a USB port. I am using the ftdi module for prototyping and I discovered that their virtual com port driver was not compatible with the commapi that Sun released. It turns out that it has problems with hardware flow control ( it works on incoming but not outgoing communications). The way I figured this out was by experimenting with the SerialDemo that was included with the Sum commapi. One nice thing about this example is it has the ability to set incoming and outgoing flow control independently. After I installed RXTX into my JBuilder 2006 IDE, I just replaced all all instances of javax.comm with gnu.io and it compiled and runs without a hitch (except for the slow startup). I Paused the JBuilder IDE during this long pause and the last few entries in the stack trace are: testRead() : -1, gnu.io.RXTXCommDriver registerValidPorts() : 255, gnu.io.RXTXCommDriver registerScannedPorts() : 777, gnu.io.RXTXCommDriver This was all initiated by the following call in the programs init routine: Enumeration en = CommPortIdentifier.getPortIdentifiers(); After looking at this, My guess is that Trent is correct in that the delay is in scanning for ports. I guess one solution would be to not scan for ports, though it would be nice to detect what is available on the system. Is there any way to reduce the number of ports scanned by this function in windows XP? Thanks again for your time, Doug Trent Jarvi wrote: >On Sat, 27 May 2006, Jim Redman wrote: > > > >>Doug, >> >>Since you mentioned it, we have a system that is also seems slow. From >>memory (I don't have one of the slow systems around), I'm not sure that >>it's consistent, it seems that sometimes it may take longer than others. >>Since it's part of the bootup it hasn't raised a flag and I haven't >>researched it. >> >>The same code runs much faster on other systems, so now you've got me >>wondering what's different. >> >>The slow system boots DSL (http://www.damnsmalllinux.org/) from a >>compact flash. FC4 is on my desktop where I haven't noticed a slow >>down. I think that the rxtx code is the same in both cases with lock >>files disabled. >> >>The slow system has a bunch of serial ports defined, including 4 USB >>serial ports that do not exist - they are not plugged in. >> >>Any clues in there? >> >> >> > >rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. > >When it does this, it will try to open each port and do a timed out read. >most systems will not have entries in device if the port is not there. >But some minimal systems will just put all the device files there in case >hardware is added. > >The list of devices scanned used to be ~10-20 times longer than it is >today. That was getting very slow. > >I suspect moving the device files not used to a backup directory would >increase the enumeration. > >I'll look into why the mail-list archive is not updating. The last update >was about when I thought I 'fixed' the cron jobs. I probably didn't >actually fix it but rather moved the problem. > >-- >Trent Jarvi >tjarvi at qbang.org > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/86796453/attachment-0009.html From doug at dupreeinc.com Tue May 30 14:36:09 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 13:36:09 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447C7E71.4080204@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com> Message-ID: <447CACB9.1000801@dupreeinc.com> Hello all, I also notice this pause (not as long however) when I call: CommPortIdentifier.getPortIdentifier(PortName); I would think that if I supply the name of the port, it would not have to go through the same discovery process. If you have any ideas of how to get rid of this startup delay, I would really appreciate it. Thanks, Doug Doug Thistlethwaite wrote: > Trent, YiQi, and Jim: > > Thanks to all for the replies and information! I am just back from a > long weekend and I am now trying to figure out what I was doing! :) > > As for more information. First off, this example is being run under > windows XP. I am developing test equipment that communicates with a > java application via a serial port. I have been using the commapi for > several years and have not had a problem. Recently, I have started a > design modification that will replace the RS232 connection with a USB > port. I am using the ftdi module for prototyping and I discovered > that their virtual com port driver was not compatible with the commapi > that Sun released. It turns out that it has problems with hardware > flow control ( it works on incoming but not outgoing communications). > The way I figured this out was by experimenting with the SerialDemo > that was included with the Sum commapi. One nice thing about this > example is it has the ability to set incoming and outgoing flow > control independently. > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup). > > I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are: > > testRead() : -1, gnu.io.RXTXCommDriver > registerValidPorts() : 255, gnu.io.RXTXCommDriver > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > This was all initiated by the following call in the programs init routine: > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > After looking at this, My guess is that Trent is correct in that the > delay is in scanning for ports. I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system. Is there any way to reduce the number of ports scanned by > this function in windows XP? > > Thanks again for your time, > > Doug > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/edaa5c3c/attachment-0009.html From lynn at swcp.com Tue May 30 15:07:18 2006 From: lynn at swcp.com (lynn@swcp.com) Date: Tue, 30 May 2006 21:07:18 -0000 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CACB9.1000801@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: *IF* the name of the port is supplied, we might want to use the preferences mechanism (java.util.prefs) where we could have previously saved the info for the port. We could do a quick check to see that things have not changed before using it. If things have changed (or never been defined) we would do a full port scan and save detected ports in the preferences. This way if the hardware is not changed, you only pay the time penalty one time. just an idea... Lynn Doug Thistlethwaite said: > This is a multi-part message in MIME format. > --------------070808020900080005070500 > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > Content-Transfer-Encoding: 7bit > > Hello all, > > I also notice this pause (not as long however) when I call: > > CommPortIdentifier.getPortIdentifier(PortName); > > I would think that if I supply the name of the port, it would not have > to go through the same discovery process. If you have any ideas of how > to get rid of this startup delay, I would really appreciate it. > > Thanks, > > Doug > > Doug Thistlethwaite wrote: > > > Trent, YiQi, and Jim: > > > > Thanks to all for the replies and information! I am just back from a > > long weekend and I am now trying to figure out what I was doing! :) > > > > As for more information. First off, this example is being run under > > windows XP. I am developing test equipment that communicates with a > > java application via a serial port. I have been using the commapi for > > several years and have not had a problem. Recently, I have started a > > design modification that will replace the RS232 connection with a USB > > port. I am using the ftdi module for prototyping and I discovered > > that their virtual com port driver was not compatible with the commapi > > that Sun released. It turns out that it has problems with hardware > > flow control ( it works on incoming but not outgoing communications). > > The way I figured this out was by experimenting with the SerialDemo > > that was included with the Sum commapi. One nice thing about this > > example is it has the ability to set incoming and outgoing flow > > control independently. > > > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > > all instances of javax.comm with gnu.io and it compiled and runs > > without a hitch (except for the slow startup). > > > > I Paused the JBuilder IDE during this long pause and the last few > > entries in the stack trace are: > > > > testRead() : -1, gnu.io.RXTXCommDriver > > registerValidPorts() : 255, gnu.io.RXTXCommDriver > > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > > > This was all initiated by the following call in the programs init routine: > > > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > > > After looking at this, My guess is that Trent is correct in that the > > delay is in scanning for ports. I guess one solution would be to not > > scan for ports, though it would be nice to detect what is available on > > the system. Is there any way to reduce the number of ports scanned by > > this function in windows XP? > > > > Thanks again for your time, > > > > Doug > > > > --------------070808020900080005070500 > Content-Type: text/html; charset=ISO-8859-1 > Content-Transfer-Encoding: 7bit > > > > > > > > > Hello all,
>
> I also notice this pause (not as long however) when I call:
>
>          CommPortIdentifier.getPortIdentifier(PortName);
>
> I would think that if I supply the name of the port, it would not have > to go through the same discovery process.  If you have any ideas of how > to get rid of this startup delay, I would really appreciate it.
>
> Thanks,
>
> Doug
>
> Doug Thistlethwaite wrote: >
> > Trent, YiQi, and Jim:
>
> Thanks to all for the replies and information!  I am just back from a > long weekend and I am now trying to figure out what I was doing! :)
>
> As for more information.  First off, this example is being run under > windows XP.  I am developing test equipment that communicates with a > java application via a serial port.  I have been using the commapi for > several years and have not had a problem.  Recently, I have started a > design modification that will replace the RS232 connection with a USB > port.  I am using the ftdi module for prototyping and I discovered that > their virtual com port driver was not compatible with the commapi that > Sun released.  It turns out that it has problems with hardware flow > control ( it works on incoming but not outgoing communications).  The > way I figured this out was by experimenting with the SerialDemo that > was included with the Sum commapi.  One nice thing about this example > is it has the ability to set incoming and outgoing flow control > independently.
>
> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup).
>
> I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are:
>
> testRead() : -1, gnu.io.RXTXCommDriver
> registerValidPorts() : 255, gnu.io.RXTXCommDriver
> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>
> This was all initiated by the following call in the programs init > routine:
>
> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>
> After looking at this,  My guess is that Trent is correct in that the > delay is in scanning for ports.  I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system.  Is there any way to reduce the number of ports scanned by > this function in windows XP? 
>
> Thanks again for your time,
>
> Doug
>
>
> > > > --------------070808020900080005070500-- > -- From jredman at ergotech.com Tue May 30 15:42:35 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 30 May 2006 15:42:35 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: <447CBC4B.2080206@ergotech.com> Lynn, If I understand your idea correctly, I don't think that this would work well for, say, USB ports since these can be easily added/removed by the end user. Jim lynn at swcp.com wrote: > *IF* the name of the port is supplied, we might want to use the preferences > mechanism (java.util.prefs) where we could have previously saved the info for > the port. We could do a quick check to see that things have not changed > before using it. If things have changed (or never been defined) we would do a > full port scan and save detected ports in the preferences. > > This way if the hardware is not changed, you only pay the time penalty one time. > > just an idea... > Lynn > > > Doug Thistlethwaite said: > >> This is a multi-part message in MIME format. >> --------------070808020900080005070500 >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >> Content-Transfer-Encoding: 7bit >> >> Hello all, >> >> I also notice this pause (not as long however) when I call: >> >> CommPortIdentifier.getPortIdentifier(PortName); >> >> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process. If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it. >> >> Thanks, >> >> Doug >> >> Doug Thistlethwaite wrote: >> >>> Trent, YiQi, and Jim: >>> >>> Thanks to all for the replies and information! I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :) >>> >>> As for more information. First off, this example is being run under >>> windows XP. I am developing test equipment that communicates with a >>> java application via a serial port. I have been using the commapi for >>> several years and have not had a problem. Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port. I am using the ftdi module for prototyping and I discovered >>> that their virtual com port driver was not compatible with the commapi >>> that Sun released. It turns out that it has problems with hardware >>> flow control ( it works on incoming but not outgoing communications). >>> The way I figured this out was by experimenting with the SerialDemo >>> that was included with the Sum commapi. One nice thing about this >>> example is it has the ability to set incoming and outgoing flow >>> control independently. >>> >>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup). >>> >>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are: >>> >>> testRead() : -1, gnu.io.RXTXCommDriver >>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>> >>> This was all initiated by the following call in the programs init routine: >>> >>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>> >>> After looking at this, My guess is that Trent is correct in that the >>> delay is in scanning for ports. I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system. Is there any way to reduce the number of ports scanned by >>> this function in windows XP? >>> >>> Thanks again for your time, >>> >>> Doug >>> >> --------------070808020900080005070500 >> Content-Type: text/html; charset=ISO-8859-1 >> Content-Transfer-Encoding: 7bit >> >> >> >> >> >> >> >> >> Hello all,
>>
>> I also notice this pause (not as long however) when I call:
>>
>>         >  CommPortIdentifier.getPortIdentifier(PortName);
>>
>> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process.  If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it.
>>
>> Thanks,
>>
>> Doug
>>
>> Doug Thistlethwaite wrote: >>
>> >> Trent, YiQi, and Jim:
>>
>> Thanks to all for the replies and information!  I am just back from a >> long weekend and I am now trying to figure out what I was doing! :)
>>
>> As for more information.  First off, this example is being run under >> windows XP.  I am developing test equipment that communicates with a >> java application via a serial port.  I have been using the commapi for >> several years and have not had a problem.  Recently, I have started a >> design modification that will replace the RS232 connection with a USB >> port.  I am using the ftdi module for prototyping and I discovered that >> their virtual com port driver was not compatible with the commapi that >> Sun released.  It turns out that it has problems with hardware flow >> control ( it works on incoming but not outgoing communications).  The >> way I figured this out was by experimenting with the SerialDemo that >> was included with the Sum commapi.  One nice thing about this example >> is it has the ability to set incoming and outgoing flow control >> independently.
>>
>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >> all instances of javax.comm with gnu.io and it compiled and runs >> without a hitch (except for the slow startup).
>>
>> I Paused the JBuilder IDE during this long pause and the last few >> entries in the stack trace are:
>>
>> testRead() : -1, gnu.io.RXTXCommDriver
>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>
>> This was all initiated by the following call in the programs init >> routine:
>>
>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>
>> After looking at this,  My guess is that Trent is correct in that the >> delay is in scanning for ports.  I guess one solution would be to not >> scan for ports, though it would be nice to detect what is available on >> the system.  Is there any way to reduce the number of ports scanned by >> this function in windows XP? 
>>
>> Thanks again for your time,
>>
>> Doug
>>
>>
>> >> >> >> --------------070808020900080005070500-- >> > > > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From yhua537 at cse.unsw.edu.au Tue May 30 18:10:23 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 31 May 2006 10:10:23 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CBC4B.2080206@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: Doug, In the SerialDemo, it allow us to save the parameters into a file, and use it when your program start up. Would this help? YiQi On Tue, 30 May 2006, Jim Redman wrote: > Lynn, > > If I understand your idea correctly, I don't think that this would work > well for, say, USB ports since these can be easily added/removed by the > end user. > > Jim > > lynn at swcp.com wrote: >> *IF* the name of the port is supplied, we might want to use the preferences >> mechanism (java.util.prefs) where we could have previously saved the info for >> the port. We could do a quick check to see that things have not changed >> before using it. If things have changed (or never been defined) we would do a >> full port scan and save detected ports in the preferences. >> >> This way if the hardware is not changed, you only pay the time penalty one time. >> >> just an idea... >> Lynn >> >> >> Doug Thistlethwaite said: >> >>> This is a multi-part message in MIME format. >>> --------------070808020900080005070500 >>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>> Content-Transfer-Encoding: 7bit >>> >>> Hello all, >>> >>> I also notice this pause (not as long however) when I call: >>> >>> CommPortIdentifier.getPortIdentifier(PortName); >>> >>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process. If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it. >>> >>> Thanks, >>> >>> Doug >>> >>> Doug Thistlethwaite wrote: >>> >>>> Trent, YiQi, and Jim: >>>> >>>> Thanks to all for the replies and information! I am just back from a >>>> long weekend and I am now trying to figure out what I was doing! :) >>>> >>>> As for more information. First off, this example is being run under >>>> windows XP. I am developing test equipment that communicates with a >>>> java application via a serial port. I have been using the commapi for >>>> several years and have not had a problem. Recently, I have started a >>>> design modification that will replace the RS232 connection with a USB >>>> port. I am using the ftdi module for prototyping and I discovered >>>> that their virtual com port driver was not compatible with the commapi >>>> that Sun released. It turns out that it has problems with hardware >>>> flow control ( it works on incoming but not outgoing communications). >>>> The way I figured this out was by experimenting with the SerialDemo >>>> that was included with the Sum commapi. One nice thing about this >>>> example is it has the ability to set incoming and outgoing flow >>>> control independently. >>>> >>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>> all instances of javax.comm with gnu.io and it compiled and runs >>>> without a hitch (except for the slow startup). >>>> >>>> I Paused the JBuilder IDE during this long pause and the last few >>>> entries in the stack trace are: >>>> >>>> testRead() : -1, gnu.io.RXTXCommDriver >>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>> >>>> This was all initiated by the following call in the programs init routine: >>>> >>>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>> >>>> After looking at this, My guess is that Trent is correct in that the >>>> delay is in scanning for ports. I guess one solution would be to not >>>> scan for ports, though it would be nice to detect what is available on >>>> the system. Is there any way to reduce the number of ports scanned by >>>> this function in windows XP? >>>> >>>> Thanks again for your time, >>>> >>>> Doug >>>> >>> --------------070808020900080005070500 >>> Content-Type: text/html; charset=ISO-8859-1 >>> Content-Transfer-Encoding: 7bit >>> >>> >>> >>> >>> >>> >>> >>> >>> Hello all,
>>>
>>> I also notice this pause (not as long however) when I call:
>>>
>>>         >>  CommPortIdentifier.getPortIdentifier(PortName);
>>>
>>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process.  If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it.
>>>
>>> Thanks,
>>>
>>> Doug
>>>
>>> Doug Thistlethwaite wrote: >>>
>>> >>> Trent, YiQi, and Jim:
>>>
>>> Thanks to all for the replies and information!  I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :)
>>>
>>> As for more information.  First off, this example is being run under >>> windows XP.  I am developing test equipment that communicates with a >>> java application via a serial port.  I have been using the commapi for >>> several years and have not had a problem.  Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port.  I am using the ftdi module for prototyping and I discovered that >>> their virtual com port driver was not compatible with the commapi that >>> Sun released.  It turns out that it has problems with hardware flow >>> control ( it works on incoming but not outgoing communications).  The >>> way I figured this out was by experimenting with the SerialDemo that >>> was included with the Sum commapi.  One nice thing about this example >>> is it has the ability to set incoming and outgoing flow control >>> independently.
>>>
>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup).
>>>
>>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are:
>>>
>>> testRead() : -1, gnu.io.RXTXCommDriver
>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>
>>> This was all initiated by the following call in the programs init >>> routine:
>>>
>>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>
>>> After looking at this,  My guess is that Trent is correct in that the >>> delay is in scanning for ports.  I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system.  Is there any way to reduce the number of ports scanned by >>> this function in windows XP? 
>>>
>>> Thanks again for your time,
>>>
>>> Doug
>>>
>>>
>>> >>> >>> >>> --------------070808020900080005070500-- >>> >> >> >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From halbleib at rechnerbetriebsgruppe.de Wed May 31 02:06:16 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 10:06:16 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp Message-ID: <447D4E78.30302@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, I getting an error while reloading my app in tomcat. At the first start everything runs well, but if i reload mit webapp by tomcat manager i get the following error. java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader Is there a possibility to unload the native library rxtxSerial.dll? thx for all help! regards tom -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 b8FT80HQ1xlbDLnRecDANCc= =heb1 -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 02:52:17 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 10:52:17 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D4E78.30302@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> Message-ID: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Hello Tom, To the best of my knowledge it is impossible to unload native libraries once loaded into the JVM. The exception you see stems from the fact, that Tomcat creates a new classloader when you "reload" the weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar is loaded from the session class loader. Try to add RXTXComm.jar to your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. Regards, Joachim On 31.05.2006, at 10:06, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 > b8FT80HQ1xlbDLnRecDANCc= > =heb1 > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From halbleib at rechnerbetriebsgruppe.de Wed May 31 03:28:35 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 11:28:35 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Message-ID: <447D61C3.1030807@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Joachim, I'm still not getting it. How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml-file? Perhaps web.xml? Regards, Tom Joachim Buechse schrieb: > Hello Tom, > > To the best of my knowledge it is impossible to unload native > libraries once loaded into the JVM. The exception you see stems from > the fact, that Tomcat creates a new classloader when you "reload" the > weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar > is loaded from the session class loader. Try to add RXTXComm.jar to > your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. > > Regards, > Joachim > > On 31.05.2006, at 10:06, Tom Halbleib wrote: > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL tzNy+/0iIUfkYYgt1+UT1ko= =pkpY -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 04:03:42 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 12:03:42 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D61C3.1030807@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> <447D61C3.1030807@rechnerbetriebsgruppe.de> Message-ID: -Xbootclasspath/a: is a start option to the java vm. Google is your friend in finding how to modfiy it and what it means: tomcat modifying bootclasspath Regards, Joachim On 31.05.2006, at 11:28, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Joachim, > > I'm still not getting it. > How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml- > file? > Perhaps web.xml? > > Regards, > Tom > > Joachim Buechse schrieb: >> Hello Tom, >> >> To the best of my knowledge it is impossible to unload native >> libraries once loaded into the JVM. The exception you see stems from >> the fact, that Tomcat creates a new classloader when you "reload" the >> weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar >> is loaded from the session class loader. Try to add RXTXComm.jar to >> your bootlclasspath (-Xbootclasspath/a:) and the problem should go >> away. >> >> Regards, >> Joachim >> >> On 31.05.2006, at 10:06, Tom Halbleib wrote: >> >> Hi all, >> >> I getting an error while reloading my app in tomcat. At the first >> start >> everything runs well, but if i reload mit webapp by tomcat manager >> i get >> the following error. >> >> java.lang.UnsatisfiedLinkError: Native Library >> C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in >> another classloader thrown while loading gnu.io.RXTXCommDriver >> Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: >> Native >> Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already >> loaded >> in another classloader >> >> >> Is there a possibility to unload the native library rxtxSerial.dll? >> >> thx for all help! >> >> regards >> >> tom > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL > tzNy+/0iIUfkYYgt1+UT1ko= > =pkpY > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From impakt01 at optusnet.com.au Wed May 31 06:55:42 2006 From: impakt01 at optusnet.com.au (Daren) Date: Wed, 31 May 2006 22:55:42 +1000 Subject: [Rxtx] (no subject) Message-ID: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/ade7ad37/attachment-0009.html From doug at dupreeinc.com Wed May 31 10:19:19 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 31 May 2006 09:19:19 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: <447DC207.3070702@dupreeinc.com> I am not sure what you are saying. The Save parameters menu option saves the current settings (baud, data bits, etc.). The long pause (~60 seconds) is when the application first starts (before loading the saved parameters). This does bring up a question, though I hate this type of kludge approach to getting this library to work... What exactly is a PortIdentifier? Is it always the same? If I stored the results from "CommPortIdentifier.getPortIdentifier(PortName);" in a file, could I use this the next time the program is executed? In this case I am using a virtual com port driver to connect to the device through a USB port. Doug YiQi Huang wrote: >Doug, > >In the SerialDemo, it allow us to save the parameters into a file, and use >it when your program start up. Would this help? > >YiQi > >On Tue, 30 May 2006, Jim Redman wrote: > > > >>Lynn, >> >>If I understand your idea correctly, I don't think that this would work >>well for, say, USB ports since these can be easily added/removed by the >>end user. >> >>Jim >> >>lynn at swcp.com wrote: >> >> >>>*IF* the name of the port is supplied, we might want to use the preferences >>>mechanism (java.util.prefs) where we could have previously saved the info for >>>the port. We could do a quick check to see that things have not changed >>>before using it. If things have changed (or never been defined) we would do a >>>full port scan and save detected ports in the preferences. >>> >>>This way if the hardware is not changed, you only pay the time penalty one time. >>> >>>just an idea... >>>Lynn >>> >>> >>>Doug Thistlethwaite said: >>> >>> >>> >>>>This is a multi-part message in MIME format. >>>>--------------070808020900080005070500 >>>>Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>>>Content-Transfer-Encoding: 7bit >>>> >>>>Hello all, >>>> >>>>I also notice this pause (not as long however) when I call: >>>> >>>> CommPortIdentifier.getPortIdentifier(PortName); >>>> >>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process. If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it. >>>> >>>>Thanks, >>>> >>>>Doug >>>> >>>>Doug Thistlethwaite wrote: >>>> >>>> >>>> >>>>>Trent, YiQi, and Jim: >>>>> >>>>>Thanks to all for the replies and information! I am just back from a >>>>>long weekend and I am now trying to figure out what I was doing! :) >>>>> >>>>>As for more information. First off, this example is being run under >>>>>windows XP. I am developing test equipment that communicates with a >>>>>java application via a serial port. I have been using the commapi for >>>>>several years and have not had a problem. Recently, I have started a >>>>>design modification that will replace the RS232 connection with a USB >>>>>port. I am using the ftdi module for prototyping and I discovered >>>>>that their virtual com port driver was not compatible with the commapi >>>>>that Sun released. It turns out that it has problems with hardware >>>>>flow control ( it works on incoming but not outgoing communications). >>>>>The way I figured this out was by experimenting with the SerialDemo >>>>>that was included with the Sum commapi. One nice thing about this >>>>>example is it has the ability to set incoming and outgoing flow >>>>>control independently. >>>>> >>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>>without a hitch (except for the slow startup). >>>>> >>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>>entries in the stack trace are: >>>>> >>>>>testRead() : -1, gnu.io.RXTXCommDriver >>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>>> >>>>>This was all initiated by the following call in the programs init routine: >>>>> >>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>>> >>>>>After looking at this, My guess is that Trent is correct in that the >>>>>delay is in scanning for ports. I guess one solution would be to not >>>>>scan for ports, though it would be nice to detect what is available on >>>>>the system. Is there any way to reduce the number of ports scanned by >>>>>this function in windows XP? >>>>> >>>>>Thanks again for your time, >>>>> >>>>>Doug >>>>> >>>>> >>>>> >>>>--------------070808020900080005070500 >>>>Content-Type: text/html; charset=ISO-8859-1 >>>>Content-Transfer-Encoding: 7bit >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>>Hello all,
>>>>
>>>>I also notice this pause (not as long however) when I call:
>>>>
>>>>        >>>> >>>> >>> CommPortIdentifier.getPortIdentifier(PortName);
>>> >>> >>>>
>>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process.  If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it.
>>>>
>>>>Thanks,
>>>>
>>>>Doug
>>>>
>>>>Doug Thistlethwaite wrote: >>>>
>>>> >>>>Trent, YiQi, and Jim:
>>>>
>>>>Thanks to all for the replies and information!  I am just back from a >>>>long weekend and I am now trying to figure out what I was doing! :)
>>>>
>>>>As for more information.  First off, this example is being run under >>>>windows XP.  I am developing test equipment that communicates with a >>>>java application via a serial port.  I have been using the commapi for >>>>several years and have not had a problem.  Recently, I have started a >>>>design modification that will replace the RS232 connection with a USB >>>>port.  I am using the ftdi module for prototyping and I discovered that >>>>their virtual com port driver was not compatible with the commapi that >>>>Sun released.  It turns out that it has problems with hardware flow >>>>control ( it works on incoming but not outgoing communications).  The >>>>way I figured this out was by experimenting with the SerialDemo that >>>>was included with the Sum commapi.  One nice thing about this example >>>>is it has the ability to set incoming and outgoing flow control >>>>independently.
>>>>
>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>without a hitch (except for the slow startup).
>>>>
>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>entries in the stack trace are:
>>>>
>>>>testRead() : -1, gnu.io.RXTXCommDriver
>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>>
>>>>This was all initiated by the following call in the programs init >>>>routine:
>>>>
>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>>
>>>>After looking at this,  My guess is that Trent is correct in that the >>>>delay is in scanning for ports.  I guess one solution would be to not >>>>scan for ports, though it would be nice to detect what is available on >>>>the system.  Is there any way to reduce the number of ports scanned by >>>>this function in windows XP? 
>>>>
>>>>Thanks again for your time,
>>>>
>>>>Doug
>>>>
>>>>
>>>> >>>> >>>> >>>>--------------070808020900080005070500-- >>>> >>>> >>>> >>> >>> >>> >>-- >>Jim Redman >>(505) 662 5156 x85 >>http://www.ergotech.com >>_______________________________________________ >>Rxtx mailing list >>Rxtx at qbang.org >>http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > >cheers >YiQi Huang >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/61d4d4c9/attachment-0009.html From impakt01 at optusnet.com.au Wed May 31 17:02:54 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 09:02:54 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Message-ID: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Hi all, I downloaded 2.1.7-pre16 and managed to build it and get it going. I made the changes as suggested by Peter Smith in an old post, by adding his code to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. Still not working, it opens the port at 9600 according to portmon.exe . Has anyone managed to get this going at a custom rate? Here is the post I'm referring to: http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 Thanks, Daren ________________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Daren Sent: Wednesday, 31 May 2006 10:56 PM To: rxtx at qbang.org Subject: [Rxtx] (no subject) Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren From tjarvi at qbang.org Wed May 31 21:44:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 May 2006 21:44:01 -0600 (MDT) Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> References: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Message-ID: On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org From impakt01 at optusnet.com.au Wed May 31 22:06:04 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 14:06:04 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: Message-ID: <200606010406.k51464X2010447@mail03.syd.optusnet.com.au> Trent, I have managed to successfully open the port at this speed using Realterm (available on sourceforge). From memory this uses DLPortIO. Using portmon.exe with realterm, even there it says that the port has opened at 1953. I changed termios.c:560 to dcb->BaudRate = 1953 ; and it still opens the port at 9600. Daren -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Thursday, 1 June 2006 1:44 PM To: RXTX Developers and Users Subject: Re: [Rxtx] custom baud rate win32 On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From smontgomery at mediaspansoftware.com Mon May 1 09:52:28 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 11:52:28 -0400 Subject: [Rxtx] RXTX, Java COMM and Windows Server 2003 on x64 experiences? Message-ID: Just wondering if anybody here has had to deploy RXTX or the javax.comm on Windows Server 2003 machines running on x64 (i.e. Xeon EM64T) and would like to relate how things went. From Sun's site, the Supported System Configurations pages give the options for that system: Java 5.0: - 32-bit Java 5.0 running on the OS in the 32-bit mode - 64-bit Java 5.0 running on the OS in the 64-bit native mode Java 1.4.2: - no options listed for EM64T processors, but potentially the standard 32-bit Java 1.4.2 could run on the OS in 32-bit mode? I guess the two main points of failure would be 1) the JVM itself and 2) the jni components. Make that three: there's gotta be hardware vendor driver support for the OS in the various modes, too. Guess I better go look at Keyspan's website... Thanks in advance for any info anyone might be able to provide. From smontgomery at mediaspansoftware.com Mon May 1 10:18:33 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 12:18:33 -0400 Subject: [Rxtx] Mailing list archive out of date? Message-ID: The mailing list archive at: http://mailman.qbang.org/pipermail/rxtx/ only shows emails through the end of March. Is there a new archive somewhere else? Didn't see anything mentioned on the wiki. From p.cain at phasefale.com.au Mon May 1 22:33:09 2006 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 02 May 2006 14:33:09 +1000 Subject: [Rxtx] RXTX and the Linux kernel. Message-ID: <4456E105.5080106@phasefale.com.au> Hi, First off the problem I am having isn't caused by RXTX itself but I'm hoping someone out there may have some knowledge that may help me. Background: I have an application monitoring a control system through a standard PC serial port which I talk to with rxtx-2.0.5. The application runs on RedHat7.3 kernel version 2.4.18 using Java 1.4. This configuration has been in use for several years and has proved to be stable. But it has become necessary for me to upgrade the OS but I'm running into problems with the serial communications. Its not that the comms don't work on the new OS (its never that simple) the comms work for a variable period of time (sometimes several hours) and then just stop, nothing on the data lines and control lines all indicate that data could flow. The new OS is Ubuntu 5.10 running kernel version 2.6.12. I have installed the OS and software on a PC and had it perform ok, then install the new OS and same software on the very same hardware and experienced the problems of them comms stopping. In the new OS I'm using Java5 to run the app but since I have experience the problem I reverted back to Java1.4 which didn't fix the problem. I've moved the app to a different system RedHat FC3 running 2.6.14 had experienced the problem. Not wanting to go through all the thing I have tried but I have established that it seems to be the 2.6 versions of the kernel that seem to be the problem and not an individual distribution of Linux. I should point out that I am using the same jar and library files for each java and OS combination. So I'm just wondering if anyone has had or heard of problems similar to these ? Or perhaps might know of what changed in the Linux serial driver (something I'm having a hard time establishing). I'm starting to run low on ideas of what to try so any help would be much appreciated. -- Peter Cain Senior Programmer Phasefale Pty Ltd From tjarvi at qbang.org Wed May 3 07:31:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 May 2006 07:31:00 -0600 (MDT) Subject: [Rxtx] Re: Concering ircomm and RXTX In-Reply-To: References: Message-ID: On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From legolas.w at gmail.com Wed May 3 08:46:23 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 19:16:23 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <4458C23F.2000003@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From legolas.w at gmail.com Wed May 3 13:10:57 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 23:40:57 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <44590041.80706@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From Lars.Hennig at wow-portal.com Thu May 4 00:39:15 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Thu, 4 May 2006 08:39:15 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: Message-ID: Hi, I could not find any solution. I therefore decided to to my own native implementation. Allthough it only supports the functions I need, it works pretty well now for me. I think the main problem there is the use of a wrong Windows API function and not setting an timeout. Regards, Lars Hennig W?rth Online World GmbH Tel. (0049)7181-258183 Mob. (0049)160-3522889 Fax. (0049)7940-153299 Lars.Hennig at wow-portal.com Gesendet von: rxtx-bounces at qbang.org 09.04.2006 10:42 Bitte antworten zu RXTX Developers and Users An d.herwald at dsh-elektronik.de, RXTX Developers and Users Kopie Thema Re: [Rxtx] USB Serialport - disconnection problems WV Proj./Teilpr.: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/7b39f374/attachment-0010.html From Pawan.Kharbanda at dot.state.co.us Thu May 4 11:00:58 2006 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Thu, 4 May 2006 11:00:58 -0600 Subject: [Rxtx] Dangling Lock Files Message-ID: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Hi, I have been using RXTX API's for the Serial Communication for quite some time now and for some of the devices we are opening and closing the connection every 2 minutes. This works great for few days and then suddenly I start seeing some "Port in Use Exception" and I see that the Lock files are still in the /var/lock folder after manually removing the lock files it works good for few hours and I see the same problem again. Can somebody explain me the scenarios why I am seeing the dangling Lock files? I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise Servers. Thanks Pawan Kharbanda -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/ba0e9261/attachment-0010.html From tjarvi at qbang.org Thu May 4 14:10:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:10:30 -0600 (MDT) Subject: [Rxtx] Dangling Lock Files In-Reply-To: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> References: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Message-ID: On Thu, 4 May 2006, Kharbanda, Pawan wrote: > Hi, > I have been using RXTX API's for the Serial Communication for quite > some time now and for some of the devices we are opening and closing the > connection every 2 minutes. This works great for few days and then > suddenly I start seeing some "Port in Use Exception" and I see that the > Lock files are still in the /var/lock folder after manually removing the > lock files it works good for few hours and I see the same problem again. > Can somebody explain me the scenarios why I am seeing the dangling Lock > files? > > I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise > Servers. Hi Pawan The next time it happens, look in the lockfile. There will be a pid. ps aux |grep 'pid' I think you will see that the application is still running for some reason. RXTX does a kill -0 on the pid to see if its alive. If not, it will remove the lockfile. So I suspect the previous program did not exit as you expected. -- Trent Jarvi tjarvi at qbang.org From Scott.Hughes at dalsemi.com Thu May 4 14:23:11 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 4 May 2006 15:23:11 -0500 Subject: [Rxtx] Wiki instructions... Message-ID: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire demo apps, when I stumbled across this tip on the wiki to add yourself to the uucp group: It may be simpler to just run usermod -G uucp jarvi Taken from: http://rxtx.qbang.org/wiki/index.php/Installation This does not work as advertised. I should have read the man page for usermod before I tried that out. If there are any groups which are not listed after the -G switch, the user is removed from those groups. On Ubuntu, this is bad... I removed myself from the Admin group, which removed my sudo priviledges. Ubuntu has no root account, so I've disabled the only account which could fix it. Anyone know of a good workaround? Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor From tjarvi at qbang.org Thu May 4 14:32:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:32:09 -0600 (MDT) Subject: [Rxtx] Wiki instructions... In-Reply-To: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> Message-ID: On Thu, 4 May 2006, Scott Hughes wrote: > I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire > demo apps, when I stumbled across this tip on the wiki to add yourself to > the uucp group: > > It may be simpler to just run > > usermod -G uucp jarvi > > Taken from: > http://rxtx.qbang.org/wiki/index.php/Installation > > This does not work as advertised. I should have read the man page for > usermod before I tried that out. If there are any groups which are not > listed after the -G switch, the user is removed from those groups. On > Ubuntu, this is bad... I removed myself from the Admin group, which removed > my sudo priviledges. Ubuntu has no root account, so I've disabled the only > account which could fix it. > > Anyone know of a good workaround? > Yikes This will get your permissions back: in grub/lilo/.. pass the following option to the kernel init=/bin/sh You are now root. when it boots, mount -o remount,rw / add yourself to the groups, reboot to get normal init going. Thats about all I can think of without sudo/root. -- Trent Jarvi tjarvi at qbang.org From Gettings at earth.utah.edu Thu May 4 14:41:22 2006 From: Gettings at earth.utah.edu (Paul Gettings) Date: Thu, 4 May 2006 14:41:22 -0600 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <20060504204122.GA6534@earth.utah.edu> When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get messages on stdout from the JVM: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 As the only change was the version of RXTX (from 2.1.6), I am unsure why the messages suddenly appeared. Anyone know how to get rid of them? Thanks. -- 101 USES FOR A DEAD MICROPROCESSOR (23) Dead cat brush From mmester at sps.edu Mon May 1 21:22:28 2006 From: mmester at sps.edu (Michael Mester) Date: Mon, 1 May 2006 23:22:28 -0400 Subject: [Rxtx] Windows PortInUseException Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> I'm trying to get simple serial communication going with RxTx under Windows XP. I can enumerate the ports fine, but I always run into problems when I try to open one. I get a PortInUseException, but the owner application is "Unknown" and the port is never open. I've tried this on several different systems and all of them give the same behavior. The only thing I can thiunk of that might be causing the problem is that fact that I had to put the serial .dll file in system32 instead of the reccommended folder, because it didn't work in the folder the documentation gives. The library loads fine, though, so I'm not sure whether that makes sense, and I don't know how to fix it anyway. Any help is greatly appreciated. Below is the output of the program, right up to the PortInUseException and the NullPointerException it causes (because the serial port object is not instantiated). C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI Starting GPSTalkerGUI... Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 gnu.io.PortInUseException: Unknown Application Exception in thread "main" java.lang.NullPointerException at GPSTalkerGUI.(GPSTalkerGUI.java:102) at GPSTalkerGUI.main(GPSTalkerGUI.java:161) Again, thank you very much for any help you can give. From lshellman at qwest.net Wed May 3 01:38:34 2006 From: lshellman at qwest.net (Lucious Shellman) Date: Wed, 03 May 2006 01:38:34 -0600 Subject: [Rxtx] Help needed: Project using parallel port Message-ID: <1146641914.8337.14.camel@localhost.localdomain> I was looking for a way to access the parallel port on a PC using Java. Searching the Internet, I came across this site (rxtx.org). What I am trying to do is detect logic levels from a TTL logic IC on the parallel port. I am not trying to do classic parallel port communication. I just want to detect whether a line(s) is (are) high or low. I am using Windows 98. Can rxtx be used to do this? If yes, is there a tutorial for using rxtx posted on the Internet that someone can direct me to. If you need more information, feel free to e-mail me. Unfortunately for me, I need the information ASAP. Thanks. lshellman at qwest.net From webmaster at egyhelp.com Wed May 3 18:43:39 2006 From: webmaster at egyhelp.com (Mohamed Samy) Date: Thu, 4 May 2006 02:43:39 +0200 Subject: [Rxtx] RE: Concering ircomm and RXTX In-Reply-To: Message-ID: <20060503184362.SM01044@Geek> Hey, I issue the command "modprobe ircomm-tty" yet no ttyircomm appears, while the ircomm appear by "modprobe ircomm" so forgive me but I am bit lost. Even searching google for the keyword "ttyircomm" only returns 3 matches. So any way I can start the ttyircomm???? Thanks a lot. -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Wednesday, May 03, 2006 3:31 PM To: Mohamed Samy; rxtx at qbang.org Cc: taj at www.linux.org.uk Subject: Re: Concering ircomm and RXTX On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 4 15:49:49 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 15:49:49 -0600 (MDT) Subject: [Rxtx] Windows PortInUseException In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> Message-ID: On Mon, 1 May 2006, Michael Mester wrote: > > I'm trying to get simple serial communication going with RxTx under > Windows XP. I can enumerate the ports fine, but I always run into > problems when I try to open one. I get a PortInUseException, but the > owner application is "Unknown" and the port is never open. I've tried > this on several different systems and all of them give the same > behavior. The only thing I can thiunk of that might be causing the > problem is that fact that I had to put the serial .dll file in system32 > instead of the reccommended folder, because it didn't work in the folder > the documentation gives. The library loads fine, though, so I'm not sure > whether that makes sense, and I don't know how to fix it anyway. Any > help is greatly appreciated. Below is the output of the program, right > up to the PortInUseException and the NullPointerException it causes > (because the serial port object is not instantiated). > > C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI > Starting GPSTalkerGUI... > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > gnu.io.PortInUseException: Unknown Application > Exception in thread "main" java.lang.NullPointerException > at GPSTalkerGUI.(GPSTalkerGUI.java:102) > at GPSTalkerGUI.main(GPSTalkerGUI.java:161) > Perhaps you are trying to open the port twice in your code? rxtx does open the ports, do a timed out read and then close the ports during enumeration. I think the port is being opened fine. The Unknown Application is always reported. On linux, there is some code that finds the actual application but on windows, its always unknown. If the port enumeration is returning the ports you expect, rxtx has opened the port and closed it with success. The port should open. There is also example code in the contrib directory that comes with rxtx source that has examples you can modify to work. -- Trent Jarvi tjarvi at qbang.org From Christian.Klemke at t-online.de Thu May 4 23:37:23 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Fri, 5 May 2006 07:37:23 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu> Message-ID: <004f01c67005$fc72fee0$016a10ac@NB600> Hi Paul, I was wondering about the same question some days ago and took a look at the source files. Unfortunately, I found that you can only get rid of that messages by altering and recompiling the Java code. There is a final static boolean variable called "devel" in the file "RXTXCommDriver.java" which is set to "true". This constellation causes the output after the native libraries have been loaded. No mechanism exists to suppress them otherwise :-(. Trent, does that mean that 2.1.7 is still officially a "development" version ? When will this value be changed to "false" by default ? With 2.1.8 ? It would be nice to provide a means to suppress such messages besides that static flag (maybe by setting a property called "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The output can indeed by annoying, especially when used with console applications, where the message potentially appears "in the middle" of your own output. Another possibility would be not to use System.out directly, but instead some PrintStream field which is initially set to System.out but can programatically be changed. That would allow for any kind of redirection or suppression by implementing appropriate user-defined PrintStream subclasses and making RXTX use that stream. What do you think ? Best regards, Christian ----- Original Message ----- From: "Paul Gettings" To: Sent: Thursday, May 04, 2006 10:41 PM Subject: [Rxtx] RXTX causing stdout messages > When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get > messages on stdout from the JVM: > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > As the only change was the version of RXTX (from 2.1.6), I am unsure > why the messages suddenly appeared. Anyone know how to get rid of > them? > > Thanks. > > -- > 101 USES FOR A DEAD MICROPROCESSOR > (23) Dead cat brush > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri May 5 06:09:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 06:09:46 -0600 (MDT) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <004f01c67005$fc72fee0$016a10ac@NB600> References: <20060504204122.GA6534@earth.utah.edu> <004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: On Fri, 5 May 2006, Christian Klemke wrote: > Hi Paul, > > I was wondering about the same question some days ago and took a look at the > source files. Unfortunately, I found that you can only get rid of that > messages by altering and recompiling the Java code. There is a final static > boolean variable called "devel" in the file "RXTXCommDriver.java" which is > set to "true". This constellation causes the output after the native > libraries have been loaded. No mechanism exists to suppress them otherwise > :-(. > > Trent, does that mean that 2.1.7 is still officially a "development" version > ? When will this value be changed to "false" by default ? With 2.1.8 ? It > would be nice to provide a means to suppress such messages besides that > static flag (maybe by setting a property called > "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The > output can indeed by annoying, especially when used with console > applications, where the message potentially appears "in the middle" of your > own output. Another possibility would be not to use System.out directly, but > instead some PrintStream field which is initially set to System.out but can > programatically be changed. That would allow for any kind of redirection or > suppression by implementing appropriate user-defined PrintStream subclasses > and making RXTX use that stream. What do you think ? > A patch for using properties would be accepted I'm sure. The reason the default is to display the message is not related to the development state of rxtx anymore. The problem is that people first using rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. The message prevents a great deal of email thats easily explained by the message. I question if we should support rxtx 2.0 at all anymore. If you post a patch in bugzilla, we'll put it into CVS this weekend. we'll be going through and doing such things anyhow. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri May 5 13:23:56 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 13:23:56 -0600 (MDT) Subject: [Rxtx] How to read from RxTx parallel port in Win XP In-Reply-To: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> References: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> Message-ID: On Thu, 27 Apr 2006, Worsley, Bob (Development Engineer) wrote: > I'm sorry if this is a dumb question, but I didn't find the answer in > the archives. > > I'm using the RxTx binaries for Windows on a reasonably current notebook > PC running Windows XP. I can send stuff to a printer on the parallel > port (LPT1), but I can't get anything back. > > I wrote a class that has the methods listed below. I write some data to > the printer with the "write" method and then try to read a response > using the "read" method, but I never get any data. I'd greatly > appreciate any help you can give! > > Bob Worsley > bobwoyid2 at yahoo.com > > > > > private ParallelPort parallelPort = null; > private RXTXCommDriver parallelPortDriver = null; > > > public boolean initialize() throws IOException { > if (parallelPort != null) { > return false; // Already initialized > } > > // Create the parallel port; > parallelPortDriver = new RXTXCommDriver(); > parallelPort = > (ParallelPort)parallelPortDriver.getCommPort(address, > CommPortIdentifier.PORT_PARALLEL); > > // Set the parallel port parameters. > try { > parallelPort.enableReceiveTimeout(READ_TIMEOUT); > parallelPort.disableReceiveFraming(); > parallelPort.disableReceiveThreshold(); > //parallelPort.setMode(mode); !!!!errors > } catch (UnsupportedCommOperationException e) { > throw (new IOException("Parallel port with address '" + > address > + "' cannot be configured as specified")); > } > > return true; > } > > > > public void write(final byte[] bytes) throws IOException { > initialize(); > while (busyReading) { > Thread.yield(); > } > busyWriting = true; > if (bytes.length < 1) { > return; > } > OutputStream outputStream = parallelPort.getOutputStream(); > outputStream.write(bytes); > outputStream.flush(); > outputStream.close(); > Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); > busyWriting = false; > } > > > public byte[] read() throws IOException { > > // Read up to MAX_BYTES bytes. > initialize(); > while (busyWriting) { > Thread.yield(); > } > busyReading = true; > byte[] buff = new byte[MAX_BYTES_READ]; > InputStream inputStream = parallelPort.getInputStream(); > // This read blocks until input data is available > int bytesRead = inputStream.read(buff); > inputStream.close(); > // If no data read, create empty array > if (bytesRead == -1) { > bytesRead = 0; > } > byte[] deviceBytes = new byte[bytesRead]; > System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); > if (bytesRead > 0) { > Debug.p("PPIOP.read - got data: '" + new > String(deviceBytes) + "'"); > } > busyReading = false; > return deviceBytes; > } > Hi Bob I've only used rxtx to test a hello world page printing but there are others that have used it. PPIOP? hmm what is this? :) The rxtx parallel support is behind the serial support but should be OK. As you note, the setting of modes is not supported. rxtx uses what is provided when the port is open. Are your asserting the pin for the printer being online? I suspect what often happens is people try to just use the data pins but the C API rxtx uses wants the printer to be online. There should be some posts relating to this in the rxtx mail-list archive. Some APIs are probably reading and writing from the port address (also suggested in your code as something you are looking at). RXTX currently uses a higher level C/C++ API for port access. This can still work if the API thinks the 'printer' is there. -- Trent Jarvi tjarvi at qbang.org From agrodellic at gmail.com Sat May 6 08:39:40 2006 From: agrodellic at gmail.com (Leigh Stewart) Date: Sat, 6 May 2006 10:39:40 -0400 Subject: [Rxtx] sun commapi 3 Message-ID: I think I read here: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html that rxtx-2.0 is basically fracked for now? Does anyone know of a workaround? ie can i somehow get an older version of sun's comm api and use that (not easy to find)? i mean 2.0 must be working for someone...how is it being tested. 2.1 isnt working for me....im getting nasty native exceptions etc, which is why im so set on 2.0... any ideas? From tjarvi at qbang.org Sun May 7 15:40:27 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 7 May 2006 15:40:27 -0600 (MDT) Subject: [Rxtx] sun commapi 3 In-Reply-To: References: Message-ID: On Sat, 6 May 2006, Leigh Stewart wrote: > > 2.1 isnt working for me....im getting nasty native exceptions etc, > which is why im so set on 2.0... any ideas? > Hi Leigh What native exceptions are you seeing? Which OS? The native code is almost identical between rxtx 2.0 and 2.1. Only the names have been changed to protect the inocent. :) ie: javax_comm_... vs gnu_io_... So the odds are very likely that even if you do find commapi 2.0 and get it installed, you will run into the same error. It would be better to just find and fix the problem. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Mon May 8 10:47:20 2006 From: mail at willicon.de (WILLICon) Date: Mon, 08 May 2006 18:47:20 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 Message-ID: <445F7618.3070303@willicon.de> Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/ef37e8ec/attachment-0010.html From tjarvi at qbang.org Mon May 8 16:14:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 May 2006 16:14:51 -0600 (MDT) Subject: [Rxtx] Screenshot of Application using RXTX (fwd) Message-ID: Just though someone may end up searching for 0x0D and 0x0A. Here are the details from his system. SuSE Linux 10.0 (x86_64) Kernel 2.6.13-15.8 j2se 1.4.2_11 (i586) Sun: comm3.0_u1 rxtx: rxtx-2.1-7 ---------- Forwarded message ---------- Date: Sat, 6 May 2006 20:01:46 +0200 From: Michael Poppitz To: taj at www.linux.org.uk Subject: Screenshot of Application using RXTX Hi Trent, the rxtx package works like a charm. Sun's package seemed to replace all 0x0D with 0x0A in received data on my Linux box, which is really annoying when transfering binary data. But rxtx came and saved the day - and turned out to be a lot more convenient as it does not require a configuration file. I use it for connecting to a home made logic analyzer. (http://www.sump.org/projects/analyzer/) Thanks for your great job, Michael -------------- next part -------------- A non-text attachment was scrubbed... Name: la_client.png Type: image/png Size: 16592 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/45494fbb/la_client-0010.png From tjarvi at qbang.org Tue May 9 14:56:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 May 2006 14:56:05 -0600 (MDT) Subject: [Rxtx] RXTX javax.comm: which one to install? In-Reply-To: <20060509161742.43547.qmail@web53814.mail.yahoo.com> References: <20060509161742.43547.qmail@web53814.mail.yahoo.com> Message-ID: On Tue, 9 May 2006, Adenilson Cavalcanti wrote: > Dear Trent Jarvi > > I'm trying to write a small Java app running in linux that interfaces with a device connected to serial port. > > I do have some questions about RXTX and javax.comm state of affairs, since I'm new to Java programming (used to program in plain old C writting to devices using termios and open/write/read syscalls, but this is another story). > > I ask you the favor to clarify this issues (if possible...): > > a) Sun offers to download a file (comm3.0_u1_PUTAUNIXVERSION.zip) which does contain .so files. Does it work out of box? > > b) Case negative, its there that we should use 'librxtx*.so' provided by your site? > > c) Sun's comm3 API version does work with which version of rxtx? > > I already searched google and read documentation available in rxtx site ("Java Comm Serial API How-to") but still have this issues unsolved. Any help will be appreciated. > > Best regards > > Adenilson Hi Adenilson, RXTX does not currently support javax.comm in Sun's CommAPI 3.0. I would recommend using package gnu.io provided by rxtx 2.1. -- Trent Jarvi tjarvi at qbang.org From chris.develder at intec.ugent.be Wed May 10 08:45:40 2006 From: chris.develder at intec.ugent.be (Chris Develder) Date: Wed, 10 May 2006 16:45:40 +0200 Subject: [Rxtx] rxtx troubles on ARM Message-ID: <4461FC94.6040909@intec.ugent.be> Hi all, Sorry to bother you, but I don't seem to get RXTX working on an ARM processor (xscale ixp 425, big endian). I managed to crosscompile the rxtx libs and moved it over to the ARM. Using jamvm (which is the only open source java VM we got working on the ARM), I get the following error result when running SimpleRead from Sun's javax.comm examples (commapi\examples\Simple\SimpleRead) -- see bottom of mail for complete output: "java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver" However, output shows that the RXTXCommDriver code is accessible (cf. debug and devel output of lib versions). So it doesn't seem to be a missing lib/jar issue. The error happens before RXTXCommDriver.initialize() is called, since the first line there is System.out.println("RXTXCommDriver:initialize()"); Any ideas? Cheers, Chris ---------------------------- [root at xxx(ttyp1) /work/cdvelder/xscale/test]# jamvm -Djava.library.path=/work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/jre/lib/arm -classpath /work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/lib/ext/RXTXcomm.jar:./comm.jar:. SimpleRead RXTXCommDriver {} Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTXCommDriver: Jar version = RXTX-2.1-7 native lib Version = RXTX-2.1-7 java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver gnu/io/RXTXCommDriver at javax.comm.CommPortIdentifier.loadDriver (CommPortIdentifier.java:239) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:109) at SimpleRead.main (Unknown Source) java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive (Native Method) at com.sun.comm.Portmapping.registerCommPorts (Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase (Portmapping.java:100) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:138) at SimpleRead.main (Unknown Source) From joachim at buechse.de Fri May 12 00:44:48 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 08:44:48 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) Message-ID: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Good day, I guess that only a selected few (hi Trent) will be able to answer this question, but the answer might be interesting for anyone trying to debug or understand the code. Apparently the MonitorThread is started and stopped in RXTXPort.addEventListener and RXTXPort.removeEventListener. This would indicate that (originally?) the MonitorThread is only required when there is an EventListener. However the MonitorThread is also started in the RXTXPort constructor, which could mean that RXTX won't work at all if it isn't there. It seems to me, that if anyone would add an event listener and later on remove it, he could potentially wreak the port. Because the second action would kill the MonitorThread. For the moment I am only trying to understand the role of and idea behind the MonitorThread. But of course there is a deeper reason thor my question: If the MonitorThread needs to exist anyway, it could be the thread that cleans up the port (ie calls nativeClose) - this would eliminate (a further) problem I am seeing with some USB drivers on Mac OSX. (Close blocks (after releasing the tty, but still) in the USB driver if the device is "not responding"). Greetings, Joachim From tjarvi at qbang.org Fri May 12 07:10:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 12 May 2006 07:10:59 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Fri, 12 May 2006, Joachim Buechse wrote: > Good day, > > I guess that only a selected few (hi Trent) will be able to answer > this question, but the answer might be interesting for anyone trying > to debug or understand the code. > > Apparently the MonitorThread is started and stopped in > RXTXPort.addEventListener and RXTXPort.removeEventListener. This > would indicate that (originally?) the MonitorThread is only required > when there is an EventListener. However the MonitorThread is also > started in the RXTXPort constructor, which could mean that RXTX won't > work at all if it isn't there. > > It seems to me, that if anyone would add an event listener and later > on remove it, he could potentially wreak the port. Because the second > action would kill the MonitorThread. > > > For the moment I am only trying to understand the role of and idea > behind the MonitorThread. But of course there is a deeper reason thor > my question: > > If the MonitorThread needs to exist anyway, it could be the thread > that cleans up the port (ie calls nativeClose) - this would eliminate > (a further) problem I am seeing with some USB drivers on Mac OSX. > (Close blocks (after releasing the tty, but still) in the USB driver > if the device is "not responding"). > Hi Jaochim Before commapi, rxtx did not support events. You could read, write and change port settings. The MonitorThread was added as an afterthought to support commapi events. So the way things are now his historical spaghetti not a well devised plan. It is my opinion that the MonitorThread should exist as long as the port is open. The odd starting of the thread in the constructor and addEventListener was just to get past the obvious problem of people using the port without adding listeners. -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Fri May 12 07:59:50 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 15:59:50 +0200 Subject: [Rxtx] MonitorThread -> ChangeRequest In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: <2B1E508C-8CEE-4AB7-914D-E7BA25C871A2@buechse.de> In this case I suggest removing the starting/stopping of MonitorThread in addEventListener / removeEventListener. This should not affect existing projects. On 12.05.2006, at 15:10, Trent Jarvi wrote: > It is my opinion that the MonitorThread should exist as long as the > port > is open. The odd starting of the thread in the constructor and > addEventListener was just to get past the obvious problem of people > using > the port without adding listeners. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Fri May 12 11:43:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 19:43:21 +0200 Subject: [Rxtx] Spring Cleaning - some suggestions Message-ID: The current implementation of RXTX contains quite a lot of code that will break if it is used from several threads (especially on a multi processor machine). I think it would be nice to clean this up. I suggest the following changes (which keep the current semantics and should not influence existing projects in a negative way): - InterruptedException will never be ignored or reset - read methods will be protected with a Monitor - write methods will be protected with a (separate) Monitor - close() sets the read and write monitors into a "closed" state which will lead to IOExceptions for any following call to RXTXPort.read/write. - close() will wait a finite amount of time (maybe 500ms) for the release of the read and write monitors after that, it will trigger the closing of the file descriptor to abort any pending read or write. - close() will not call close(file_desc). Instead it will "interrupt" (ie set a flag and then, pthread_kill(ABRT)) the MonitorThread, the MonitorThread will call close(file_desc). - the monitors are properly released in a finally block the try of which starts directly after obtaining the monitor. - finally will not call close(file_desc) it will only "interrupt" the MonitorThread (see above) - the native-code (esp read) does not use SA_RESTART but checks Thread.interrupted() when it receives a SIGNAL (ie system call returns with EINTR or other signalling method). The read/write monitors will be allocated from a factory whose mode can be set to fast/normal/advanced. In fast-mode it will create "non thread safe, non synchronized" pseudo-monitors. In default mode, the monitors will store the owning thread. In "advanced" mode setting the monitors into closed state will "interrupt()" threads which are blocked in a native read/write. {Reasoning close behaviour: Calling close on a file descriptor in Windows unblocks any read() or write() on the same file descriptor with an error. On Solaris < 2.7 and MacOS X however the close() will/ can block - until the read or write have finished:-(( Even the JDK people have trouble with this. I dont know how Linux reacts in this case. The best practice for BSD/Solaris is to send a signal to the thread which will usually unblock the read/write with an EINTR - this however is not guarenteed as it also depends on the device driver. So the only resolution that will certainly not block the thread calling RXTXPort.close() (which will often enough be the AWT event dispatcher or the VM finalizer thread) is to call close(fd) from another thread.} {Reasoning read behaviour: It is rather uncommon to receive a signal while reading or writing - it will happen, but checking Thread.interrupted() when it happens will not degrade performance. The checking of Thread.interrupted() can be handled by returning to Java and potententially reentering into the native code if the thread was not interrupted or by calling back into the VM from the native code. On top of this, many functions like read(byte[]) or read(byte [], int, int) are allowed to return less than the requested amount of data. Only int read() is a bit more tricky. } [Trent: From the code I can tell, that you experimented quite a bit with signals. Do you know if the Java Thread.interrupt() triggers a unix signal on Linux/Solaris? If so, which one?? References: - http://java.sun.com/docs/hotspot/VMOptions.html - http://www.hp.com/products1/unix/java/infolibrary/prog_guide/ signals.html ] On OS X (hotspot client jdk-1.4.2) I did not see any signal propagated to the SELECT of the event_loop/MonitorThread (ie no EINTR) when I call monThread.interrupt(). This is a pitty, but thats the way it is. I simply assume this is true for most system calls. How to handle this? Of course it would be possible to install/ deinstall a specific signal handler before/after every native read and to natively send an ABRT signal if RXTXPort.close is called. A more elegant solution might be to have an additional "signaling" socket which is always included in the SELECT. Or the simplest solution: cap the timeout of the select to 500 ms (the loop around it exists already) after every timeout check the Thread.interrupted() flag. From a performance perspective this should be completely invisible... On the other hand, all write() calls need to be preceeded by a SELECT as well, to avoid running into a blocking write. Best regards, Joachim From lyon at docjava.com Sat May 13 05:54:52 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 13 May 2006 07:54:52 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Dmitry suggests that we acquire an implementation of a serial port reference, use it, then release it (i.e., check it back in). Joachim says that making serial ports thread friendly might be a good idea. This is a good idea. The design pattern that is close to this idea is the "Object Pool Design Pattern". # Object Pool Manage the reuse of objects for a type of object that is expensive to create or only a limited number of a kind of object can be created. It has been described at: http://www.developer.com/java/ent/article.php/626171 and in Marks' book, Patterns in Java, Volume 1. However, the Object Pool is intended to pool objects so that each object is just like every other object. The intent of the Parametric Singleton is to enable others to access the same resource at the same time (as long as the same parameters were used in construction). It sounds like we need a NEW Design Pattern (Oh no, Doug is doing it again!). Yes friends, you got me on a role (roll) :) If you like design patterns, you can thank me later. If you don't like design patterns, blame Dmitry, it was his idea ;) And Dave, thanks for the feedback on Singleton abuse. It has led me to change the way I think about application contexts, which we will see, below. We need (drum roll please): The Parametric Object Pool Design Pattern (POP) By Douglas A. Lyon ABSTRACT The goal of the Parametric Singleton design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values, in a given context. In comparison, the goal of the POP design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values and that only one reference to the class is checked out at a time, in a given context. A context is a namespace for holding identifiers during execution. In Java, A context can be changed in any of several ways. For example, creation of a new class loader, the deserialization of an old POP or the creation of a new process all create a new namespace. The POP Design Pattern combines the Parametric Singleton Design Pattern with the check out mechanism of the Object Pool Design Pattern. This enables unique creation of instances of a class. These instances are cached in a table. When a clients asks for an instance with these parameters, the cache is checked. If the instance is not in the cache it is created. If the instance is available, the clients checks out the instance. A reference is left to the clients that checked out the instance. The POP has the role of creating objects uniquely, from parameters. It also has the role of keeping track of which clients has checked out a given object. This is just like a library keeping track of who borrowed a book. If a resource is left unavailable in a system, a deadlock can occur. Deadlock debugging is facilitated by mapping a resource to the clients that have checked it out. We apply our POP Design Pattern to the retrieval of serial ports. The goal of our system is to make sure that serial ports are checked out to only one client at a time, and that they be checked back in when the client is done. The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. Users are discouraged from calling this the Parametric Object Oriented Pool (POOP). Introduction The intent of the POP Design Pattern is to ensure that a class has only one instance for a given set of parameter values. It also provides a point of access that is global to a given context. The POP uses the Singleton Design Pattern to ensure that there is only one POP, in the given context. The POP DP is responsible for checking out a reference to a given instance, and keeping track of that instance. The instance is responsible for sharing that instance. POP requires that users of the DP implement an interface that enables a recall facility. Thus, if there is a contention for a consumed resource, the deadlock can be resolved in an orderly fashion. Motivation A system cannot tolerate multiple instances of some classes with identical parameters used by different instances at the same time. For example, you cannot have two instances use the same serial port, at the same time. You cannot have two instances that are trying to listen to the same socket connection. You cannot have two instances writing to the same file structure at the same time. Further, once a serial port is checked out by a client, it is assigned to the client. This is like the spin-lock service provided by the operating system, only in the application layer. Naturally, deadlock will occur if a resource is not released, therefore the client of the resource is tracked. Recalling a resource is required for the POP DP by virtue of the implementation of an interface. The policy on how to break a deadlock (by honoring the recall) is application specific. As the operating system is often thought of as the arbiter of consumed resources (i.e., tape drives, serial ports, etc.) we frequently leave it to an operating system implementation to resolve these contention issues. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on naming conventions (which are not well standardized). The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. The POP Design Pattern can take on the role of the peer method mapper that homogenizes the API for different operating environments. That is, it can wrapper the different locking mechanisms used in different operating systems. POP that is responsible for keeping track of the instances created and the client that has checked them out. The POP Design Pattern is implemented using the Singleton Design Pattern. In Java, the POP implementation is declared final, so that it cannot be subclassed. The class also has a private constructor, so that other classes cannot instance it. The new design pattern is called the POP design pattern and it provides a way to check out and create instances with given parameters. Applicability Use the POP Design Pattern when: 1. There must be exactly one instance of a class with the given parameters in a given context. 2. The instances must be accessible to clients from a well-known access point. 3. The instances are reusable. 4. Only one client can check out an instance at a time. Structure Insert UML diagram here. Participants The POP Clients that need instances 1. The POP defines an instance upon request from a client, if, and only if, the instance does not already exist. 2. The POP returns the instance to the client. 3. The POP is responsible for creating unique instances from given parameters. 4. The POP is responsible to recalling instances from clients. Collaborations Clients obtain a reference to a POP instance only through the singleton design pattern. If the POP instance is left in an improper state (e.g., the serial port was left open) it is NOT the role of the POP to close the IO port. However, the POP can be requested to get the instance released. Nor is it the role of the POP Design Pattern to open the port. That role is delegate to some other part of the system. Further, it is the role of the POP Design Pattern to check out resources. However, it is still possible to have, multiple threads that have multiple references to the same resource at the same time. Checkout and resource requests are MUTEX locked (i.e., synchronized). Consequences The POP Design Pattern has several benefits: 1. Controlled access to parametrically defined instances. Since the POP encapsulates its instances, there is some limited control over how and when clients access it. 2. Reduced name space. The POP pattern avoids global variables that store instances created from the same parameter. Implementation Here are implementation issues to consider when using the POP pattern: 1. Unique mapping of parameters. The POP pattern requires that there be a mean to isomorphically map the parameter space into the instance space and back again. 2. Ensure unique instances. The POP pattern makes unique instances from parameters, and it does so only once. 3. Cache instances for fast retrieval. The POP must be able to look up instances, given some set of parameters, and do so from some data structure. That is, there must be enough space to hold references to all the instances the program will need. Also, a mechanism is needed to look up and retrieve the instances quickly enough to satisfy the clients. Sample Code To be written....any volunteers? Thanks! - Doug >I don't think I get it > >On Mar 22, 2006, at 9:36 AM, David Garnier wrote: >>Using the singleton pattern in this case is >>just convenient for the programmer. Problems >>arises >>pretty quickly, especially if you attempt to unit-test your classes. > > >so you're saying that something isn't so good >because you can not test it in the convenient >way? >if that's true, I'm totally disagree >change your test, debug whatever, but if >software is efficient at runtime, works fine and >only problem is some unit test >(which is some kind of framework for testing) >then dump that unit test , dump that unit >framework and make something appropriate to the >software >you're testing > >so if Douglas want to use singletons, what's the problem? >and what do you mean by abusing of singleton usage? > >of course singleton doesn't prevent concurrent >access to the resource across the processes >unless >you're using some OS facility to prevent it, besides >singleton as it was introduced is relevant only >and only inside of the same process >otherwise it's not singleton it's something else >(let's say network singleton: so you have remote >invocation facility >and some factory method that return object created by that facility) > >I don't have any problem with using any kind of singletons. > Parametric Singleton idea (if I understand it >right) could be easily implemented in the >following way: >use a map >populate map with instances of some class and key is your parameter >(you can use lazy population too) > >if somebody ask the key check the value if it's null so resource is taken >if somebody returns the resource put it back to the map > >public synchronized static Object getSomeResource(Object parameter); >public synchronized static void returnResource(Object parameter); > >getSomeResource (inside of the same process) could return null in 2 cases >1. if somebody (from other thread for example) already took that resource >2. if OS API said that resource corresponded to >that parameter (serial port with parameter = 1 >(port #)) >is locked and unavailable; >I'm not sure that in case of serial ports we >even need those Parametric Singletons >(unless lock checking is a very expensive operation) >just ask the OS about availability of that >resource and if it's available give it away >and then OS will lock it and therefore in next >time somebody ask it just answer that resource >is locked >and return null > >for example system has 2 serial ports available >so I ask getResource("tty"); >or I ask getResource("Bluetooth-Modem"); > >and if OS is ok you can give tty or Bluetooth-Modem or both > >no need for any additional pattern I think > >back to the problem >mac os x doesn't recognize locking via files, so >it handles locking via some API >an instance of the singleton in each process >should recognize that resource is locked >(by using that API) that's all >we don't have to make things more complicate >then they are just because there is some nice >design pattern or nice unit test framework or whatever >keep things simple, make them work fast, don't introduce middle layers >unless you have really good reason to do so > >of course I could be entirely wrong, so sorry about that in advance > >thanks > > >Dmitry Markman > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx >Good day, > >I guess that only a selected few (hi Trent) will be able to answer? >this question, but the answer might be interesting for anyone trying? >to debug or understand the code. > >Apparently the MonitorThread is started and stopped in? >RXTXPort.addEventListener and RXTXPort.removeEventListener. This? >would indicate that (originally?) the MonitorThread is only required? >when there is an EventListener. However the MonitorThread is also? >started in the RXTXPort constructor, which could mean that RXTX won't? >work at all if it isn't there. > >It seems to me, that if anyone would add an event listener and later? >on remove it, he could potentially wreak the port. Because the second? >action would kill the MonitorThread. > > >For the moment I am only trying to understand the role of and idea? >behind the MonitorThread. But of course there is a deeper reason thor? >my question: > >If the MonitorThread needs to exist anyway, it could be the thread? >that cleans up the port (ie calls nativeClose) - this would eliminate? >(a further) problem I am seeing with some USB drivers on Mac OSX.? >(Close blocks (after releasing the tty, but still) in the USB driver? >if the device is "not responding"). > >Greetings, >Joachim > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Sat May 13 10:07:37 2006 From: joachim at buechse.de (Joachim Buechse) Date: Sat, 13 May 2006 18:07:37 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Douglas, Looking at the current code, leaves me with the feeling, that there is a lot to do. Defining an API that wraps javax.comm to provide what you describe is certainly possible, but I wonder how much benefit it will actually provide. Personally I think the API defined by javax.comm "request/lock" a port with: cp= new CommunicationPort(identifier) "release" a port with: cp.close(); works quite nice for 99% of the applications. In my experience, the most efficient and elegant implementation is to wrap a port/socket/.. into a business object which declares the remote operations that are possible. Ie "uploadFile", "waitForPrompt", "getSerialNumber", "sendContact", "executeCommand", etc Those methods are then either synchronized or guarded by a monitor. I do not see how your design pattern applied to the port resource would help implementing this. [details start, skip if you agree to the above] When I talked about "thread-safe" I didn't mean several independent "sessions" accessing the port concurrently. I think this is a very rare usage. I believe the most common use case for serial ports today is the control of an external device from a PC running a GUI based application. To implement a clean Swing/AWT-GUI one needs to pass any action that can block to a "worker" thread (else the GUI blocks, the application appears dead). While it is possible to use own prespawned thread that will accept Runnables which operate on the port, this is not very elegant. It is more common to spawn a new thread for every action triggered by the user. Additionally the ABORT of a running operation is often implemented via a port.close() delegated to a different thread. - During the lifetime of a port, it will usually be accessed from several different threads. Instance variables need to be set/read in synchronized regions to guarantee a correct operation based on the Java memory model. - Synchronizing the access is usually handled on the application level (synchronizing the reads/writes is usually useless from the applications view because it is not a transaction mechanism). [details end] I am very open to learn about other scenarios where your proposed design pattern applied to the port resource is beneficial to the application implementor. Best regards, Joachim On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > Dmitry suggests that we acquire an implementation of > a serial port reference, use it, then release it (i.e., check it > back in). > > Joachim says that making serial ports thread friendly might be a > good idea. > > This is a good idea. The design pattern that is close to this idea > is the "Object Pool Design Pattern". > # Object Pool From jredman at ergotech.com Sun May 14 14:28:24 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 14:28:24 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers Message-ID: <446792E8.4000506@ergotech.com> Does anyone know of any work to make RXTX work with Ethernet (telent) Terminal Servers? If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? We've used RXTX with upwards of 100 virtual COM ports on Windows and it works well. Linux is more problematic. It would be good to have an OS independent solution to accesses remote Ethernet serial ports. Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From legolas.w at gmail.com Sun May 14 14:26:34 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:56:34 +0430 Subject: [Rxtx] does any one have a working sample of RXTX and LPT port Message-ID: <4467927A.4000008@gmail.com> Hi Thank you for reading my post does any one has a working sample for RXTX and LPT port ? Thanks From legolas.w at gmail.com Sun May 14 14:27:29 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:57:29 +0430 Subject: [Rxtx] does RXTX support Trigerr on parallel port? Message-ID: <446792B1.4040905@gmail.com> Hi does RXTX support trigger on LPT port ? if so , how i can use it ? Thanks From tjarvi at qbang.org Sun May 14 17:40:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 17:40:59 -0600 (MDT) Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: <446792E8.4000506@ergotech.com> References: <446792E8.4000506@ergotech.com> Message-ID: On Sun, 14 May 2006, Jim Redman wrote: > Does anyone know of any work to make RXTX work with Ethernet (telent) > Terminal Servers? > > If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 > Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? > Hi Jim It appears the author of NVTCom has decided to release the library into the public domain. Integration with rxtx is possible but it would be best to contact the author and find out what his intent is. I would suggest contacting the author with a proposal of what you would like to do and take it from there. We could 'take' public domain software but its better to show respect to the authors and respect their wishes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:10:23 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:10:23 -0600 (MDT) Subject: [Rxtx] does any one have a working sample of RXTX and LPT port In-Reply-To: <4467927A.4000008@gmail.com> References: <4467927A.4000008@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > Thank you for reading my post > does any one has a working sample for RXTX and LPT port ? > Thanks Hi Legolas LPT port support in rxtx is spotty. That means some people have sent in patches for what they do and it works well for them. The original code was not very good. It may have been 3 hours work :/ To get started, Sun has some demo programs with their commapi. With rxtx 2.1 you can change their code from using javax.com to gnu.io and it -should- work. But if it does not you can post here and on bugzilla. There has been more interest lately off the list and maybe there will be enough community resources to get what you need going. If you do get a sample program together, we would gladly put it in the contrib directory so the next person can get things going faster. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:12:12 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:12:12 -0600 (MDT) Subject: [Rxtx] does RXTX support Trigerr on parallel port? In-Reply-To: <446792B1.4040905@gmail.com> References: <446792B1.4040905@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > does RXTX support trigger on LPT port ? > if so , how i can use it ? > Hi Legolas As mentioned in the previous post, rxtx parallel support is not very mature. But if you can point to something that describes the trigger feature, we can probably make sure its there and give a quick code example. -- Trent Jarvi tjarvi at qbang.org From jredman at ergotech.com Sun May 14 22:22:48 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 22:22:48 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: References: <446792E8.4000506@ergotech.com> Message-ID: <44680218.4080008@ergotech.com> Trent, Trent Jarvi wrote: > On Sun, 14 May 2006, Jim Redman wrote: > >> Does anyone know of any work to make RXTX work with Ethernet (telent) >> Terminal Servers? >> >> If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 >> Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? >> > > Hi Jim > > It appears the author of NVTCom has decided to release the library into > the public domain. Integration with rxtx is possible but it would be best > to contact the author and find out what his intent is. > > I would suggest contacting the author with a proposal of what you would > like to do and take it from there. We could 'take' public domain software > but its better to show respect to the authors and respect their wishes. > I sent Marco(?), the author of the library, a note before asking the list - I'll let you know the response. If anyone is already working on it, or has an interest and more time and energy than me, I'd hate to duplicate the efforts. If no one is, and no one objects, maybe I'll see what I can do. Jim > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From Christian.Klemke at t-online.de Mon May 15 02:23:06 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Mon, 15 May 2006 10:23:06 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu><004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: <008a01c677f8$cae18590$02fea8c0@NB600> Hi Trent, Hi Paul, I finally found some time to create a simple patch to enable the optional suppression of version output to the console. It is based on a new system property called "gnu.io.rxtx.NoVersionOutput" which can by set to "true" if necessary. I had some problems accessing CVS, therefore I downloaded the rxtx-2.1-7r2 source archive from ftp.qbang.org (which is linked on the rxtx.org download page) and worked with that release. Please find my proposed patch in the attachment ! Regards, Christian ----- Original Message ----- From: "Trent Jarvi" To: "RXTX Developers and Users" Cc: ""Paul Gettings"" Sent: Friday, May 05, 2006 2:09 PM Subject: Re: [Rxtx] RXTX causing stdout messages > On Fri, 5 May 2006, Christian Klemke wrote: > >> Hi Paul, >> >> I was wondering about the same question some days ago and took a look at >> the >> source files. Unfortunately, I found that you can only get rid of that >> messages by altering and recompiling the Java code. There is a final >> static >> boolean variable called "devel" in the file "RXTXCommDriver.java" which >> is >> set to "true". This constellation causes the output after the native >> libraries have been loaded. No mechanism exists to suppress them >> otherwise >> :-(. >> >> Trent, does that mean that 2.1.7 is still officially a "development" >> version >> ? When will this value be changed to "false" by default ? With 2.1.8 ? It >> would be nice to provide a means to suppress such messages besides that >> static flag (maybe by setting a property called >> "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The >> output can indeed by annoying, especially when used with console >> applications, where the message potentially appears "in the middle" of >> your >> own output. Another possibility would be not to use System.out directly, >> but >> instead some PrintStream field which is initially set to System.out but >> can >> programatically be changed. That would allow for any kind of redirection >> or >> suppression by implementing appropriate user-defined PrintStream >> subclasses >> and making RXTX use that stream. What do you think ? >> > > A patch for using properties would be accepted I'm sure. > > The reason the default is to display the message is not related to the > development state of rxtx anymore. The problem is that people first using > rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. > The message prevents a great deal of email thats easily explained by the > message. > > I question if we should support rxtx 2.0 at all anymore. > > If you post a patch in bugzilla, we'll put it into CVS this weekend. > we'll be going through and doing such things anyhow. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_version_output_patch.diff Type: application/octet-stream Size: 991 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060515/3173c2b6/rxtx_version_output_patch-0010.obj From lyon at docjava.com Mon May 15 06:06:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 May 2006 08:06:21 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Joachim makes several good points. Let me see if I can address some of them below: >Hello Douglas, > >Looking at the current code, leaves me with the feeling, that there? >is a lot to do. Yes! >Defining an API that wraps javax.comm to provide what? >you describe is certainly possible, but I wonder how much benefit it? >will actually provide. > >Personally I think the API defined by javax.comm > >"request/lock" a port with: > cp= new CommunicationPort(identifier) >"release" a port with: > cp.close(); > >works quite nice for 99% of the applications. I don't know what percentage of applications turn off locking, the way that I do in my version of the RXTX lib. I do know that this is not safe practice. I also know that it was motivated by the multi-platform nature of my code and that this was the only way I could make things work, at the time. Java does not appear to have a cross-platform standard for locking resources on various platforms. Each OS appears to have its own standard. The question of who breaks deadlocks and how this is done remains open, as this is not an easy question to resolve. Let me continue, below: > >In my experience, the most efficient and elegant implementation is to? >wrap a port/socket/.. into a business object which declares the? >remote operations that are possible. Ie "uploadFile",? >"waitForPrompt", "getSerialNumber", "sendContact", "executeCommand",? >etc Those methods are then either synchronized or guarded by a? >monitor. I do not see how your design pattern applied to the port? >resource would help implementing this. I have no problem with high-level wrappers that are application specific. That is a very good idea, but orthogonal with respect to the issue of deadlocks. More below: > >[details start, skip if you agree to the above] >When I talked about "thread-safe" I didn't mean several independent? >"sessions" accessing the port concurrently. I think this is a very? >rare usage. That is probably why turning locking off works so well! On the other hand, it is not safe and I shouldn't do it. >I believe the most common use case for serial ports today? >is the control of an external device from a PC running a GUI based? >application. To implement a clean Swing/AWT-GUI one needs to pass any? >action that can block to a "worker" thread (else the GUI blocks, the? >application appears dead). While it is possible to use own prespawned? >thread that will accept Runnables which operate on the port, this is? >not very elegant. It is more common to spawn a new thread for every? >action triggered by the user. Additionally the ABORT of a running? >operation is often implemented via a port.close() delegated to a? >different thread. Here lies the heart of serial port concern. An application opens a serial port and then dies. The application is restarted and finds the port locked. How do we clear the lock? Must the application's user reside in the UUCP group? Must installers of the serial port add users to the UUCP group? Should locking be handled at a high-level of abstraction in an operating system independent way? Should the implementation of the locking mechanism be translated into an API that is dependent on the OS convention? Suppose that we restrict the discussion to serial ports. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on inconsistent naming conventions. Hence my feeling that we need to mirror what is done in other API's; we need a locking toolkit that references peer methods, IMHO. >From the Java programming point of view, the locking API is portable across different platforms, but has, as its implementation, a native peer method that uses the conventions of the underlying OS. This enables portable resource locking (in theory!). Consider, for example: org.apache.commons.transaction.locking with: Interface LockManager at: http://jakarta.apache.org/commons/transaction/apidocs/org/apache/commons/transaction/locking/LockManager.html Or, more recently: java.util.concurrent.locks Interface Lock based on Doug Lea's code: http://kickjava.com/src/EDU/oswego/cs/dl/util/concurrent/ReadWriteLock.java.htm Should we incorporate a clean, portable design into serial port use, one that is consistent with current locking APIs? Basically, a comm port is a resource and resources are typically controlled by managers. Thus, I suggest that we make use of a CommPortManager to help control and centralize serial port usage. The question of how this is done remains open, IMHO, but using core API's like: java.util.concurrent.locks might not be amiss. High-level methods (getAllPorts, getAllSerialPorts, getAllParallelPorts, etc...) might be welcome additions. Basic questions like, "what if a port is in use?" remain open, hence my proposal for the new design pattern. Isn't it the CommPortManager's role to break the deadlock? Cheers! - Doug > >- During the lifetime of a port, it will usually be accessed from? >several different threads. Instance variables need to be set/read in? >synchronized regions to guarantee a correct operation based on the? >Java memory model. >- Synchronizing the access is usually handled on the application? >level (synchronizing the reads/writes is usually useless from the? >applications view because it is not a transaction mechanism). >[details end] > >I am very open to learn about other scenarios where your proposed? >design pattern applied to the port resource is beneficial to the? >application implementor. > >Best regards, >Joachim > >On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > >> Dmitry suggests that we acquire an implementation of >> a serial port reference, use it, then release it (i.e., check it? >> back in). >> > > Joachim says that making serial ports thread friendly might be a? >> good idea. >> >> This is a good idea. The design pattern that is close to this idea >> is the "Object Pool Design Pattern". >> # Object Pool > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Mon May 15 06:58:19 2006 From: joachim at buechse.de (Joachim Buechse) Date: Mon, 15 May 2006 14:58:19 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Doug, I agree fully, that locking of the system resource should be abstracted from the user (programmer). Currently this is already the case, but I agree it might be nice to extract the code into a separate class, which uses platform dependent providers to do its job. What I described in my email was not targeted at allocating the system resource, but at handling an already allocated system resource inside the framework. I agree that it may be possible to combine the two - however, I would suggest to do this in phase2. I can contribute a work over of RXTXPort.java which implements clean internal locking and proper close behavior (which I would call phase 1). I could do this this week. However I strongly believe that there is little sense in trying to do this as a series of patches. It will be closer to a rewrite than to a patch. I have already provided a number of suggested patches via Bugzilla, but this is quite inconvenient (for me). My working copy diverges more and more from the master and hence it gets more and more annoying to provide self contained patches. Best regards, Joachim From tjarvi at qbang.org Mon May 15 08:27:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 May 2006 08:27:51 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Mon, 15 May 2006, Joachim Buechse wrote: > Hello Doug, > > I agree fully, that locking of the system resource should be > abstracted from the user (programmer). Currently this is already the > case, but I agree it might be nice to extract the code into a > separate class, which uses platform dependent providers to do its job. > > What I described in my email was not targeted at allocating the > system resource, but at handling an already allocated system resource > inside the framework. I agree that it may be possible to combine the > two - however, I would suggest to do this in phase2. > > I can contribute a work over of RXTXPort.java which implements clean > internal locking and proper close behavior (which I would call phase > 1). I could do this this week. > > However I strongly believe that there is little sense in trying to do > this as a series of patches. It will be closer to a rewrite than to a > patch. I have already provided a number of suggested patches via > Bugzilla, but this is quite inconvenient (for me). My working copy > diverges more and more from the master and hence it gets more and > more annoying to provide self contained patches. > For methodical testing purposes (which does go on) the incremental patches are better. I'm lagging behind in bugzilla but thats soon to change (this week). It has just been rather chaotic up until now. I moved, purchased a house, and jumped into the fire of a feature freeze timeframe at a new job. btw, we see the Solaris close issues on 2.8 also. 9 and 10 are fine. I'll work towards making those test results public and allow others to run new rxtx code through them. We had the OK at one point but setting up the environment is involved. It isn't just a collection of java classes. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Tue May 16 02:01:47 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:01:47 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] Message-ID: <446986EB.209@willicon.de> Hi, any ideas for my problem? Hans -------- Original-Nachricht -------- Betreff: [Rxtx] Problem under Mac OSX 10.3.9 Datum: Mon, 08 May 2006 18:47:20 +0200 Von: WILLICon Antwort an: RXTX Developers and Users An: RXTX Developers and Users Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/b0741c2b/attachment-0010.html From joachim at buechse.de Tue May 16 02:15:08 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 10:15:08 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: Hello Hans, I am using RXTX on OS X for my own project. I do not see the problem you describe. I had some troubles installing it because the current version uses lock files which is non-standard on OS X. I have created a patched version which I currently use. This version does not need to modify user groups and hence does not need an installer. I just pop it in the application directory. If you send me a link where I can download your OSX installer, I will have a quick look. Regards, Joachim On 16.05.2006, at 10:01, WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we > have some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + > spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + > spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always > the value "false". > I can only get the status, while I open the port and catch the > exception. > > Any ideas? > > Hans > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail at willicon.de Tue May 16 02:26:53 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:26:53 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: References: <446986EB.209@willicon.de> Message-ID: <44698CCD.7050709@willicon.de> Joachim, tanks for the answer. I'll send You a mail. Hans Joachim Buechse schrieb: > Hello Hans, > > I am using RXTX on OS X for my own project. I do not see the problem > you describe. > > I had some troubles installing it because the current version uses > lock files which is non-standard on OS X. I have created a patched > version which I currently use. This version does not need to modify > user groups and hence does not need an installer. I just pop it in > the application directory. If you send me a link where I can download > your OSX installer, I will have a quick look. > > Regards, > Joachim > > On 16.05.2006, at 10:01, WILLICon wrote: > > >> Hi, >> >> any ideas for my problem? >> >> Hans >> >> -------- Original-Nachricht -------- >> Betreff: [Rxtx] Problem under Mac OSX 10.3.9 >> Datum: Mon, 08 May 2006 18:47:20 +0200 >> Von: WILLICon >> Antwort an: RXTX Developers and Users >> An: RXTX Developers and Users >> >> >> Hi, >> >> I use for RXTX for communicate with CyclingComputers. >> >> It works good under Win32, Sloaris and Linux but with Mac OSX we >> have some problems. >> >> My users install the Mac OSX serial lib from the actual binary. >> >> After starting the program, they get this error message: >> >> java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while >> loading gnu.io.RXTXCommDriver >> >> Remember, this error comes only under Mac OSX. >> >> That is the code for the error: >> >> Enumeration portList = CommPortIdentifier.getPortIdentifiers(); >> spInUse = getBundleStr("serialPortInUse"); >> spFree = getBundleStr("serialPortFree"); >> while (portList.hasMoreElements()) { >> CommPortIdentifier portId = (CommPortIdentifier) >> portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (osName != null && osName.startsWith("mac")) { >> if (!portId.getName().startsWith("dev/cu.")) { >> continue; >> } >> } >> if (portId.isCurrentlyOwned()) { >> serialPortNames.add(portId.getName() + " - " + >> spInUse); >> } >> else { >> serialPortNames.add(portId.getName() + " - " + >> spFree); >> } >> } >> } >> if (serialPortNames.size() == 0) { >> serialPortNames.add(getBundleStr("serialPortNotFound")); >> } >> >> BTW: The methode isCurrentlyOwned() is not working. I get always >> the value "false". >> I can only get the status, while I open the port and catch the >> exception. >> >> Any ideas? >> >> Hans >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/948333be/attachment-0010.html From jredman at ergotech.com Tue May 16 07:35:52 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 16 May 2006 07:35:52 -0600 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: <4469D538.6070408@ergotech.com> Hans, I have no direct insight, but would note that what you have is a "NoClassDefFoundError" not a "ClassNotFoundException". So the class javax/comm/CommDriver is found, but one of its dependencies is missing. NoClassDefFoundError are a bigger problem to resolve because you get no indication of the real problem. Jim WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we have > some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > * spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always the > value "false". > I can only get the status, while I open the port and catch the exception. > > Any ideas? > > Hans > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.de Tue May 16 08:01:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 16:01:21 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 In-Reply-To: <4469AFC3.6000002@willicon.de> References: <44698EBC.8000008@willicon.de> <8C5680C4-E2BA-42FF-B221-36E1124FA6A4@buechse.de> <4469AFC3.6000002@willicon.de> Message-ID: <9825A602-D6ED-4C28-BF33-9A7C984FACD5@buechse.de> Hallo Hans, you include RXTX 2.17 in your "bikeXexperience.jar" (2.17 uses Interfaces from gnu.io.* not javax.comm.*). Now inspect your error log closely: The class gnu.io.RXTXCommDriver tries to load javax.comm.CommDriver: this is only the case for RXTX 2.07. I assume, that the user has installed Version 2.07 into one of the java.ext.dirs . The VM always tries to load classes from the "system" path first. The current Mac installer distributed with RXTX in fact installs RXTXcomm.jar and librxtxSerial.jnilib into /Library/Java/Extensions. (I wrote some time ago that I consider this as a bad idea because of potential version conflicts-> thanks for delivering the example). For 2.07 it does so without installing the javax.comm classes it seems. I would recommend that you instruct your users to install version 2.17 only. Until RXTX is changed to use TIOCEXCL instead of lock files, you can hardly avoid the installer, as the user needs to be added to a special group and a lockfile directory needs be created. More precisely you are waiting for: http://bugzilla.qbang.org/show_bug.cgi?id=50 [RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL)] Regards, Joachim -------------- next part -------------- A non-text attachment was scrubbed... Name: log.tiff Type: image/tiff Size: 38394 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/e3e52128/log-0010.tiff -------------- next part -------------- > > Ich verwende RXTX 2.17. Das orginal RXTXcomm.jar ist in > CyclingDataManager.jar enthalten. > From tjarvi at qbang.org Wed May 17 23:18:15 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 May 2006 23:18:15 -0600 (MDT) Subject: [Rxtx] update Message-ID: So we have several patches and these have stacked up. I'd like to thank everyone for being patient. Tests for the most intrusive patches look good so far. I still have to get some bits together on my end but it looks like we can catch everything up in CVS this week. I'll try to post a normal list of what went in by whom with links Saturday. But I'm not seeing anything that raises flags yet. I also think I'll be able to submit a patch for nonstandard baud rates. I have to confirm w32 but I think its going to be a one line fix. I don't know if its bugzilla or people tinkering with patch files before submitting but patches are not applying cleanly. So the patches have to be done by hand. This may make things difficult for people hoping to add other patches on top. I'm trying to make that go well but ... -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Thu May 18 02:23:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 May 2006 10:23:47 +0200 Subject: [Rxtx] update In-Reply-To: References: Message-ID: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Hello Trent, in fact I tinkered with the patches (never used this mechanism before, usually I "communicate" via cvs) ... so sorry for any trouble you had applying them. Basicly I edited the patches to make them self contained. Having the tests run with different speeds on different platforms, may well be an effect of caching. I have seen quite interesting propagation delays for the closing flag on my PowerPC system, which makes me doubt, that the propagation of output_buffer_empty_flag works as it should. Maybe the communication mechanism between the two threads should be replaced by something like pthread_cond_*. Could you describe which problems you see on Solaris/SPARC? I'd be interested to see if they exist on OS X (PowerPC) as well... As you seem to work on the stuff at the moment I would like to suggest the following additions (it looks more than it is, I posted some context to make clear where to apply the change). See the comments in braces for what was changed Greetings, Joachim (1) The end of the drain loop could be: --- report("drain_loop: received EINTR in tcdrain\n"); --- (added "in tcdrain" to make debug output clearer) (2) The start of the drain loop should be: --- for(i=0;;i++) { report_verbose("drain_loop: looping\n"); #if defined(__sun__) /* FIXME: No time to test on all OS's for production */ if( eis->eventloop_interrupted ) { goto end; } if (usleep(5000)) { report("drain_loop: received EINTR"); } #else if (usleep(1000000)) { report("drain_loop: received EINTR"); } #endif /* __sun__ */ --- (added a check for "eis->eventloop_interrupted" before the sleep) (3) The end of interrupt_event_loop could (and maybe should) be: --- #if !defined(TIOCSERGETLSR) && !defined(WIN32) /* make sure that the drainloop unblocks from tcdrain */ pthread_kill(index->drain_tid, SIGABRT); /* TODO use wait/join/SIGCHLD/?? instead of sleep? */ usleep(50 * 1000); /* Under normal conditions, SIGABRT will unblock tcdrain. However a non-responding USB device combined with an unclean driver may still block. This is very ugly because it may block the call to close indefinetly. */ if (index->closing != 1) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); index->closing = 1; } #endif report("interruptEventLoop: interrupted\n"); --- (added some comments and pthread_cancel for resisting drain thread) On 18.05.2006, at 07:18, Trent Jarvi wrote: > > So we have several patches and these have stacked up. I'd like to > thank > everyone for being patient. > > Tests for the most intrusive patches look good so far. I still > have to > get some bits together on my end but it looks like we can catch > everything > up in CVS this week. > > I'll try to post a normal list of what went in by whom with links > Saturday. But I'm not seeing anything that raises flags yet. I also > think I'll be able to submit a patch for nonstandard baud rates. > I have > to confirm w32 but I think its going to be a one line fix. > > I don't know if its bugzilla or people tinkering with patch files > before > submitting but patches are not applying cleanly. So the patches > have to > be done by hand. This may make things difficult for people hoping > to add > other patches on top. I'm trying to make that go well but ... > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu May 18 22:28:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 18 May 2006 22:28:00 -0600 (MDT) Subject: [Rxtx] update In-Reply-To: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> References: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Message-ID: On Thu, 18 May 2006, Joachim Buechse wrote: > Hello Trent, > > in fact I tinkered with the patches (never used this mechanism > before, usually I "communicate" via cvs) ... so sorry for any trouble > you had applying them. Basicly I edited the patches to make them self > contained. I think we are close to moving towards that. > > Having the tests run with different speeds on different platforms, > may well be an effect of caching. I have seen quite interesting > propagation delays for the closing flag on my PowerPC system, which > makes me doubt, that the propagation of output_buffer_empty_flag > works as it should. Maybe the communication mechanism between the two > threads should be replaced by something like pthread_cond_*. Could > you describe which problems you see on Solaris/SPARC? I'd be > interested to see if they exist on OS X (PowerPC) as well... This is interesting. I have seen problems with output buffer empty in applications that require it. I'm trying to get a bug list and or test results open for everyone to see but that may take time. But missed output buffer events ... yep. With Sparc, we have seen a few things. One was a kernel race condition that went away when we reimaged and updated 2.8. RXTX was hanging on close, top showed no cpu use but there was 2 second delays just typing on console. The other is our tests now take ~4 times longer on Solaris. Someone is looking at timing just open, close, read, write, ... to see if they can find where the slowdown is. This happened after solaris 2.8. I'll try to share more when/if there is something interesting. This may well not be solvable in userland. > > As you seem to work on the stuff at the moment I would like to > suggest the following additions (it looks more than it is, I posted > some context to make clear where to apply the change). See the > comments in braces for what was changed I'll take a look. This could all come together Saturday but I also have an event to attend that day. I may not wrap this up until Sunday. -- Trent Jarvi tjarvi at qbang.org From andrewlord at internode.on.net Sun May 21 20:10:02 2006 From: andrewlord at internode.on.net (Andrew Lord) Date: Mon, 22 May 2006 11:40:02 +0930 Subject: [Rxtx] Kernel include files do not match kernel Message-ID: <200605221140.03271.andrewlord@internode.on.net> Hi, I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel 2.6.12-18 with the command: ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include However I get the message: ## checking java.version 1.5.0_06 ## checking os.version 2.6.12-18mdk ## ## WARNING: Kernel include files do not match the current kernel ## ## configure: creating ./config.status etc. Is there a problem with the way I'm specifying the 'include' directory ? If not, how else can I specify the correct directory for the include files please ? Cheers, Andrew From tjarvi at qbang.org Sun May 21 20:31:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 May 2006 20:31:31 -0600 (MDT) Subject: [Rxtx] Kernel include files do not match kernel In-Reply-To: <200605221140.03271.andrewlord@internode.on.net> References: <200605221140.03271.andrewlord@internode.on.net> Message-ID: On Mon, 22 May 2006, Andrew Lord wrote: > Hi, > > I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel > 2.6.12-18 with the command: > > ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk > CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include > > However I get the message: > > ## checking java.version 1.5.0_06 > ## checking os.version 2.6.12-18mdk > ## > ## WARNING: Kernel include files do not match the current kernel > ## > ## configure: creating ./config.status > etc. > > Is there a problem with the way I'm specifying the 'include' directory ? If > not, how else can I specify the correct directory for the include files > please ? > Hi Andrew I'm fairly sure your --with-kernel option does nothing. The CPPFLAGS should do what you want. Maybe put an #error message in /usr/src/linux.../incude/linux/version.h But I don't recall a recent problem with version missmatches. It should work. Distros will even ship include files that don't match versions exactly. In theory it should never matter for users. I used to compile new kernels by hand and really didnt have a distro. I didnt have a seperate package of kernel headers for users (myself). When changing a gateway from linux 1.2.12 to 2.1.77, I would worry about such messages. So if you are doing something that weird, the message may be of use to you. If you just see the message on a distro you installed, it is more than likely harmless. -- Trent Jarvi tjarvi at qbang.org From mrogers at spro.net Mon May 22 14:45:39 2006 From: mrogers at spro.net (Mike Rogers) Date: Mon, 22 May 2006 14:45:39 -0600 Subject: [Rxtx] Sun's CommAPI -- think May? Message-ID: <447222F3.9040302@spro.net> Hi, Any word from Sun about progress towards fixing the Java CommAPI v3 "incompatibilities" so RXTX 2.0 can operate within the framework's namespace (javax.comm)? I recall mention of a May time frame. Thanks, Mike From paul.klissner at sun.com Mon May 22 15:09:27 2006 From: paul.klissner at sun.com (Paul Klissner) Date: Mon, 22 May 2006 14:09:27 -0700 Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <447222F3.9040302@spro.net> References: <447222F3.9040302@spro.net> Message-ID: <44722887.8080308@sun.com> Mike Rogers wrote: > Hi, > > Any word from Sun about progress towards fixing the Java CommAPI v3 > "incompatibilities" so RXTX 2.0 can operate within the framework's > namespace (javax.comm)? I recall mention of a May time frame. > > Thanks, > > Mike > We've had a lot of work come in. This hasn't been the only priority. I'm running behind the plan in addressing this, but will be looking at it again soon. Rather than state a new, I'll just say it is in progress, and not off the table. I'll get this fixed as soon as I can. Good timing for asking as we just started discussing javax.comm plans today, and I'll have some cycles to work on it soon. Paul From yhua537 at cse.unsw.edu.au Mon May 22 16:03:05 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Tue, 23 May 2006 08:03:05 +1000 (EST) Subject: [Rxtx] install rxtx in XP Message-ID: Hi Guys, I am new to serial port programming, and have no experience on programming java in xp, but my project require me to builld a communication link between xp and a UART device. Most of the information in the web site seems for linux only. including the commands such as export and chmod. How do I install rxtx in xp? cheers YiQi Huang From mark at mdsh.com Tue May 23 01:24:20 2006 From: mark at mdsh.com (Mark Himsley) Date: Tue, 23 May 2006 08:24:20 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off , it includes DLLs for Windows and the JAR for Java. Follow the Windows instructions in the INSTALL. ie RXTXcomm.jar goes in \jre\lib\ext (under java) rxtxSerial.dll goes in \jre\bin So, assuming a fairly standard Java install, copy RXTXcomm.jar into C:\Program Files\Java\jre1.5.0_06\lib\ext and copy rxtxSerial.dll into C:\Program Files\Java\jre1.5.0_06\bin Yes, it really is that simple. On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > I am new to serial port programming, and have no experience on > programming java in xp, but my project require me to builld a > communication link between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang -- Mark Himsley From joachim at buechse.de Tue May 23 02:51:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 23 May 2006 10:51:47 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) Unless it is absolutely required you should NOT install RXTX in your global Java Runtime Environment. This will for sure create versioning conflicts - if not now, than in the future, if not on your system than at your clients. Instead put the dll in your application directory and include the RXTXcomm.jar in your classpath. This is much safer and not a bit more complicated. Regards, Joachim On 23.05.2006, at 09:24, Mark Himsley wrote: > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR > for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > >> I am new to serial port programming, and have no experience on >> programming java in xp, but my project require me to builld a >> communication link between xp and a UART device. >> >> Most of the information in the web site seems for linux only. >> including >> the commands such as export and chmod. How do I install rxtx in xp? >> >> cheers >> YiQi Huang > > > > -- > Mark Himsley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tod at todbot.com Tue May 23 03:12:22 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 02:12:22 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I totally agree: do not contaminate the Java installation. I put all the RXTX files in a directory and then change my java invocation to be: % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* Alternatively, use Launch4J to create a double-clickable application and keep the RXTX libraries in the directory of the application. -=tod On May 23, 2006, at 1:51 AM, Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > >> Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off >> , it includes DLLs for Windows and the JAR >> for Java. >> >> Follow the Windows instructions in the INSTALL. >> >> ie >> >> RXTXcomm.jar goes in \jre\lib\ext (under java) >> rxtxSerial.dll goes in \jre\bin >> >> So, assuming a fairly standard Java install, copy RXTXcomm.jar into >> C:\Program Files\Java\jre1.5.0_06\lib\ext >> and copy rxtxSerial.dll into >> C:\Program Files\Java\jre1.5.0_06\bin >> >> Yes, it really is that simple. >> >> >> >> On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: >> >>> I am new to serial port programming, and have no experience on >>> programming java in xp, but my project require me to builld a >>> communication link between xp and a UART device. >>> >>> Most of the information in the web site seems for linux only. >>> including >>> the commands such as export and chmod. How do I install rxtx in xp? >>> >>> cheers >>> YiQi Huang >> >> >> >> -- >> Mark Himsley >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From smontgomery at mediaspansoftware.com Tue May 23 08:46:53 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Tue, 23 May 2006 10:46:53 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: Message-ID: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Joachim and Tod mentioned how to keep the files RXTX requires on Windows XP out of the Java installations - thanks gentlemen! Are there similar suggestions for an RXTX install on OS X? The current "canonical" OS X installation instructions "contaminate the Java installation", to use Tod's words. Our app will run fine under 1.4.2 and 5.0 on OS X, and a lot of users will have both. We've already been burned by the recent switch from 1.4.2 to 5.0 as the platform default. Any suggestions welcomed. From tod at todbot.com Tue May 23 13:27:55 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 12:27:55 -0700 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <9BA0F670-A862-42E7-BB2C-130D775ABDF9@todbot.com> Hi Sean, It depends on how you build and deploy your code. If you're using shell scripts, you can do something like this: #!/bin/sh # pick one JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/ Commands/java #JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/ Commands/java $JAVA -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* That both picks which VM to use and uses the RXTX in the directory called 'rxtxlib'. If you want your shell script to be clever, you could test for the existence of the different 'java' executables and go from there (maybe even use different jar files). I am almost positive all OS X systems with Java 1.5 are guaranteed to also have Java 1.4.2. If you're using Jar Builder or XCode, you can specify which JVM to use and add the extra args in the Info.plist file. The paths specified in the 'java' invocation then are based off of the $JAVAROOT variable that the JavaApplicationStub sets for you. For my app, I've have been compiling two sets of jars, one compiled with 1.4.2 and one with 1.5, but they both run under 1.5. So I have a similar shell script that chooses a different 'javac' depending on the need. -=tod On May 23, 2006, at 7:46 AM, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From yhua537 at cse.unsw.edu.au Tue May 23 11:09:37 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 03:09:37 +1000 (EST) Subject: [Rxtx] install rxtx in XP (Mark Himsley, Joachim Buechse, Tod E. Kurt> In-Reply-To: References: Message-ID: > Message: 8 > Date: Tue, 23 May 2006 08:03:05 +1000 (EST) > From: YiQi Huang > Subject: [Rxtx] install rxtx in XP > To: rxtx at qbang.org > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > Hi Guys, > > I am new to serial port programming, and have no experience on programming > java in xp, but my project require me to builld a communication link > between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang > > > ------------------------------ > > Message: 9 > Date: Tue, 23 May 2006 08:24:20 +0100 > From: Mark Himsley > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=us-ascii; format=flowed > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > ------------------------------ > > Message: 10 > Date: Tue, 23 May 2006 10:51:47 +0200 > From: Joachim Buechse > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > > ------------------------------ > > Message: 11 > Date: Tue, 23 May 2006 02:12:22 -0700 > From: "Tod E. Kurt" > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I totally agree: do not contaminate the Java installation. > > I put all the RXTX files in a directory and then change my java > invocation to be: > > % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* > > Alternatively, use Launch4J to create a double-clickable application > and keep the RXTX libraries in the directory of the application. > > -=tod > > Hi, Thanks guys, I don't know if this is the correct way to reply your mecessage, if wrong, please point out. Thank you for Mark to give the detail instructions and Joachim to point out the cons ot installing in the java directory, and specially thanks for Tod to give the instrection in detail. Sorry to ask another stupid question: I have followed Tod's instruction. Now I think i am ready to start hacking. But where is the RXTX API documentation? Is it the same as using normal java comm API? btw, where could i find some examples to start with? Thanks very much cheers YiQi Huang From tjarvi at qbang.org Tue May 23 16:09:32 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 May 2006 16:09:32 -0600 (MDT) Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <44722887.8080308@sun.com> References: <447222F3.9040302@spro.net> <44722887.8080308@sun.com> Message-ID: > Good timing for asking as we just started discussing javax.comm plans > today, and I'll have some cycles to work on it soon. Hi Paul I assume you mean Sun is discussing plans concerning its own internal actions and there is no community involvment at this point. -- Trent Jarvi tjarvi at qbang.org From yhua537 at cse.unsw.edu.au Tue May 23 22:50:01 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 14:50:01 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } From mmester at sps.edu Tue May 23 22:58:21 2006 From: mmester at sps.edu (Michael Mester) Date: Wed, 24 May 2006 00:58:21 -0400 Subject: [Rxtx] install rxtx in XP References: Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below -----Original Message----- From: rxtx-bounces at qbang.org on behalf of YiQi Huang Sent: Wed 5/24/2006 12:50 AM To: RXTX Developers and Users Subject: Re: [Rxtx] install rxtx in XP Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3950 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060523/b36d0c63/attachment-0010.bin From yhua537 at cse.unsw.edu.au Tue May 23 23:05:50 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 15:05:50 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: Yes, Michael you are right, it should be semicolons, But it still can't find the correct library. On Wed, 24 May 2006, Michael Mester wrote: > I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below > > > -----Original Message----- > From: rxtx-bounces at qbang.org on behalf of YiQi Huang > Sent: Wed 5/24/2006 12:50 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] install rxtx in XP > > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > cheers YiQi Huang From tod at todbot.com Wed May 24 00:01:57 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 23:01:57 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Yes, sorry, classpath entries are semicolon-separated on Windows and colon-separated on everything else. Your example code below is importing the wrong set of classes. It should not "import javax.comm.*", instead it should "import gnu.io.*". When I make that change, your example program compiles. The "javax.comm" package is the one released by Sun, the "gnu.io" package is the RXTX one. You might've seen some discussion that the two will be merged or become compatible, but that hasn't happened yet. -=tod On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > > Yes, Michael you are right, it should be semicolons, But it still > can't > find the correct library. > > On Wed, 24 May 2006, Michael Mester wrote: > >> I believe the entries in the classpath need to be seperated with >> semicolons, not a colon as you have in your command below >> >> >> -----Original Message----- >> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >> Sent: Wed 5/24/2006 12:50 AM >> To: RXTX Developers and Users >> Subject: Re: [Rxtx] install rxtx in XP >> >> Hi, >> >> Sorry guys.I follow Tod's instruction, and here is what i did: >> >> put >> RXTXcomm.jar, >> rxtxParallel.dll, >> rxtxSerial.dll >> in >> C:\RXTX_files >> >> and I got a SimpleRead class attached below, compile it with : >> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >> it still saying "cannot find symbol". >> >> Is there anything I did wrong? Do I need the comm.jar from Sun? >> >> Thanks & regards >> YiQi Huang >> >> >> //////////////////////////////////////////////////////// >> // SimpleRead.java >> //////////////////////////////////////////////////////// >> >> import java.io.*; >> import java.util.*; >> import javax.comm.*; >> >> public class SimpleRead >> implements Runnable, SerialPortEventListener { >> static CommPortIdentifier portId; >> static Enumeration portList; >> InputStream inputStream; >> SerialPort serialPort; >> Thread readThread; >> public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == >> CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals("COM1")) { >> //if (portId.getName().equals("/dev/term/a")) { >> SimpleRead reader = new SimpleRead(); >> } >> } >> } >> } >> public SimpleRead() { >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", >> 2000); >> } catch (PortInUseException e) {} >> try { >> inputStream = serialPort.getInputStream(); >> } catch (IOException e) {} >> try { >> serialPort.addEventListener(this); >> } catch (TooManyListenersException e) {} >> serialPort.notifyOnDataAvailable(true); >> try { >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } catch (UnsupportedCommOperationException e) {} >> readThread = new Thread(this); >> readThread.start(); >> } >> public void run() { >> try { >> Thread.sleep(20000); >> } catch (InterruptedException e) {} >> } >> public void serialEvent(SerialPortEvent event) { >> switch(event.getEventType()) { >> case SerialPortEvent.BI: >> case SerialPortEvent.OE: >> case SerialPortEvent.FE: >> case SerialPortEvent.PE: >> case SerialPortEvent.CD: >> case SerialPortEvent.CTS: >> case SerialPortEvent.DSR: >> case SerialPortEvent.RI: >> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >> break; >> case SerialPortEvent.DATA_AVAILABLE: >> byte[] readBuffer = new byte[20]; >> try { >> while (inputStream.available() > 0) { >> int numBytes = inputStream.read(readBuffer); >> } >> System.out.print(new String(readBuffer)); >> } catch (IOException e) {} >> break; >> } >> } >> } >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > cheers > YiQi Huang > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From joachim at buechse.de Wed May 24 00:10:06 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:10:06 +0200 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Hi Sean, my preferred way of dealing with RXTX on OS X is to include the RXTX classes into my application jar and to put the RXTX lib in the same directory as this jar. To make it even more comfortable, you can include the lib in the jar and have some startup code extract it and write it to a temporary file from which you load it with System.load(). Unfortunately the current version of RXTX for OS X requires tinkering with user groups as it is based on lockfiles - and hence it needs the RXTX OS X installer or you need to duplicated this functionality in your own installer. I have created my own native version which is not based on lockfiles but tty locking (the standard way to do it on OSX). I hope that these patches will be integrated soon into the distribution. Regards, Joachim On 23.05.2006, at 16:46, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Wed May 24 00:16:12 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:16:12 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <7017ECFC-B13E-4806-B321-9FFCAC5830F0@buechse.de> I assume you downloaded rxtx-217 (not 207). Instead of importing javax.comm.* you must import gnu.io.* The classes have the same name, but they are not in the same package. On 24.05.2006, at 06:50, YiQi Huang wrote: > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From yhua537 at cse.unsw.edu.au Wed May 24 00:17:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 16:17:45 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Message-ID: Thanks Tod again, i kept reading "gnu.io.*" as "gun.io.*" last few hours after i read some commons from web. Thanks very much Tod. thanks YiQi Huang On Tue, 23 May 2006, Tod E. Kurt wrote: > Yes, sorry, classpath entries are semicolon-separated on Windows and > colon-separated on everything else. > > Your example code below is importing the wrong set of classes. It > should not "import javax.comm.*", instead it should "import > gnu.io.*". When I make that change, your example program compiles. > The "javax.comm" package is the one released by Sun, the "gnu.io" > package is the RXTX one. You might've seen some discussion that the > two will be merged or become compatible, but that hasn't happened yet. > > -=tod > > > On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > >> >> Yes, Michael you are right, it should be semicolons, But it still >> can't >> find the correct library. >> >> On Wed, 24 May 2006, Michael Mester wrote: >> >>> I believe the entries in the classpath need to be seperated with >>> semicolons, not a colon as you have in your command below >>> >>> >>> -----Original Message----- >>> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >>> Sent: Wed 5/24/2006 12:50 AM >>> To: RXTX Developers and Users >>> Subject: Re: [Rxtx] install rxtx in XP >>> >>> Hi, >>> >>> Sorry guys.I follow Tod's instruction, and here is what i did: >>> >>> put >>> RXTXcomm.jar, >>> rxtxParallel.dll, >>> rxtxSerial.dll >>> in >>> C:\RXTX_files >>> >>> and I got a SimpleRead class attached below, compile it with : >>> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >>> it still saying "cannot find symbol". >>> >>> Is there anything I did wrong? Do I need the comm.jar from Sun? >>> >>> Thanks & regards >>> YiQi Huang >>> >>> >>> //////////////////////////////////////////////////////// >>> // SimpleRead.java >>> //////////////////////////////////////////////////////// >>> >>> import java.io.*; >>> import java.util.*; >>> import javax.comm.*; >>> >>> public class SimpleRead >>> implements Runnable, SerialPortEventListener { >>> static CommPortIdentifier portId; >>> static Enumeration portList; >>> InputStream inputStream; >>> SerialPort serialPort; >>> Thread readThread; >>> public static void main(String[] args) { >>> portList = CommPortIdentifier.getPortIdentifiers(); >>> while (portList.hasMoreElements()) { >>> portId = (CommPortIdentifier) portList.nextElement(); >>> if (portId.getPortType() == >>> CommPortIdentifier.PORT_SERIAL) { >>> if (portId.getName().equals("COM1")) { >>> //if (portId.getName().equals("/dev/term/a")) { >>> SimpleRead reader = new SimpleRead(); >>> } >>> } >>> } >>> } >>> public SimpleRead() { >>> try { >>> serialPort = (SerialPort) portId.open("SimpleReadApp", >>> 2000); >>> } catch (PortInUseException e) {} >>> try { >>> inputStream = serialPort.getInputStream(); >>> } catch (IOException e) {} >>> try { >>> serialPort.addEventListener(this); >>> } catch (TooManyListenersException e) {} >>> serialPort.notifyOnDataAvailable(true); >>> try { >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, >>> SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> } catch (UnsupportedCommOperationException e) {} >>> readThread = new Thread(this); >>> readThread.start(); >>> } >>> public void run() { >>> try { >>> Thread.sleep(20000); >>> } catch (InterruptedException e) {} >>> } >>> public void serialEvent(SerialPortEvent event) { >>> switch(event.getEventType()) { >>> case SerialPortEvent.BI: >>> case SerialPortEvent.OE: >>> case SerialPortEvent.FE: >>> case SerialPortEvent.PE: >>> case SerialPortEvent.CD: >>> case SerialPortEvent.CTS: >>> case SerialPortEvent.DSR: >>> case SerialPortEvent.RI: >>> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >>> break; >>> case SerialPortEvent.DATA_AVAILABLE: >>> byte[] readBuffer = new byte[20]; >>> try { >>> while (inputStream.available() > 0) { >>> int numBytes = inputStream.read(readBuffer); >>> } >>> System.out.print(new String(readBuffer)); >>> } catch (IOException e) {} >>> break; >>> } >>> } >>> } >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> >> cheers >> YiQi Huang >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From smontgomery at mediaspansoftware.com Wed May 24 10:24:13 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 12:24:13 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: Tod & Joachim, Thanks for the info, that's very helpful. I'll give that a whirl when I move to rxtx 2.1. I'm still using the older 2.0.7 version for now (don't ask), which probably requires the Sun comm.jar, javax.comm.properties and librxtxSerial.jnilib to be in very specific places in each jvm's file hierarchy. From tjarvi at qbang.org Wed May 24 11:59:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 11:59:16 -0600 (MDT) Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: On Wed, 24 May 2006, Sean Montgomery wrote: > Tod & Joachim, > > Thanks for the info, that's very helpful. I'll give that a whirl > when I move to rxtx 2.1. I'm still using the older 2.0.7 version for > now (don't ask), which probably requires the Sun comm.jar, > javax.comm.properties and librxtxSerial.jnilib to be in very specific > places in each jvm's file hierarchy. > You will need comm.jar from Sun then. It must be Sun's version 2.* or older for Linux or Solaris. I assume they have this in download archives. The default offering from Sun is version 3.0. This version currently does not support rxtx. The older version will probably be fine for your needs. -- Trent Jarvi tjarvi at qbang.org From smontgomery at mediaspansoftware.com Wed May 24 12:19:06 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 14:19:06 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: <3939EFB8-11E1-4E3E-A684-5B3C525577CD@mediaspansoftware.com> Yup, that's right, thanks Trent. I've been using these files for quite a while now. Thanks for bringing it up. I almost didn't mention using 2.0.7 because I didn't want to give any new members of the list the wrong idea! :-) On May 24, 2006, at 1:59 PM, Trent Jarvi wrote: > On Wed, 24 May 2006, Sean Montgomery wrote: > >> Tod & Joachim, >> >> Thanks for the info, that's very helpful. I'll give that a whirl >> when I move to rxtx 2.1. I'm still using the older 2.0.7 version for >> now (don't ask), which probably requires the Sun comm.jar, >> javax.comm.properties and librxtxSerial.jnilib to be in very specific >> places in each jvm's file hierarchy. >> > > You will need comm.jar from Sun then. It must be Sun's version 2.* or > older for Linux or Solaris. I assume they have this in download > archives. > > The default offering from Sun is version 3.0. This version > currently does > not support rxtx. > > The older version will probably be fine for your needs. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mark at mdsh.com Wed May 24 15:55:46 2006 From: mark at mdsh.com (Mark Himsley) Date: Wed, 24 May 2006 22:55:46 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <37B0FC4B1F3237321F093ABE@MacMini.local> On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) That's no problem. BUT, do note that the instructions I elaborated on are in the INSTALL file within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone please update the INSTALL file? > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > > , it includes DLLs for Windows and the JAR > > for Java. > > > > Follow the Windows instructions in the INSTALL. > > > > ie > > > > RXTXcomm.jar goes in \jre\lib\ext (under java) > > rxtxSerial.dll goes in \jre\bin > > > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > > C:\Program Files\Java\jre1.5.0_06\lib\ext > > and copy rxtxSerial.dll into > > C:\Program Files\Java\jre1.5.0_06\bin > > > > Yes, it really is that simple. > > > > > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > > > >> I am new to serial port programming, and have no experience on > >> programming java in xp, but my project require me to builld a > >> communication link between xp and a UART device. > >> > >> Most of the information in the web site seems for linux only. > >> including > >> the commands such as export and chmod. How do I install rxtx in xp? > >> > >> cheers > >> YiQi Huang > > > > > > > > -- > > Mark Himsley > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Mark Himsley From tjarvi at qbang.org Wed May 24 16:41:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 16:41:46 -0600 (MDT) Subject: [Rxtx] install rxtx in XP In-Reply-To: <37B0FC4B1F3237321F093ABE@MacMini.local> References: <37B0FC4B1F3237321F093ABE@MacMini.local> Message-ID: On Wed, 24 May 2006, Mark Himsley wrote: > > > On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > >> I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > That's no problem. > > BUT, do note that the instructions I elaborated on are in the INSTALL file > within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone > please update the INSTALL file? > > The INSTALL file may be updated by anyone at anytime. http://rxtx.qbang.org/wiki/index.php/Installation We are moving it to the wiki so end users may put the type of answers they would like to see in. Sometimes it's best if developers don't give what appears to be cryptic answers. You can even put in that jre/lib/ext is not the right place but you don't understand the classpath solution mentioned on the mail-list and then we know what to add. -- Trent Jarvi tjarvi at qbang.org From stramit at gmail.com Wed May 24 21:45:31 2006 From: stramit at gmail.com (Tim Cooper) Date: Thu, 25 May 2006 13:45:31 +1000 Subject: [Rxtx] Accessing Virtual Com Port Message-ID: Hi, I have to develop an application that talks to a virtual com port (in this case com3) which translates any messages sent across a USB cable to a micro. Using C++ I can talk to this com port and I know that it is configured, present, and working. For the application that I am trying to write I want to use RXTX for the communication. My problem is that the configured virtual port (in windows) is not showing up when I do an enumeration over the available ports. The output I get is (com 3 is not present) : Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 PORT FOUND: COM1 PORT FOUND: LPT1 Is there anything that I need to do to make com3 available to RXTX and my application? Timothy Cooper -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060524/c5591648/attachment-0010.html From antonio.luis at iscte.pt Thu May 25 01:39:13 2006 From: antonio.luis at iscte.pt (=?ISO-8859-1?Q?Ant=F3nio_Lopes?=) Date: Thu, 25 May 2006 08:39:13 +0100 Subject: [Rxtx] RXTX on Pocket PC Message-ID: <44755F21.8060103@iscte.pt> Hello everyone, I've been using RXTX to communicate with serial ports in Windows and it's been quite successful. However, I'm now considering porting my application from Windows to Pocket PC but I can't seem to find the RXTX binaries (*.jar and *.dll) to use in Pocket PC. I've been "digging" on the mailing list's archives and also on the web and I can't find these anywhere. Can anyone in this mailing list give me some pointers on this? Where can I find the necessary files and basic installation instructions? Thanks very much for your help. I very much appreciate any help that you can provide me. Regards, -- Ant?nio Lopes @contact: antonio.luis at iscte.pt @work: ADETTI - ISCTE @web: http://antonio.lopes.googlepages.com/home From doug at dupreeinc.com Fri May 26 15:45:50 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Fri, 26 May 2006 14:45:50 -0700 Subject: [Rxtx] rxtx slow startup Message-ID: <4477770E.9010400@dupreeinc.com> Hello, I hope there are people still reading this mailing list. The archive appeared to not have anything new after 4/2005. I was using the commapi from sun for a project where a java application reads data from test equipment connected to the serial port. I had to upgrade the ftdi vcp driver on my pc and the old sun commapi no longer works with hardware flow control. as an experiment I replaced the javax.com with gnu.io in the SerialDemo.java project that was included with the commapi. This compiled fine using JBuilder 2006 and JRE 1.5.0_05. RXTX also works with the latest ftdi drivers so life is wonderful again... almost... When using the commapi jar the SerialDemo program starts in about 1 second on my system. Using the RXTX jar it takes over 56 seconds to start. Has anyone else seen this problem? Is there a workaround to get the startup performance close to the old commapi? The last thing printed to the console before this delay is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks for your time! Doug From yhua537 at cse.unsw.edu.au Sat May 27 05:46:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 21:46:45 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <4477770E.9010400@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> Message-ID: hi Doug The archive hasn't been update for a long time, But people certainly still reading the list. I don't have enough experience to help on your problem, but without any detail about what your problem doing during that 56 seconds, it is hard to target the your question, I think. cheers YiQi On Fri, 26 May 2006, Doug Thistlethwaite wrote: > Hello, > > I hope there are people still reading this mailing list. The archive > appeared to not have anything new after 4/2005. > > I was using the commapi from sun for a project where a java application > reads data from test equipment connected to the serial port. I had to > upgrade the ftdi vcp driver on my pc and the old sun commapi no longer > works with hardware flow control. as an experiment I replaced the > javax.com with gnu.io in the SerialDemo.java project that was included > with the commapi. This compiled fine using JBuilder 2006 and JRE > 1.5.0_05. RXTX also works with the latest ftdi drivers so life is > wonderful again... almost... > > When using the commapi jar the SerialDemo program starts in about 1 > second on my system. Using the RXTX jar it takes over 56 seconds to > start. Has anyone else seen this problem? Is there a workaround to get > the startup performance close to the old commapi? > > The last thing printed to the console before this delay is: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Thanks for your time! > > Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------- Just a student, Still a student ------------------------------- From yhua537 at cse.unsw.edu.au Sat May 27 06:04:26 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 22:04:26 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: Sorry, I don't think you could understand what I mean .I mean this: Without any detail about what your program is doing during that 56 seconds, it is hard for anyone to target the problem. On Sat, 27 May 2006, YiQi Huang wrote: > hi Doug > > The archive hasn't been update for a long time, But people certainly still > reading the list. > > I don't have enough experience to help on your problem, but without any > detail about what your problem doing during that 56 seconds, it is hard to > target the your question, I think. > > cheers > YiQi > > On Fri, 26 May 2006, Doug Thistlethwaite wrote: > >> Hello, >> >> I hope there are people still reading this mailing list. The archive >> appeared to not have anything new after 4/2005. >> >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From jredman at ergotech.com Sat May 27 08:32:02 2006 From: jredman at ergotech.com (Jim Redman) Date: Sat, 27 May 2006 08:32:02 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: <447862E2.4080506@ergotech.com> Doug, Since you mentioned it, we have a system that is also seems slow. From memory (I don't have one of the slow systems around), I'm not sure that it's consistent, it seems that sometimes it may take longer than others. Since it's part of the bootup it hasn't raised a flag and I haven't researched it. The same code runs much faster on other systems, so now you've got me wondering what's different. The slow system boots DSL (http://www.damnsmalllinux.org/) from a compact flash. FC4 is on my desktop where I haven't noticed a slow down. I think that the rxtx code is the same in both cases with lock files disabled. The slow system has a bunch of serial ports defined, including 4 USB serial ports that do not exist - they are not plugged in. Any clues in there? Jim > On Fri, 26 May 2006, Doug Thistlethwaite wrote: >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Sat May 27 10:41:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 May 2006 10:41:54 -0600 (MDT) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447862E2.4080506@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: On Sat, 27 May 2006, Jim Redman wrote: > Doug, > > Since you mentioned it, we have a system that is also seems slow. From > memory (I don't have one of the slow systems around), I'm not sure that > it's consistent, it seems that sometimes it may take longer than others. > Since it's part of the bootup it hasn't raised a flag and I haven't > researched it. > > The same code runs much faster on other systems, so now you've got me > wondering what's different. > > The slow system boots DSL (http://www.damnsmalllinux.org/) from a > compact flash. FC4 is on my desktop where I haven't noticed a slow > down. I think that the rxtx code is the same in both cases with lock > files disabled. > > The slow system has a bunch of serial ports defined, including 4 USB > serial ports that do not exist - they are not plugged in. > > Any clues in there? > rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. When it does this, it will try to open each port and do a timed out read. most systems will not have entries in device if the port is not there. But some minimal systems will just put all the device files there in case hardware is added. The list of devices scanned used to be ~10-20 times longer than it is today. That was getting very slow. I suspect moving the device files not used to a backup directory would increase the enumeration. I'll look into why the mail-list archive is not updating. The last update was about when I thought I 'fixed' the cron jobs. I probably didn't actually fix it but rather moved the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon May 29 19:46:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 May 2006 19:46:47 -0600 (MDT) Subject: [Rxtx] Mail-List Archives are updating. Message-ID: It was pointed out earlier that the archive is dated. This was a missing crontab entry. The list is currently archived by the week on the web page. It is updated once a day. So every 7 days it starts a new link and updates it daily. I've been limited in what I could do while my cable modem was disconnected this last week. rxtx.org is something I do on my own time. The patches and credits will be comming next. Many of these can be seen in bugzilla right now. -- Trent Jarvi tjarvi at qbang.org From doug at dupreeinc.com Tue May 30 11:18:41 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 10:18:41 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: <447C7E71.4080204@dupreeinc.com> Trent, YiQi, and Jim: Thanks to all for the replies and information! I am just back from a long weekend and I am now trying to figure out what I was doing! :) As for more information. First off, this example is being run under windows XP. I am developing test equipment that communicates with a java application via a serial port. I have been using the commapi for several years and have not had a problem. Recently, I have started a design modification that will replace the RS232 connection with a USB port. I am using the ftdi module for prototyping and I discovered that their virtual com port driver was not compatible with the commapi that Sun released. It turns out that it has problems with hardware flow control ( it works on incoming but not outgoing communications). The way I figured this out was by experimenting with the SerialDemo that was included with the Sum commapi. One nice thing about this example is it has the ability to set incoming and outgoing flow control independently. After I installed RXTX into my JBuilder 2006 IDE, I just replaced all all instances of javax.comm with gnu.io and it compiled and runs without a hitch (except for the slow startup). I Paused the JBuilder IDE during this long pause and the last few entries in the stack trace are: testRead() : -1, gnu.io.RXTXCommDriver registerValidPorts() : 255, gnu.io.RXTXCommDriver registerScannedPorts() : 777, gnu.io.RXTXCommDriver This was all initiated by the following call in the programs init routine: Enumeration en = CommPortIdentifier.getPortIdentifiers(); After looking at this, My guess is that Trent is correct in that the delay is in scanning for ports. I guess one solution would be to not scan for ports, though it would be nice to detect what is available on the system. Is there any way to reduce the number of ports scanned by this function in windows XP? Thanks again for your time, Doug Trent Jarvi wrote: >On Sat, 27 May 2006, Jim Redman wrote: > > > >>Doug, >> >>Since you mentioned it, we have a system that is also seems slow. From >>memory (I don't have one of the slow systems around), I'm not sure that >>it's consistent, it seems that sometimes it may take longer than others. >>Since it's part of the bootup it hasn't raised a flag and I haven't >>researched it. >> >>The same code runs much faster on other systems, so now you've got me >>wondering what's different. >> >>The slow system boots DSL (http://www.damnsmalllinux.org/) from a >>compact flash. FC4 is on my desktop where I haven't noticed a slow >>down. I think that the rxtx code is the same in both cases with lock >>files disabled. >> >>The slow system has a bunch of serial ports defined, including 4 USB >>serial ports that do not exist - they are not plugged in. >> >>Any clues in there? >> >> >> > >rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. > >When it does this, it will try to open each port and do a timed out read. >most systems will not have entries in device if the port is not there. >But some minimal systems will just put all the device files there in case >hardware is added. > >The list of devices scanned used to be ~10-20 times longer than it is >today. That was getting very slow. > >I suspect moving the device files not used to a backup directory would >increase the enumeration. > >I'll look into why the mail-list archive is not updating. The last update >was about when I thought I 'fixed' the cron jobs. I probably didn't >actually fix it but rather moved the problem. > >-- >Trent Jarvi >tjarvi at qbang.org > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/86796453/attachment-0010.html From doug at dupreeinc.com Tue May 30 14:36:09 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 13:36:09 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447C7E71.4080204@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com> Message-ID: <447CACB9.1000801@dupreeinc.com> Hello all, I also notice this pause (not as long however) when I call: CommPortIdentifier.getPortIdentifier(PortName); I would think that if I supply the name of the port, it would not have to go through the same discovery process. If you have any ideas of how to get rid of this startup delay, I would really appreciate it. Thanks, Doug Doug Thistlethwaite wrote: > Trent, YiQi, and Jim: > > Thanks to all for the replies and information! I am just back from a > long weekend and I am now trying to figure out what I was doing! :) > > As for more information. First off, this example is being run under > windows XP. I am developing test equipment that communicates with a > java application via a serial port. I have been using the commapi for > several years and have not had a problem. Recently, I have started a > design modification that will replace the RS232 connection with a USB > port. I am using the ftdi module for prototyping and I discovered > that their virtual com port driver was not compatible with the commapi > that Sun released. It turns out that it has problems with hardware > flow control ( it works on incoming but not outgoing communications). > The way I figured this out was by experimenting with the SerialDemo > that was included with the Sum commapi. One nice thing about this > example is it has the ability to set incoming and outgoing flow > control independently. > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup). > > I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are: > > testRead() : -1, gnu.io.RXTXCommDriver > registerValidPorts() : 255, gnu.io.RXTXCommDriver > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > This was all initiated by the following call in the programs init routine: > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > After looking at this, My guess is that Trent is correct in that the > delay is in scanning for ports. I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system. Is there any way to reduce the number of ports scanned by > this function in windows XP? > > Thanks again for your time, > > Doug > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/edaa5c3c/attachment-0010.html From lynn at swcp.com Tue May 30 15:07:18 2006 From: lynn at swcp.com (lynn@swcp.com) Date: Tue, 30 May 2006 21:07:18 -0000 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CACB9.1000801@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: *IF* the name of the port is supplied, we might want to use the preferences mechanism (java.util.prefs) where we could have previously saved the info for the port. We could do a quick check to see that things have not changed before using it. If things have changed (or never been defined) we would do a full port scan and save detected ports in the preferences. This way if the hardware is not changed, you only pay the time penalty one time. just an idea... Lynn Doug Thistlethwaite said: > This is a multi-part message in MIME format. > --------------070808020900080005070500 > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > Content-Transfer-Encoding: 7bit > > Hello all, > > I also notice this pause (not as long however) when I call: > > CommPortIdentifier.getPortIdentifier(PortName); > > I would think that if I supply the name of the port, it would not have > to go through the same discovery process. If you have any ideas of how > to get rid of this startup delay, I would really appreciate it. > > Thanks, > > Doug > > Doug Thistlethwaite wrote: > > > Trent, YiQi, and Jim: > > > > Thanks to all for the replies and information! I am just back from a > > long weekend and I am now trying to figure out what I was doing! :) > > > > As for more information. First off, this example is being run under > > windows XP. I am developing test equipment that communicates with a > > java application via a serial port. I have been using the commapi for > > several years and have not had a problem. Recently, I have started a > > design modification that will replace the RS232 connection with a USB > > port. I am using the ftdi module for prototyping and I discovered > > that their virtual com port driver was not compatible with the commapi > > that Sun released. It turns out that it has problems with hardware > > flow control ( it works on incoming but not outgoing communications). > > The way I figured this out was by experimenting with the SerialDemo > > that was included with the Sum commapi. One nice thing about this > > example is it has the ability to set incoming and outgoing flow > > control independently. > > > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > > all instances of javax.comm with gnu.io and it compiled and runs > > without a hitch (except for the slow startup). > > > > I Paused the JBuilder IDE during this long pause and the last few > > entries in the stack trace are: > > > > testRead() : -1, gnu.io.RXTXCommDriver > > registerValidPorts() : 255, gnu.io.RXTXCommDriver > > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > > > This was all initiated by the following call in the programs init routine: > > > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > > > After looking at this, My guess is that Trent is correct in that the > > delay is in scanning for ports. I guess one solution would be to not > > scan for ports, though it would be nice to detect what is available on > > the system. Is there any way to reduce the number of ports scanned by > > this function in windows XP? > > > > Thanks again for your time, > > > > Doug > > > > --------------070808020900080005070500 > Content-Type: text/html; charset=ISO-8859-1 > Content-Transfer-Encoding: 7bit > > > > > > > > > Hello all,
>
> I also notice this pause (not as long however) when I call:
>
>          CommPortIdentifier.getPortIdentifier(PortName);
>
> I would think that if I supply the name of the port, it would not have > to go through the same discovery process.  If you have any ideas of how > to get rid of this startup delay, I would really appreciate it.
>
> Thanks,
>
> Doug
>
> Doug Thistlethwaite wrote: >
> > Trent, YiQi, and Jim:
>
> Thanks to all for the replies and information!  I am just back from a > long weekend and I am now trying to figure out what I was doing! :)
>
> As for more information.  First off, this example is being run under > windows XP.  I am developing test equipment that communicates with a > java application via a serial port.  I have been using the commapi for > several years and have not had a problem.  Recently, I have started a > design modification that will replace the RS232 connection with a USB > port.  I am using the ftdi module for prototyping and I discovered that > their virtual com port driver was not compatible with the commapi that > Sun released.  It turns out that it has problems with hardware flow > control ( it works on incoming but not outgoing communications).  The > way I figured this out was by experimenting with the SerialDemo that > was included with the Sum commapi.  One nice thing about this example > is it has the ability to set incoming and outgoing flow control > independently.
>
> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup).
>
> I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are:
>
> testRead() : -1, gnu.io.RXTXCommDriver
> registerValidPorts() : 255, gnu.io.RXTXCommDriver
> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>
> This was all initiated by the following call in the programs init > routine:
>
> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>
> After looking at this,  My guess is that Trent is correct in that the > delay is in scanning for ports.  I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system.  Is there any way to reduce the number of ports scanned by > this function in windows XP? 
>
> Thanks again for your time,
>
> Doug
>
>
> > > > --------------070808020900080005070500-- > -- From jredman at ergotech.com Tue May 30 15:42:35 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 30 May 2006 15:42:35 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: <447CBC4B.2080206@ergotech.com> Lynn, If I understand your idea correctly, I don't think that this would work well for, say, USB ports since these can be easily added/removed by the end user. Jim lynn at swcp.com wrote: > *IF* the name of the port is supplied, we might want to use the preferences > mechanism (java.util.prefs) where we could have previously saved the info for > the port. We could do a quick check to see that things have not changed > before using it. If things have changed (or never been defined) we would do a > full port scan and save detected ports in the preferences. > > This way if the hardware is not changed, you only pay the time penalty one time. > > just an idea... > Lynn > > > Doug Thistlethwaite said: > >> This is a multi-part message in MIME format. >> --------------070808020900080005070500 >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >> Content-Transfer-Encoding: 7bit >> >> Hello all, >> >> I also notice this pause (not as long however) when I call: >> >> CommPortIdentifier.getPortIdentifier(PortName); >> >> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process. If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it. >> >> Thanks, >> >> Doug >> >> Doug Thistlethwaite wrote: >> >>> Trent, YiQi, and Jim: >>> >>> Thanks to all for the replies and information! I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :) >>> >>> As for more information. First off, this example is being run under >>> windows XP. I am developing test equipment that communicates with a >>> java application via a serial port. I have been using the commapi for >>> several years and have not had a problem. Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port. I am using the ftdi module for prototyping and I discovered >>> that their virtual com port driver was not compatible with the commapi >>> that Sun released. It turns out that it has problems with hardware >>> flow control ( it works on incoming but not outgoing communications). >>> The way I figured this out was by experimenting with the SerialDemo >>> that was included with the Sum commapi. One nice thing about this >>> example is it has the ability to set incoming and outgoing flow >>> control independently. >>> >>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup). >>> >>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are: >>> >>> testRead() : -1, gnu.io.RXTXCommDriver >>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>> >>> This was all initiated by the following call in the programs init routine: >>> >>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>> >>> After looking at this, My guess is that Trent is correct in that the >>> delay is in scanning for ports. I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system. Is there any way to reduce the number of ports scanned by >>> this function in windows XP? >>> >>> Thanks again for your time, >>> >>> Doug >>> >> --------------070808020900080005070500 >> Content-Type: text/html; charset=ISO-8859-1 >> Content-Transfer-Encoding: 7bit >> >> >> >> >> >> >> >> >> Hello all,
>>
>> I also notice this pause (not as long however) when I call:
>>
>>         >  CommPortIdentifier.getPortIdentifier(PortName);
>>
>> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process.  If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it.
>>
>> Thanks,
>>
>> Doug
>>
>> Doug Thistlethwaite wrote: >>
>> >> Trent, YiQi, and Jim:
>>
>> Thanks to all for the replies and information!  I am just back from a >> long weekend and I am now trying to figure out what I was doing! :)
>>
>> As for more information.  First off, this example is being run under >> windows XP.  I am developing test equipment that communicates with a >> java application via a serial port.  I have been using the commapi for >> several years and have not had a problem.  Recently, I have started a >> design modification that will replace the RS232 connection with a USB >> port.  I am using the ftdi module for prototyping and I discovered that >> their virtual com port driver was not compatible with the commapi that >> Sun released.  It turns out that it has problems with hardware flow >> control ( it works on incoming but not outgoing communications).  The >> way I figured this out was by experimenting with the SerialDemo that >> was included with the Sum commapi.  One nice thing about this example >> is it has the ability to set incoming and outgoing flow control >> independently.
>>
>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >> all instances of javax.comm with gnu.io and it compiled and runs >> without a hitch (except for the slow startup).
>>
>> I Paused the JBuilder IDE during this long pause and the last few >> entries in the stack trace are:
>>
>> testRead() : -1, gnu.io.RXTXCommDriver
>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>
>> This was all initiated by the following call in the programs init >> routine:
>>
>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>
>> After looking at this,  My guess is that Trent is correct in that the >> delay is in scanning for ports.  I guess one solution would be to not >> scan for ports, though it would be nice to detect what is available on >> the system.  Is there any way to reduce the number of ports scanned by >> this function in windows XP? 
>>
>> Thanks again for your time,
>>
>> Doug
>>
>>
>> >> >> >> --------------070808020900080005070500-- >> > > > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From yhua537 at cse.unsw.edu.au Tue May 30 18:10:23 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 31 May 2006 10:10:23 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CBC4B.2080206@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: Doug, In the SerialDemo, it allow us to save the parameters into a file, and use it when your program start up. Would this help? YiQi On Tue, 30 May 2006, Jim Redman wrote: > Lynn, > > If I understand your idea correctly, I don't think that this would work > well for, say, USB ports since these can be easily added/removed by the > end user. > > Jim > > lynn at swcp.com wrote: >> *IF* the name of the port is supplied, we might want to use the preferences >> mechanism (java.util.prefs) where we could have previously saved the info for >> the port. We could do a quick check to see that things have not changed >> before using it. If things have changed (or never been defined) we would do a >> full port scan and save detected ports in the preferences. >> >> This way if the hardware is not changed, you only pay the time penalty one time. >> >> just an idea... >> Lynn >> >> >> Doug Thistlethwaite said: >> >>> This is a multi-part message in MIME format. >>> --------------070808020900080005070500 >>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>> Content-Transfer-Encoding: 7bit >>> >>> Hello all, >>> >>> I also notice this pause (not as long however) when I call: >>> >>> CommPortIdentifier.getPortIdentifier(PortName); >>> >>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process. If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it. >>> >>> Thanks, >>> >>> Doug >>> >>> Doug Thistlethwaite wrote: >>> >>>> Trent, YiQi, and Jim: >>>> >>>> Thanks to all for the replies and information! I am just back from a >>>> long weekend and I am now trying to figure out what I was doing! :) >>>> >>>> As for more information. First off, this example is being run under >>>> windows XP. I am developing test equipment that communicates with a >>>> java application via a serial port. I have been using the commapi for >>>> several years and have not had a problem. Recently, I have started a >>>> design modification that will replace the RS232 connection with a USB >>>> port. I am using the ftdi module for prototyping and I discovered >>>> that their virtual com port driver was not compatible with the commapi >>>> that Sun released. It turns out that it has problems with hardware >>>> flow control ( it works on incoming but not outgoing communications). >>>> The way I figured this out was by experimenting with the SerialDemo >>>> that was included with the Sum commapi. One nice thing about this >>>> example is it has the ability to set incoming and outgoing flow >>>> control independently. >>>> >>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>> all instances of javax.comm with gnu.io and it compiled and runs >>>> without a hitch (except for the slow startup). >>>> >>>> I Paused the JBuilder IDE during this long pause and the last few >>>> entries in the stack trace are: >>>> >>>> testRead() : -1, gnu.io.RXTXCommDriver >>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>> >>>> This was all initiated by the following call in the programs init routine: >>>> >>>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>> >>>> After looking at this, My guess is that Trent is correct in that the >>>> delay is in scanning for ports. I guess one solution would be to not >>>> scan for ports, though it would be nice to detect what is available on >>>> the system. Is there any way to reduce the number of ports scanned by >>>> this function in windows XP? >>>> >>>> Thanks again for your time, >>>> >>>> Doug >>>> >>> --------------070808020900080005070500 >>> Content-Type: text/html; charset=ISO-8859-1 >>> Content-Transfer-Encoding: 7bit >>> >>> >>> >>> >>> >>> >>> >>> >>> Hello all,
>>>
>>> I also notice this pause (not as long however) when I call:
>>>
>>>         >>  CommPortIdentifier.getPortIdentifier(PortName);
>>>
>>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process.  If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it.
>>>
>>> Thanks,
>>>
>>> Doug
>>>
>>> Doug Thistlethwaite wrote: >>>
>>> >>> Trent, YiQi, and Jim:
>>>
>>> Thanks to all for the replies and information!  I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :)
>>>
>>> As for more information.  First off, this example is being run under >>> windows XP.  I am developing test equipment that communicates with a >>> java application via a serial port.  I have been using the commapi for >>> several years and have not had a problem.  Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port.  I am using the ftdi module for prototyping and I discovered that >>> their virtual com port driver was not compatible with the commapi that >>> Sun released.  It turns out that it has problems with hardware flow >>> control ( it works on incoming but not outgoing communications).  The >>> way I figured this out was by experimenting with the SerialDemo that >>> was included with the Sum commapi.  One nice thing about this example >>> is it has the ability to set incoming and outgoing flow control >>> independently.
>>>
>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup).
>>>
>>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are:
>>>
>>> testRead() : -1, gnu.io.RXTXCommDriver
>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>
>>> This was all initiated by the following call in the programs init >>> routine:
>>>
>>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>
>>> After looking at this,  My guess is that Trent is correct in that the >>> delay is in scanning for ports.  I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system.  Is there any way to reduce the number of ports scanned by >>> this function in windows XP? 
>>>
>>> Thanks again for your time,
>>>
>>> Doug
>>>
>>>
>>> >>> >>> >>> --------------070808020900080005070500-- >>> >> >> >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From halbleib at rechnerbetriebsgruppe.de Wed May 31 02:06:16 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 10:06:16 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp Message-ID: <447D4E78.30302@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, I getting an error while reloading my app in tomcat. At the first start everything runs well, but if i reload mit webapp by tomcat manager i get the following error. java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader Is there a possibility to unload the native library rxtxSerial.dll? thx for all help! regards tom -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 b8FT80HQ1xlbDLnRecDANCc= =heb1 -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 02:52:17 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 10:52:17 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D4E78.30302@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> Message-ID: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Hello Tom, To the best of my knowledge it is impossible to unload native libraries once loaded into the JVM. The exception you see stems from the fact, that Tomcat creates a new classloader when you "reload" the weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar is loaded from the session class loader. Try to add RXTXComm.jar to your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. Regards, Joachim On 31.05.2006, at 10:06, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 > b8FT80HQ1xlbDLnRecDANCc= > =heb1 > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From halbleib at rechnerbetriebsgruppe.de Wed May 31 03:28:35 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 11:28:35 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Message-ID: <447D61C3.1030807@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Joachim, I'm still not getting it. How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml-file? Perhaps web.xml? Regards, Tom Joachim Buechse schrieb: > Hello Tom, > > To the best of my knowledge it is impossible to unload native > libraries once loaded into the JVM. The exception you see stems from > the fact, that Tomcat creates a new classloader when you "reload" the > weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar > is loaded from the session class loader. Try to add RXTXComm.jar to > your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. > > Regards, > Joachim > > On 31.05.2006, at 10:06, Tom Halbleib wrote: > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL tzNy+/0iIUfkYYgt1+UT1ko= =pkpY -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 04:03:42 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 12:03:42 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D61C3.1030807@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> <447D61C3.1030807@rechnerbetriebsgruppe.de> Message-ID: -Xbootclasspath/a: is a start option to the java vm. Google is your friend in finding how to modfiy it and what it means: tomcat modifying bootclasspath Regards, Joachim On 31.05.2006, at 11:28, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Joachim, > > I'm still not getting it. > How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml- > file? > Perhaps web.xml? > > Regards, > Tom > > Joachim Buechse schrieb: >> Hello Tom, >> >> To the best of my knowledge it is impossible to unload native >> libraries once loaded into the JVM. The exception you see stems from >> the fact, that Tomcat creates a new classloader when you "reload" the >> weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar >> is loaded from the session class loader. Try to add RXTXComm.jar to >> your bootlclasspath (-Xbootclasspath/a:) and the problem should go >> away. >> >> Regards, >> Joachim >> >> On 31.05.2006, at 10:06, Tom Halbleib wrote: >> >> Hi all, >> >> I getting an error while reloading my app in tomcat. At the first >> start >> everything runs well, but if i reload mit webapp by tomcat manager >> i get >> the following error. >> >> java.lang.UnsatisfiedLinkError: Native Library >> C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in >> another classloader thrown while loading gnu.io.RXTXCommDriver >> Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: >> Native >> Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already >> loaded >> in another classloader >> >> >> Is there a possibility to unload the native library rxtxSerial.dll? >> >> thx for all help! >> >> regards >> >> tom > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL > tzNy+/0iIUfkYYgt1+UT1ko= > =pkpY > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From impakt01 at optusnet.com.au Wed May 31 06:55:42 2006 From: impakt01 at optusnet.com.au (Daren) Date: Wed, 31 May 2006 22:55:42 +1000 Subject: [Rxtx] (no subject) Message-ID: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/ade7ad37/attachment-0010.html From doug at dupreeinc.com Wed May 31 10:19:19 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 31 May 2006 09:19:19 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: <447DC207.3070702@dupreeinc.com> I am not sure what you are saying. The Save parameters menu option saves the current settings (baud, data bits, etc.). The long pause (~60 seconds) is when the application first starts (before loading the saved parameters). This does bring up a question, though I hate this type of kludge approach to getting this library to work... What exactly is a PortIdentifier? Is it always the same? If I stored the results from "CommPortIdentifier.getPortIdentifier(PortName);" in a file, could I use this the next time the program is executed? In this case I am using a virtual com port driver to connect to the device through a USB port. Doug YiQi Huang wrote: >Doug, > >In the SerialDemo, it allow us to save the parameters into a file, and use >it when your program start up. Would this help? > >YiQi > >On Tue, 30 May 2006, Jim Redman wrote: > > > >>Lynn, >> >>If I understand your idea correctly, I don't think that this would work >>well for, say, USB ports since these can be easily added/removed by the >>end user. >> >>Jim >> >>lynn at swcp.com wrote: >> >> >>>*IF* the name of the port is supplied, we might want to use the preferences >>>mechanism (java.util.prefs) where we could have previously saved the info for >>>the port. We could do a quick check to see that things have not changed >>>before using it. If things have changed (or never been defined) we would do a >>>full port scan and save detected ports in the preferences. >>> >>>This way if the hardware is not changed, you only pay the time penalty one time. >>> >>>just an idea... >>>Lynn >>> >>> >>>Doug Thistlethwaite said: >>> >>> >>> >>>>This is a multi-part message in MIME format. >>>>--------------070808020900080005070500 >>>>Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>>>Content-Transfer-Encoding: 7bit >>>> >>>>Hello all, >>>> >>>>I also notice this pause (not as long however) when I call: >>>> >>>> CommPortIdentifier.getPortIdentifier(PortName); >>>> >>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process. If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it. >>>> >>>>Thanks, >>>> >>>>Doug >>>> >>>>Doug Thistlethwaite wrote: >>>> >>>> >>>> >>>>>Trent, YiQi, and Jim: >>>>> >>>>>Thanks to all for the replies and information! I am just back from a >>>>>long weekend and I am now trying to figure out what I was doing! :) >>>>> >>>>>As for more information. First off, this example is being run under >>>>>windows XP. I am developing test equipment that communicates with a >>>>>java application via a serial port. I have been using the commapi for >>>>>several years and have not had a problem. Recently, I have started a >>>>>design modification that will replace the RS232 connection with a USB >>>>>port. I am using the ftdi module for prototyping and I discovered >>>>>that their virtual com port driver was not compatible with the commapi >>>>>that Sun released. It turns out that it has problems with hardware >>>>>flow control ( it works on incoming but not outgoing communications). >>>>>The way I figured this out was by experimenting with the SerialDemo >>>>>that was included with the Sum commapi. One nice thing about this >>>>>example is it has the ability to set incoming and outgoing flow >>>>>control independently. >>>>> >>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>>without a hitch (except for the slow startup). >>>>> >>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>>entries in the stack trace are: >>>>> >>>>>testRead() : -1, gnu.io.RXTXCommDriver >>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>>> >>>>>This was all initiated by the following call in the programs init routine: >>>>> >>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>>> >>>>>After looking at this, My guess is that Trent is correct in that the >>>>>delay is in scanning for ports. I guess one solution would be to not >>>>>scan for ports, though it would be nice to detect what is available on >>>>>the system. Is there any way to reduce the number of ports scanned by >>>>>this function in windows XP? >>>>> >>>>>Thanks again for your time, >>>>> >>>>>Doug >>>>> >>>>> >>>>> >>>>--------------070808020900080005070500 >>>>Content-Type: text/html; charset=ISO-8859-1 >>>>Content-Transfer-Encoding: 7bit >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>>Hello all,
>>>>
>>>>I also notice this pause (not as long however) when I call:
>>>>
>>>>        >>>> >>>> >>> CommPortIdentifier.getPortIdentifier(PortName);
>>> >>> >>>>
>>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process.  If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it.
>>>>
>>>>Thanks,
>>>>
>>>>Doug
>>>>
>>>>Doug Thistlethwaite wrote: >>>>
>>>> >>>>Trent, YiQi, and Jim:
>>>>
>>>>Thanks to all for the replies and information!  I am just back from a >>>>long weekend and I am now trying to figure out what I was doing! :)
>>>>
>>>>As for more information.  First off, this example is being run under >>>>windows XP.  I am developing test equipment that communicates with a >>>>java application via a serial port.  I have been using the commapi for >>>>several years and have not had a problem.  Recently, I have started a >>>>design modification that will replace the RS232 connection with a USB >>>>port.  I am using the ftdi module for prototyping and I discovered that >>>>their virtual com port driver was not compatible with the commapi that >>>>Sun released.  It turns out that it has problems with hardware flow >>>>control ( it works on incoming but not outgoing communications).  The >>>>way I figured this out was by experimenting with the SerialDemo that >>>>was included with the Sum commapi.  One nice thing about this example >>>>is it has the ability to set incoming and outgoing flow control >>>>independently.
>>>>
>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>without a hitch (except for the slow startup).
>>>>
>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>entries in the stack trace are:
>>>>
>>>>testRead() : -1, gnu.io.RXTXCommDriver
>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>>
>>>>This was all initiated by the following call in the programs init >>>>routine:
>>>>
>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>>
>>>>After looking at this,  My guess is that Trent is correct in that the >>>>delay is in scanning for ports.  I guess one solution would be to not >>>>scan for ports, though it would be nice to detect what is available on >>>>the system.  Is there any way to reduce the number of ports scanned by >>>>this function in windows XP? 
>>>>
>>>>Thanks again for your time,
>>>>
>>>>Doug
>>>>
>>>>
>>>> >>>> >>>> >>>>--------------070808020900080005070500-- >>>> >>>> >>>> >>> >>> >>> >>-- >>Jim Redman >>(505) 662 5156 x85 >>http://www.ergotech.com >>_______________________________________________ >>Rxtx mailing list >>Rxtx at qbang.org >>http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > >cheers >YiQi Huang >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/61d4d4c9/attachment-0010.html From impakt01 at optusnet.com.au Wed May 31 17:02:54 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 09:02:54 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Message-ID: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Hi all, I downloaded 2.1.7-pre16 and managed to build it and get it going. I made the changes as suggested by Peter Smith in an old post, by adding his code to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. Still not working, it opens the port at 9600 according to portmon.exe . Has anyone managed to get this going at a custom rate? Here is the post I'm referring to: http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 Thanks, Daren ________________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Daren Sent: Wednesday, 31 May 2006 10:56 PM To: rxtx at qbang.org Subject: [Rxtx] (no subject) Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren From tjarvi at qbang.org Wed May 31 21:44:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 May 2006 21:44:01 -0600 (MDT) Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> References: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Message-ID: On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org From impakt01 at optusnet.com.au Wed May 31 22:06:04 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 14:06:04 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: Message-ID: <200606010406.k51464X2010447@mail03.syd.optusnet.com.au> Trent, I have managed to successfully open the port at this speed using Realterm (available on sourceforge). From memory this uses DLPortIO. Using portmon.exe with realterm, even there it says that the port has opened at 1953. I changed termios.c:560 to dcb->BaudRate = 1953 ; and it still opens the port at 9600. Daren -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Thursday, 1 June 2006 1:44 PM To: RXTX Developers and Users Subject: Re: [Rxtx] custom baud rate win32 On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From smontgomery at mediaspansoftware.com Mon May 1 09:52:28 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 11:52:28 -0400 Subject: [Rxtx] RXTX, Java COMM and Windows Server 2003 on x64 experiences? Message-ID: Just wondering if anybody here has had to deploy RXTX or the javax.comm on Windows Server 2003 machines running on x64 (i.e. Xeon EM64T) and would like to relate how things went. From Sun's site, the Supported System Configurations pages give the options for that system: Java 5.0: - 32-bit Java 5.0 running on the OS in the 32-bit mode - 64-bit Java 5.0 running on the OS in the 64-bit native mode Java 1.4.2: - no options listed for EM64T processors, but potentially the standard 32-bit Java 1.4.2 could run on the OS in 32-bit mode? I guess the two main points of failure would be 1) the JVM itself and 2) the jni components. Make that three: there's gotta be hardware vendor driver support for the OS in the various modes, too. Guess I better go look at Keyspan's website... Thanks in advance for any info anyone might be able to provide. From smontgomery at mediaspansoftware.com Mon May 1 10:18:33 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 12:18:33 -0400 Subject: [Rxtx] Mailing list archive out of date? Message-ID: The mailing list archive at: http://mailman.qbang.org/pipermail/rxtx/ only shows emails through the end of March. Is there a new archive somewhere else? Didn't see anything mentioned on the wiki. From p.cain at phasefale.com.au Mon May 1 22:33:09 2006 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 02 May 2006 14:33:09 +1000 Subject: [Rxtx] RXTX and the Linux kernel. Message-ID: <4456E105.5080106@phasefale.com.au> Hi, First off the problem I am having isn't caused by RXTX itself but I'm hoping someone out there may have some knowledge that may help me. Background: I have an application monitoring a control system through a standard PC serial port which I talk to with rxtx-2.0.5. The application runs on RedHat7.3 kernel version 2.4.18 using Java 1.4. This configuration has been in use for several years and has proved to be stable. But it has become necessary for me to upgrade the OS but I'm running into problems with the serial communications. Its not that the comms don't work on the new OS (its never that simple) the comms work for a variable period of time (sometimes several hours) and then just stop, nothing on the data lines and control lines all indicate that data could flow. The new OS is Ubuntu 5.10 running kernel version 2.6.12. I have installed the OS and software on a PC and had it perform ok, then install the new OS and same software on the very same hardware and experienced the problems of them comms stopping. In the new OS I'm using Java5 to run the app but since I have experience the problem I reverted back to Java1.4 which didn't fix the problem. I've moved the app to a different system RedHat FC3 running 2.6.14 had experienced the problem. Not wanting to go through all the thing I have tried but I have established that it seems to be the 2.6 versions of the kernel that seem to be the problem and not an individual distribution of Linux. I should point out that I am using the same jar and library files for each java and OS combination. So I'm just wondering if anyone has had or heard of problems similar to these ? Or perhaps might know of what changed in the Linux serial driver (something I'm having a hard time establishing). I'm starting to run low on ideas of what to try so any help would be much appreciated. -- Peter Cain Senior Programmer Phasefale Pty Ltd From tjarvi at qbang.org Wed May 3 07:31:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 May 2006 07:31:00 -0600 (MDT) Subject: [Rxtx] Re: Concering ircomm and RXTX In-Reply-To: References: Message-ID: On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From legolas.w at gmail.com Wed May 3 08:46:23 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 19:16:23 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <4458C23F.2000003@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From legolas.w at gmail.com Wed May 3 13:10:57 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 23:40:57 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <44590041.80706@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From Lars.Hennig at wow-portal.com Thu May 4 00:39:15 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Thu, 4 May 2006 08:39:15 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: Message-ID: Hi, I could not find any solution. I therefore decided to to my own native implementation. Allthough it only supports the functions I need, it works pretty well now for me. I think the main problem there is the use of a wrong Windows API function and not setting an timeout. Regards, Lars Hennig W?rth Online World GmbH Tel. (0049)7181-258183 Mob. (0049)160-3522889 Fax. (0049)7940-153299 Lars.Hennig at wow-portal.com Gesendet von: rxtx-bounces at qbang.org 09.04.2006 10:42 Bitte antworten zu RXTX Developers and Users An d.herwald at dsh-elektronik.de, RXTX Developers and Users Kopie Thema Re: [Rxtx] USB Serialport - disconnection problems WV Proj./Teilpr.: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/7b39f374/attachment.html From Pawan.Kharbanda at dot.state.co.us Thu May 4 11:00:58 2006 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Thu, 4 May 2006 11:00:58 -0600 Subject: [Rxtx] Dangling Lock Files Message-ID: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Hi, I have been using RXTX API's for the Serial Communication for quite some time now and for some of the devices we are opening and closing the connection every 2 minutes. This works great for few days and then suddenly I start seeing some "Port in Use Exception" and I see that the Lock files are still in the /var/lock folder after manually removing the lock files it works good for few hours and I see the same problem again. Can somebody explain me the scenarios why I am seeing the dangling Lock files? I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise Servers. Thanks Pawan Kharbanda -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/ba0e9261/attachment.html From tjarvi at qbang.org Thu May 4 14:10:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:10:30 -0600 (MDT) Subject: [Rxtx] Dangling Lock Files In-Reply-To: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> References: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Message-ID: On Thu, 4 May 2006, Kharbanda, Pawan wrote: > Hi, > I have been using RXTX API's for the Serial Communication for quite > some time now and for some of the devices we are opening and closing the > connection every 2 minutes. This works great for few days and then > suddenly I start seeing some "Port in Use Exception" and I see that the > Lock files are still in the /var/lock folder after manually removing the > lock files it works good for few hours and I see the same problem again. > Can somebody explain me the scenarios why I am seeing the dangling Lock > files? > > I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise > Servers. Hi Pawan The next time it happens, look in the lockfile. There will be a pid. ps aux |grep 'pid' I think you will see that the application is still running for some reason. RXTX does a kill -0 on the pid to see if its alive. If not, it will remove the lockfile. So I suspect the previous program did not exit as you expected. -- Trent Jarvi tjarvi at qbang.org From Scott.Hughes at dalsemi.com Thu May 4 14:23:11 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 4 May 2006 15:23:11 -0500 Subject: [Rxtx] Wiki instructions... Message-ID: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire demo apps, when I stumbled across this tip on the wiki to add yourself to the uucp group: It may be simpler to just run usermod -G uucp jarvi Taken from: http://rxtx.qbang.org/wiki/index.php/Installation This does not work as advertised. I should have read the man page for usermod before I tried that out. If there are any groups which are not listed after the -G switch, the user is removed from those groups. On Ubuntu, this is bad... I removed myself from the Admin group, which removed my sudo priviledges. Ubuntu has no root account, so I've disabled the only account which could fix it. Anyone know of a good workaround? Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor From tjarvi at qbang.org Thu May 4 14:32:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:32:09 -0600 (MDT) Subject: [Rxtx] Wiki instructions... In-Reply-To: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> Message-ID: On Thu, 4 May 2006, Scott Hughes wrote: > I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire > demo apps, when I stumbled across this tip on the wiki to add yourself to > the uucp group: > > It may be simpler to just run > > usermod -G uucp jarvi > > Taken from: > http://rxtx.qbang.org/wiki/index.php/Installation > > This does not work as advertised. I should have read the man page for > usermod before I tried that out. If there are any groups which are not > listed after the -G switch, the user is removed from those groups. On > Ubuntu, this is bad... I removed myself from the Admin group, which removed > my sudo priviledges. Ubuntu has no root account, so I've disabled the only > account which could fix it. > > Anyone know of a good workaround? > Yikes This will get your permissions back: in grub/lilo/.. pass the following option to the kernel init=/bin/sh You are now root. when it boots, mount -o remount,rw / add yourself to the groups, reboot to get normal init going. Thats about all I can think of without sudo/root. -- Trent Jarvi tjarvi at qbang.org From Gettings at earth.utah.edu Thu May 4 14:41:22 2006 From: Gettings at earth.utah.edu (Paul Gettings) Date: Thu, 4 May 2006 14:41:22 -0600 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <20060504204122.GA6534@earth.utah.edu> When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get messages on stdout from the JVM: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 As the only change was the version of RXTX (from 2.1.6), I am unsure why the messages suddenly appeared. Anyone know how to get rid of them? Thanks. -- 101 USES FOR A DEAD MICROPROCESSOR (23) Dead cat brush From mmester at sps.edu Mon May 1 21:22:28 2006 From: mmester at sps.edu (Michael Mester) Date: Mon, 1 May 2006 23:22:28 -0400 Subject: [Rxtx] Windows PortInUseException Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> I'm trying to get simple serial communication going with RxTx under Windows XP. I can enumerate the ports fine, but I always run into problems when I try to open one. I get a PortInUseException, but the owner application is "Unknown" and the port is never open. I've tried this on several different systems and all of them give the same behavior. The only thing I can thiunk of that might be causing the problem is that fact that I had to put the serial .dll file in system32 instead of the reccommended folder, because it didn't work in the folder the documentation gives. The library loads fine, though, so I'm not sure whether that makes sense, and I don't know how to fix it anyway. Any help is greatly appreciated. Below is the output of the program, right up to the PortInUseException and the NullPointerException it causes (because the serial port object is not instantiated). C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI Starting GPSTalkerGUI... Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 gnu.io.PortInUseException: Unknown Application Exception in thread "main" java.lang.NullPointerException at GPSTalkerGUI.(GPSTalkerGUI.java:102) at GPSTalkerGUI.main(GPSTalkerGUI.java:161) Again, thank you very much for any help you can give. From lshellman at qwest.net Wed May 3 01:38:34 2006 From: lshellman at qwest.net (Lucious Shellman) Date: Wed, 03 May 2006 01:38:34 -0600 Subject: [Rxtx] Help needed: Project using parallel port Message-ID: <1146641914.8337.14.camel@localhost.localdomain> I was looking for a way to access the parallel port on a PC using Java. Searching the Internet, I came across this site (rxtx.org). What I am trying to do is detect logic levels from a TTL logic IC on the parallel port. I am not trying to do classic parallel port communication. I just want to detect whether a line(s) is (are) high or low. I am using Windows 98. Can rxtx be used to do this? If yes, is there a tutorial for using rxtx posted on the Internet that someone can direct me to. If you need more information, feel free to e-mail me. Unfortunately for me, I need the information ASAP. Thanks. lshellman at qwest.net From webmaster at egyhelp.com Wed May 3 18:43:39 2006 From: webmaster at egyhelp.com (Mohamed Samy) Date: Thu, 4 May 2006 02:43:39 +0200 Subject: [Rxtx] RE: Concering ircomm and RXTX In-Reply-To: Message-ID: <20060503184362.SM01044@Geek> Hey, I issue the command "modprobe ircomm-tty" yet no ttyircomm appears, while the ircomm appear by "modprobe ircomm" so forgive me but I am bit lost. Even searching google for the keyword "ttyircomm" only returns 3 matches. So any way I can start the ttyircomm???? Thanks a lot. -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Wednesday, May 03, 2006 3:31 PM To: Mohamed Samy; rxtx at qbang.org Cc: taj at www.linux.org.uk Subject: Re: Concering ircomm and RXTX On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 4 15:49:49 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 15:49:49 -0600 (MDT) Subject: [Rxtx] Windows PortInUseException In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> Message-ID: On Mon, 1 May 2006, Michael Mester wrote: > > I'm trying to get simple serial communication going with RxTx under > Windows XP. I can enumerate the ports fine, but I always run into > problems when I try to open one. I get a PortInUseException, but the > owner application is "Unknown" and the port is never open. I've tried > this on several different systems and all of them give the same > behavior. The only thing I can thiunk of that might be causing the > problem is that fact that I had to put the serial .dll file in system32 > instead of the reccommended folder, because it didn't work in the folder > the documentation gives. The library loads fine, though, so I'm not sure > whether that makes sense, and I don't know how to fix it anyway. Any > help is greatly appreciated. Below is the output of the program, right > up to the PortInUseException and the NullPointerException it causes > (because the serial port object is not instantiated). > > C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI > Starting GPSTalkerGUI... > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > gnu.io.PortInUseException: Unknown Application > Exception in thread "main" java.lang.NullPointerException > at GPSTalkerGUI.(GPSTalkerGUI.java:102) > at GPSTalkerGUI.main(GPSTalkerGUI.java:161) > Perhaps you are trying to open the port twice in your code? rxtx does open the ports, do a timed out read and then close the ports during enumeration. I think the port is being opened fine. The Unknown Application is always reported. On linux, there is some code that finds the actual application but on windows, its always unknown. If the port enumeration is returning the ports you expect, rxtx has opened the port and closed it with success. The port should open. There is also example code in the contrib directory that comes with rxtx source that has examples you can modify to work. -- Trent Jarvi tjarvi at qbang.org From Christian.Klemke at t-online.de Thu May 4 23:37:23 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Fri, 5 May 2006 07:37:23 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu> Message-ID: <004f01c67005$fc72fee0$016a10ac@NB600> Hi Paul, I was wondering about the same question some days ago and took a look at the source files. Unfortunately, I found that you can only get rid of that messages by altering and recompiling the Java code. There is a final static boolean variable called "devel" in the file "RXTXCommDriver.java" which is set to "true". This constellation causes the output after the native libraries have been loaded. No mechanism exists to suppress them otherwise :-(. Trent, does that mean that 2.1.7 is still officially a "development" version ? When will this value be changed to "false" by default ? With 2.1.8 ? It would be nice to provide a means to suppress such messages besides that static flag (maybe by setting a property called "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The output can indeed by annoying, especially when used with console applications, where the message potentially appears "in the middle" of your own output. Another possibility would be not to use System.out directly, but instead some PrintStream field which is initially set to System.out but can programatically be changed. That would allow for any kind of redirection or suppression by implementing appropriate user-defined PrintStream subclasses and making RXTX use that stream. What do you think ? Best regards, Christian ----- Original Message ----- From: "Paul Gettings" To: Sent: Thursday, May 04, 2006 10:41 PM Subject: [Rxtx] RXTX causing stdout messages > When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get > messages on stdout from the JVM: > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > As the only change was the version of RXTX (from 2.1.6), I am unsure > why the messages suddenly appeared. Anyone know how to get rid of > them? > > Thanks. > > -- > 101 USES FOR A DEAD MICROPROCESSOR > (23) Dead cat brush > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri May 5 06:09:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 06:09:46 -0600 (MDT) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <004f01c67005$fc72fee0$016a10ac@NB600> References: <20060504204122.GA6534@earth.utah.edu> <004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: On Fri, 5 May 2006, Christian Klemke wrote: > Hi Paul, > > I was wondering about the same question some days ago and took a look at the > source files. Unfortunately, I found that you can only get rid of that > messages by altering and recompiling the Java code. There is a final static > boolean variable called "devel" in the file "RXTXCommDriver.java" which is > set to "true". This constellation causes the output after the native > libraries have been loaded. No mechanism exists to suppress them otherwise > :-(. > > Trent, does that mean that 2.1.7 is still officially a "development" version > ? When will this value be changed to "false" by default ? With 2.1.8 ? It > would be nice to provide a means to suppress such messages besides that > static flag (maybe by setting a property called > "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The > output can indeed by annoying, especially when used with console > applications, where the message potentially appears "in the middle" of your > own output. Another possibility would be not to use System.out directly, but > instead some PrintStream field which is initially set to System.out but can > programatically be changed. That would allow for any kind of redirection or > suppression by implementing appropriate user-defined PrintStream subclasses > and making RXTX use that stream. What do you think ? > A patch for using properties would be accepted I'm sure. The reason the default is to display the message is not related to the development state of rxtx anymore. The problem is that people first using rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. The message prevents a great deal of email thats easily explained by the message. I question if we should support rxtx 2.0 at all anymore. If you post a patch in bugzilla, we'll put it into CVS this weekend. we'll be going through and doing such things anyhow. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri May 5 13:23:56 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 13:23:56 -0600 (MDT) Subject: [Rxtx] How to read from RxTx parallel port in Win XP In-Reply-To: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> References: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> Message-ID: On Thu, 27 Apr 2006, Worsley, Bob (Development Engineer) wrote: > I'm sorry if this is a dumb question, but I didn't find the answer in > the archives. > > I'm using the RxTx binaries for Windows on a reasonably current notebook > PC running Windows XP. I can send stuff to a printer on the parallel > port (LPT1), but I can't get anything back. > > I wrote a class that has the methods listed below. I write some data to > the printer with the "write" method and then try to read a response > using the "read" method, but I never get any data. I'd greatly > appreciate any help you can give! > > Bob Worsley > bobwoyid2 at yahoo.com > > > > > private ParallelPort parallelPort = null; > private RXTXCommDriver parallelPortDriver = null; > > > public boolean initialize() throws IOException { > if (parallelPort != null) { > return false; // Already initialized > } > > // Create the parallel port; > parallelPortDriver = new RXTXCommDriver(); > parallelPort = > (ParallelPort)parallelPortDriver.getCommPort(address, > CommPortIdentifier.PORT_PARALLEL); > > // Set the parallel port parameters. > try { > parallelPort.enableReceiveTimeout(READ_TIMEOUT); > parallelPort.disableReceiveFraming(); > parallelPort.disableReceiveThreshold(); > //parallelPort.setMode(mode); !!!!errors > } catch (UnsupportedCommOperationException e) { > throw (new IOException("Parallel port with address '" + > address > + "' cannot be configured as specified")); > } > > return true; > } > > > > public void write(final byte[] bytes) throws IOException { > initialize(); > while (busyReading) { > Thread.yield(); > } > busyWriting = true; > if (bytes.length < 1) { > return; > } > OutputStream outputStream = parallelPort.getOutputStream(); > outputStream.write(bytes); > outputStream.flush(); > outputStream.close(); > Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); > busyWriting = false; > } > > > public byte[] read() throws IOException { > > // Read up to MAX_BYTES bytes. > initialize(); > while (busyWriting) { > Thread.yield(); > } > busyReading = true; > byte[] buff = new byte[MAX_BYTES_READ]; > InputStream inputStream = parallelPort.getInputStream(); > // This read blocks until input data is available > int bytesRead = inputStream.read(buff); > inputStream.close(); > // If no data read, create empty array > if (bytesRead == -1) { > bytesRead = 0; > } > byte[] deviceBytes = new byte[bytesRead]; > System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); > if (bytesRead > 0) { > Debug.p("PPIOP.read - got data: '" + new > String(deviceBytes) + "'"); > } > busyReading = false; > return deviceBytes; > } > Hi Bob I've only used rxtx to test a hello world page printing but there are others that have used it. PPIOP? hmm what is this? :) The rxtx parallel support is behind the serial support but should be OK. As you note, the setting of modes is not supported. rxtx uses what is provided when the port is open. Are your asserting the pin for the printer being online? I suspect what often happens is people try to just use the data pins but the C API rxtx uses wants the printer to be online. There should be some posts relating to this in the rxtx mail-list archive. Some APIs are probably reading and writing from the port address (also suggested in your code as something you are looking at). RXTX currently uses a higher level C/C++ API for port access. This can still work if the API thinks the 'printer' is there. -- Trent Jarvi tjarvi at qbang.org From agrodellic at gmail.com Sat May 6 08:39:40 2006 From: agrodellic at gmail.com (Leigh Stewart) Date: Sat, 6 May 2006 10:39:40 -0400 Subject: [Rxtx] sun commapi 3 Message-ID: I think I read here: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html that rxtx-2.0 is basically fracked for now? Does anyone know of a workaround? ie can i somehow get an older version of sun's comm api and use that (not easy to find)? i mean 2.0 must be working for someone...how is it being tested. 2.1 isnt working for me....im getting nasty native exceptions etc, which is why im so set on 2.0... any ideas? From tjarvi at qbang.org Sun May 7 15:40:27 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 7 May 2006 15:40:27 -0600 (MDT) Subject: [Rxtx] sun commapi 3 In-Reply-To: References: Message-ID: On Sat, 6 May 2006, Leigh Stewart wrote: > > 2.1 isnt working for me....im getting nasty native exceptions etc, > which is why im so set on 2.0... any ideas? > Hi Leigh What native exceptions are you seeing? Which OS? The native code is almost identical between rxtx 2.0 and 2.1. Only the names have been changed to protect the inocent. :) ie: javax_comm_... vs gnu_io_... So the odds are very likely that even if you do find commapi 2.0 and get it installed, you will run into the same error. It would be better to just find and fix the problem. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Mon May 8 10:47:20 2006 From: mail at willicon.de (WILLICon) Date: Mon, 08 May 2006 18:47:20 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 Message-ID: <445F7618.3070303@willicon.de> Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/ef37e8ec/attachment.html From tjarvi at qbang.org Mon May 8 16:14:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 May 2006 16:14:51 -0600 (MDT) Subject: [Rxtx] Screenshot of Application using RXTX (fwd) Message-ID: Just though someone may end up searching for 0x0D and 0x0A. Here are the details from his system. SuSE Linux 10.0 (x86_64) Kernel 2.6.13-15.8 j2se 1.4.2_11 (i586) Sun: comm3.0_u1 rxtx: rxtx-2.1-7 ---------- Forwarded message ---------- Date: Sat, 6 May 2006 20:01:46 +0200 From: Michael Poppitz To: taj at www.linux.org.uk Subject: Screenshot of Application using RXTX Hi Trent, the rxtx package works like a charm. Sun's package seemed to replace all 0x0D with 0x0A in received data on my Linux box, which is really annoying when transfering binary data. But rxtx came and saved the day - and turned out to be a lot more convenient as it does not require a configuration file. I use it for connecting to a home made logic analyzer. (http://www.sump.org/projects/analyzer/) Thanks for your great job, Michael -------------- next part -------------- A non-text attachment was scrubbed... Name: la_client.png Type: image/png Size: 16592 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/45494fbb/la_client.png From tjarvi at qbang.org Tue May 9 14:56:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 May 2006 14:56:05 -0600 (MDT) Subject: [Rxtx] RXTX javax.comm: which one to install? In-Reply-To: <20060509161742.43547.qmail@web53814.mail.yahoo.com> References: <20060509161742.43547.qmail@web53814.mail.yahoo.com> Message-ID: On Tue, 9 May 2006, Adenilson Cavalcanti wrote: > Dear Trent Jarvi > > I'm trying to write a small Java app running in linux that interfaces with a device connected to serial port. > > I do have some questions about RXTX and javax.comm state of affairs, since I'm new to Java programming (used to program in plain old C writting to devices using termios and open/write/read syscalls, but this is another story). > > I ask you the favor to clarify this issues (if possible...): > > a) Sun offers to download a file (comm3.0_u1_PUTAUNIXVERSION.zip) which does contain .so files. Does it work out of box? > > b) Case negative, its there that we should use 'librxtx*.so' provided by your site? > > c) Sun's comm3 API version does work with which version of rxtx? > > I already searched google and read documentation available in rxtx site ("Java Comm Serial API How-to") but still have this issues unsolved. Any help will be appreciated. > > Best regards > > Adenilson Hi Adenilson, RXTX does not currently support javax.comm in Sun's CommAPI 3.0. I would recommend using package gnu.io provided by rxtx 2.1. -- Trent Jarvi tjarvi at qbang.org From chris.develder at intec.ugent.be Wed May 10 08:45:40 2006 From: chris.develder at intec.ugent.be (Chris Develder) Date: Wed, 10 May 2006 16:45:40 +0200 Subject: [Rxtx] rxtx troubles on ARM Message-ID: <4461FC94.6040909@intec.ugent.be> Hi all, Sorry to bother you, but I don't seem to get RXTX working on an ARM processor (xscale ixp 425, big endian). I managed to crosscompile the rxtx libs and moved it over to the ARM. Using jamvm (which is the only open source java VM we got working on the ARM), I get the following error result when running SimpleRead from Sun's javax.comm examples (commapi\examples\Simple\SimpleRead) -- see bottom of mail for complete output: "java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver" However, output shows that the RXTXCommDriver code is accessible (cf. debug and devel output of lib versions). So it doesn't seem to be a missing lib/jar issue. The error happens before RXTXCommDriver.initialize() is called, since the first line there is System.out.println("RXTXCommDriver:initialize()"); Any ideas? Cheers, Chris ---------------------------- [root at xxx(ttyp1) /work/cdvelder/xscale/test]# jamvm -Djava.library.path=/work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/jre/lib/arm -classpath /work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/lib/ext/RXTXcomm.jar:./comm.jar:. SimpleRead RXTXCommDriver {} Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTXCommDriver: Jar version = RXTX-2.1-7 native lib Version = RXTX-2.1-7 java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver gnu/io/RXTXCommDriver at javax.comm.CommPortIdentifier.loadDriver (CommPortIdentifier.java:239) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:109) at SimpleRead.main (Unknown Source) java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive (Native Method) at com.sun.comm.Portmapping.registerCommPorts (Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase (Portmapping.java:100) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:138) at SimpleRead.main (Unknown Source) From joachim at buechse.de Fri May 12 00:44:48 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 08:44:48 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) Message-ID: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Good day, I guess that only a selected few (hi Trent) will be able to answer this question, but the answer might be interesting for anyone trying to debug or understand the code. Apparently the MonitorThread is started and stopped in RXTXPort.addEventListener and RXTXPort.removeEventListener. This would indicate that (originally?) the MonitorThread is only required when there is an EventListener. However the MonitorThread is also started in the RXTXPort constructor, which could mean that RXTX won't work at all if it isn't there. It seems to me, that if anyone would add an event listener and later on remove it, he could potentially wreak the port. Because the second action would kill the MonitorThread. For the moment I am only trying to understand the role of and idea behind the MonitorThread. But of course there is a deeper reason thor my question: If the MonitorThread needs to exist anyway, it could be the thread that cleans up the port (ie calls nativeClose) - this would eliminate (a further) problem I am seeing with some USB drivers on Mac OSX. (Close blocks (after releasing the tty, but still) in the USB driver if the device is "not responding"). Greetings, Joachim From tjarvi at qbang.org Fri May 12 07:10:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 12 May 2006 07:10:59 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Fri, 12 May 2006, Joachim Buechse wrote: > Good day, > > I guess that only a selected few (hi Trent) will be able to answer > this question, but the answer might be interesting for anyone trying > to debug or understand the code. > > Apparently the MonitorThread is started and stopped in > RXTXPort.addEventListener and RXTXPort.removeEventListener. This > would indicate that (originally?) the MonitorThread is only required > when there is an EventListener. However the MonitorThread is also > started in the RXTXPort constructor, which could mean that RXTX won't > work at all if it isn't there. > > It seems to me, that if anyone would add an event listener and later > on remove it, he could potentially wreak the port. Because the second > action would kill the MonitorThread. > > > For the moment I am only trying to understand the role of and idea > behind the MonitorThread. But of course there is a deeper reason thor > my question: > > If the MonitorThread needs to exist anyway, it could be the thread > that cleans up the port (ie calls nativeClose) - this would eliminate > (a further) problem I am seeing with some USB drivers on Mac OSX. > (Close blocks (after releasing the tty, but still) in the USB driver > if the device is "not responding"). > Hi Jaochim Before commapi, rxtx did not support events. You could read, write and change port settings. The MonitorThread was added as an afterthought to support commapi events. So the way things are now his historical spaghetti not a well devised plan. It is my opinion that the MonitorThread should exist as long as the port is open. The odd starting of the thread in the constructor and addEventListener was just to get past the obvious problem of people using the port without adding listeners. -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Fri May 12 07:59:50 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 15:59:50 +0200 Subject: [Rxtx] MonitorThread -> ChangeRequest In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: <2B1E508C-8CEE-4AB7-914D-E7BA25C871A2@buechse.de> In this case I suggest removing the starting/stopping of MonitorThread in addEventListener / removeEventListener. This should not affect existing projects. On 12.05.2006, at 15:10, Trent Jarvi wrote: > It is my opinion that the MonitorThread should exist as long as the > port > is open. The odd starting of the thread in the constructor and > addEventListener was just to get past the obvious problem of people > using > the port without adding listeners. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Fri May 12 11:43:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 19:43:21 +0200 Subject: [Rxtx] Spring Cleaning - some suggestions Message-ID: The current implementation of RXTX contains quite a lot of code that will break if it is used from several threads (especially on a multi processor machine). I think it would be nice to clean this up. I suggest the following changes (which keep the current semantics and should not influence existing projects in a negative way): - InterruptedException will never be ignored or reset - read methods will be protected with a Monitor - write methods will be protected with a (separate) Monitor - close() sets the read and write monitors into a "closed" state which will lead to IOExceptions for any following call to RXTXPort.read/write. - close() will wait a finite amount of time (maybe 500ms) for the release of the read and write monitors after that, it will trigger the closing of the file descriptor to abort any pending read or write. - close() will not call close(file_desc). Instead it will "interrupt" (ie set a flag and then, pthread_kill(ABRT)) the MonitorThread, the MonitorThread will call close(file_desc). - the monitors are properly released in a finally block the try of which starts directly after obtaining the monitor. - finally will not call close(file_desc) it will only "interrupt" the MonitorThread (see above) - the native-code (esp read) does not use SA_RESTART but checks Thread.interrupted() when it receives a SIGNAL (ie system call returns with EINTR or other signalling method). The read/write monitors will be allocated from a factory whose mode can be set to fast/normal/advanced. In fast-mode it will create "non thread safe, non synchronized" pseudo-monitors. In default mode, the monitors will store the owning thread. In "advanced" mode setting the monitors into closed state will "interrupt()" threads which are blocked in a native read/write. {Reasoning close behaviour: Calling close on a file descriptor in Windows unblocks any read() or write() on the same file descriptor with an error. On Solaris < 2.7 and MacOS X however the close() will/ can block - until the read or write have finished:-(( Even the JDK people have trouble with this. I dont know how Linux reacts in this case. The best practice for BSD/Solaris is to send a signal to the thread which will usually unblock the read/write with an EINTR - this however is not guarenteed as it also depends on the device driver. So the only resolution that will certainly not block the thread calling RXTXPort.close() (which will often enough be the AWT event dispatcher or the VM finalizer thread) is to call close(fd) from another thread.} {Reasoning read behaviour: It is rather uncommon to receive a signal while reading or writing - it will happen, but checking Thread.interrupted() when it happens will not degrade performance. The checking of Thread.interrupted() can be handled by returning to Java and potententially reentering into the native code if the thread was not interrupted or by calling back into the VM from the native code. On top of this, many functions like read(byte[]) or read(byte [], int, int) are allowed to return less than the requested amount of data. Only int read() is a bit more tricky. } [Trent: From the code I can tell, that you experimented quite a bit with signals. Do you know if the Java Thread.interrupt() triggers a unix signal on Linux/Solaris? If so, which one?? References: - http://java.sun.com/docs/hotspot/VMOptions.html - http://www.hp.com/products1/unix/java/infolibrary/prog_guide/ signals.html ] On OS X (hotspot client jdk-1.4.2) I did not see any signal propagated to the SELECT of the event_loop/MonitorThread (ie no EINTR) when I call monThread.interrupt(). This is a pitty, but thats the way it is. I simply assume this is true for most system calls. How to handle this? Of course it would be possible to install/ deinstall a specific signal handler before/after every native read and to natively send an ABRT signal if RXTXPort.close is called. A more elegant solution might be to have an additional "signaling" socket which is always included in the SELECT. Or the simplest solution: cap the timeout of the select to 500 ms (the loop around it exists already) after every timeout check the Thread.interrupted() flag. From a performance perspective this should be completely invisible... On the other hand, all write() calls need to be preceeded by a SELECT as well, to avoid running into a blocking write. Best regards, Joachim From lyon at docjava.com Sat May 13 05:54:52 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 13 May 2006 07:54:52 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Dmitry suggests that we acquire an implementation of a serial port reference, use it, then release it (i.e., check it back in). Joachim says that making serial ports thread friendly might be a good idea. This is a good idea. The design pattern that is close to this idea is the "Object Pool Design Pattern". # Object Pool Manage the reuse of objects for a type of object that is expensive to create or only a limited number of a kind of object can be created. It has been described at: http://www.developer.com/java/ent/article.php/626171 and in Marks' book, Patterns in Java, Volume 1. However, the Object Pool is intended to pool objects so that each object is just like every other object. The intent of the Parametric Singleton is to enable others to access the same resource at the same time (as long as the same parameters were used in construction). It sounds like we need a NEW Design Pattern (Oh no, Doug is doing it again!). Yes friends, you got me on a role (roll) :) If you like design patterns, you can thank me later. If you don't like design patterns, blame Dmitry, it was his idea ;) And Dave, thanks for the feedback on Singleton abuse. It has led me to change the way I think about application contexts, which we will see, below. We need (drum roll please): The Parametric Object Pool Design Pattern (POP) By Douglas A. Lyon ABSTRACT The goal of the Parametric Singleton design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values, in a given context. In comparison, the goal of the POP design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values and that only one reference to the class is checked out at a time, in a given context. A context is a namespace for holding identifiers during execution. In Java, A context can be changed in any of several ways. For example, creation of a new class loader, the deserialization of an old POP or the creation of a new process all create a new namespace. The POP Design Pattern combines the Parametric Singleton Design Pattern with the check out mechanism of the Object Pool Design Pattern. This enables unique creation of instances of a class. These instances are cached in a table. When a clients asks for an instance with these parameters, the cache is checked. If the instance is not in the cache it is created. If the instance is available, the clients checks out the instance. A reference is left to the clients that checked out the instance. The POP has the role of creating objects uniquely, from parameters. It also has the role of keeping track of which clients has checked out a given object. This is just like a library keeping track of who borrowed a book. If a resource is left unavailable in a system, a deadlock can occur. Deadlock debugging is facilitated by mapping a resource to the clients that have checked it out. We apply our POP Design Pattern to the retrieval of serial ports. The goal of our system is to make sure that serial ports are checked out to only one client at a time, and that they be checked back in when the client is done. The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. Users are discouraged from calling this the Parametric Object Oriented Pool (POOP). Introduction The intent of the POP Design Pattern is to ensure that a class has only one instance for a given set of parameter values. It also provides a point of access that is global to a given context. The POP uses the Singleton Design Pattern to ensure that there is only one POP, in the given context. The POP DP is responsible for checking out a reference to a given instance, and keeping track of that instance. The instance is responsible for sharing that instance. POP requires that users of the DP implement an interface that enables a recall facility. Thus, if there is a contention for a consumed resource, the deadlock can be resolved in an orderly fashion. Motivation A system cannot tolerate multiple instances of some classes with identical parameters used by different instances at the same time. For example, you cannot have two instances use the same serial port, at the same time. You cannot have two instances that are trying to listen to the same socket connection. You cannot have two instances writing to the same file structure at the same time. Further, once a serial port is checked out by a client, it is assigned to the client. This is like the spin-lock service provided by the operating system, only in the application layer. Naturally, deadlock will occur if a resource is not released, therefore the client of the resource is tracked. Recalling a resource is required for the POP DP by virtue of the implementation of an interface. The policy on how to break a deadlock (by honoring the recall) is application specific. As the operating system is often thought of as the arbiter of consumed resources (i.e., tape drives, serial ports, etc.) we frequently leave it to an operating system implementation to resolve these contention issues. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on naming conventions (which are not well standardized). The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. The POP Design Pattern can take on the role of the peer method mapper that homogenizes the API for different operating environments. That is, it can wrapper the different locking mechanisms used in different operating systems. POP that is responsible for keeping track of the instances created and the client that has checked them out. The POP Design Pattern is implemented using the Singleton Design Pattern. In Java, the POP implementation is declared final, so that it cannot be subclassed. The class also has a private constructor, so that other classes cannot instance it. The new design pattern is called the POP design pattern and it provides a way to check out and create instances with given parameters. Applicability Use the POP Design Pattern when: 1. There must be exactly one instance of a class with the given parameters in a given context. 2. The instances must be accessible to clients from a well-known access point. 3. The instances are reusable. 4. Only one client can check out an instance at a time. Structure Insert UML diagram here. Participants The POP Clients that need instances 1. The POP defines an instance upon request from a client, if, and only if, the instance does not already exist. 2. The POP returns the instance to the client. 3. The POP is responsible for creating unique instances from given parameters. 4. The POP is responsible to recalling instances from clients. Collaborations Clients obtain a reference to a POP instance only through the singleton design pattern. If the POP instance is left in an improper state (e.g., the serial port was left open) it is NOT the role of the POP to close the IO port. However, the POP can be requested to get the instance released. Nor is it the role of the POP Design Pattern to open the port. That role is delegate to some other part of the system. Further, it is the role of the POP Design Pattern to check out resources. However, it is still possible to have, multiple threads that have multiple references to the same resource at the same time. Checkout and resource requests are MUTEX locked (i.e., synchronized). Consequences The POP Design Pattern has several benefits: 1. Controlled access to parametrically defined instances. Since the POP encapsulates its instances, there is some limited control over how and when clients access it. 2. Reduced name space. The POP pattern avoids global variables that store instances created from the same parameter. Implementation Here are implementation issues to consider when using the POP pattern: 1. Unique mapping of parameters. The POP pattern requires that there be a mean to isomorphically map the parameter space into the instance space and back again. 2. Ensure unique instances. The POP pattern makes unique instances from parameters, and it does so only once. 3. Cache instances for fast retrieval. The POP must be able to look up instances, given some set of parameters, and do so from some data structure. That is, there must be enough space to hold references to all the instances the program will need. Also, a mechanism is needed to look up and retrieve the instances quickly enough to satisfy the clients. Sample Code To be written....any volunteers? Thanks! - Doug >I don't think I get it > >On Mar 22, 2006, at 9:36 AM, David Garnier wrote: >>Using the singleton pattern in this case is >>just convenient for the programmer. Problems >>arises >>pretty quickly, especially if you attempt to unit-test your classes. > > >so you're saying that something isn't so good >because you can not test it in the convenient >way? >if that's true, I'm totally disagree >change your test, debug whatever, but if >software is efficient at runtime, works fine and >only problem is some unit test >(which is some kind of framework for testing) >then dump that unit test , dump that unit >framework and make something appropriate to the >software >you're testing > >so if Douglas want to use singletons, what's the problem? >and what do you mean by abusing of singleton usage? > >of course singleton doesn't prevent concurrent >access to the resource across the processes >unless >you're using some OS facility to prevent it, besides >singleton as it was introduced is relevant only >and only inside of the same process >otherwise it's not singleton it's something else >(let's say network singleton: so you have remote >invocation facility >and some factory method that return object created by that facility) > >I don't have any problem with using any kind of singletons. > Parametric Singleton idea (if I understand it >right) could be easily implemented in the >following way: >use a map >populate map with instances of some class and key is your parameter >(you can use lazy population too) > >if somebody ask the key check the value if it's null so resource is taken >if somebody returns the resource put it back to the map > >public synchronized static Object getSomeResource(Object parameter); >public synchronized static void returnResource(Object parameter); > >getSomeResource (inside of the same process) could return null in 2 cases >1. if somebody (from other thread for example) already took that resource >2. if OS API said that resource corresponded to >that parameter (serial port with parameter = 1 >(port #)) >is locked and unavailable; >I'm not sure that in case of serial ports we >even need those Parametric Singletons >(unless lock checking is a very expensive operation) >just ask the OS about availability of that >resource and if it's available give it away >and then OS will lock it and therefore in next >time somebody ask it just answer that resource >is locked >and return null > >for example system has 2 serial ports available >so I ask getResource("tty"); >or I ask getResource("Bluetooth-Modem"); > >and if OS is ok you can give tty or Bluetooth-Modem or both > >no need for any additional pattern I think > >back to the problem >mac os x doesn't recognize locking via files, so >it handles locking via some API >an instance of the singleton in each process >should recognize that resource is locked >(by using that API) that's all >we don't have to make things more complicate >then they are just because there is some nice >design pattern or nice unit test framework or whatever >keep things simple, make them work fast, don't introduce middle layers >unless you have really good reason to do so > >of course I could be entirely wrong, so sorry about that in advance > >thanks > > >Dmitry Markman > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx >Good day, > >I guess that only a selected few (hi Trent) will be able to answer? >this question, but the answer might be interesting for anyone trying? >to debug or understand the code. > >Apparently the MonitorThread is started and stopped in? >RXTXPort.addEventListener and RXTXPort.removeEventListener. This? >would indicate that (originally?) the MonitorThread is only required? >when there is an EventListener. However the MonitorThread is also? >started in the RXTXPort constructor, which could mean that RXTX won't? >work at all if it isn't there. > >It seems to me, that if anyone would add an event listener and later? >on remove it, he could potentially wreak the port. Because the second? >action would kill the MonitorThread. > > >For the moment I am only trying to understand the role of and idea? >behind the MonitorThread. But of course there is a deeper reason thor? >my question: > >If the MonitorThread needs to exist anyway, it could be the thread? >that cleans up the port (ie calls nativeClose) - this would eliminate? >(a further) problem I am seeing with some USB drivers on Mac OSX.? >(Close blocks (after releasing the tty, but still) in the USB driver? >if the device is "not responding"). > >Greetings, >Joachim > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Sat May 13 10:07:37 2006 From: joachim at buechse.de (Joachim Buechse) Date: Sat, 13 May 2006 18:07:37 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Douglas, Looking at the current code, leaves me with the feeling, that there is a lot to do. Defining an API that wraps javax.comm to provide what you describe is certainly possible, but I wonder how much benefit it will actually provide. Personally I think the API defined by javax.comm "request/lock" a port with: cp= new CommunicationPort(identifier) "release" a port with: cp.close(); works quite nice for 99% of the applications. In my experience, the most efficient and elegant implementation is to wrap a port/socket/.. into a business object which declares the remote operations that are possible. Ie "uploadFile", "waitForPrompt", "getSerialNumber", "sendContact", "executeCommand", etc Those methods are then either synchronized or guarded by a monitor. I do not see how your design pattern applied to the port resource would help implementing this. [details start, skip if you agree to the above] When I talked about "thread-safe" I didn't mean several independent "sessions" accessing the port concurrently. I think this is a very rare usage. I believe the most common use case for serial ports today is the control of an external device from a PC running a GUI based application. To implement a clean Swing/AWT-GUI one needs to pass any action that can block to a "worker" thread (else the GUI blocks, the application appears dead). While it is possible to use own prespawned thread that will accept Runnables which operate on the port, this is not very elegant. It is more common to spawn a new thread for every action triggered by the user. Additionally the ABORT of a running operation is often implemented via a port.close() delegated to a different thread. - During the lifetime of a port, it will usually be accessed from several different threads. Instance variables need to be set/read in synchronized regions to guarantee a correct operation based on the Java memory model. - Synchronizing the access is usually handled on the application level (synchronizing the reads/writes is usually useless from the applications view because it is not a transaction mechanism). [details end] I am very open to learn about other scenarios where your proposed design pattern applied to the port resource is beneficial to the application implementor. Best regards, Joachim On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > Dmitry suggests that we acquire an implementation of > a serial port reference, use it, then release it (i.e., check it > back in). > > Joachim says that making serial ports thread friendly might be a > good idea. > > This is a good idea. The design pattern that is close to this idea > is the "Object Pool Design Pattern". > # Object Pool From jredman at ergotech.com Sun May 14 14:28:24 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 14:28:24 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers Message-ID: <446792E8.4000506@ergotech.com> Does anyone know of any work to make RXTX work with Ethernet (telent) Terminal Servers? If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? We've used RXTX with upwards of 100 virtual COM ports on Windows and it works well. Linux is more problematic. It would be good to have an OS independent solution to accesses remote Ethernet serial ports. Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From legolas.w at gmail.com Sun May 14 14:26:34 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:56:34 +0430 Subject: [Rxtx] does any one have a working sample of RXTX and LPT port Message-ID: <4467927A.4000008@gmail.com> Hi Thank you for reading my post does any one has a working sample for RXTX and LPT port ? Thanks From legolas.w at gmail.com Sun May 14 14:27:29 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:57:29 +0430 Subject: [Rxtx] does RXTX support Trigerr on parallel port? Message-ID: <446792B1.4040905@gmail.com> Hi does RXTX support trigger on LPT port ? if so , how i can use it ? Thanks From tjarvi at qbang.org Sun May 14 17:40:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 17:40:59 -0600 (MDT) Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: <446792E8.4000506@ergotech.com> References: <446792E8.4000506@ergotech.com> Message-ID: On Sun, 14 May 2006, Jim Redman wrote: > Does anyone know of any work to make RXTX work with Ethernet (telent) > Terminal Servers? > > If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 > Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? > Hi Jim It appears the author of NVTCom has decided to release the library into the public domain. Integration with rxtx is possible but it would be best to contact the author and find out what his intent is. I would suggest contacting the author with a proposal of what you would like to do and take it from there. We could 'take' public domain software but its better to show respect to the authors and respect their wishes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:10:23 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:10:23 -0600 (MDT) Subject: [Rxtx] does any one have a working sample of RXTX and LPT port In-Reply-To: <4467927A.4000008@gmail.com> References: <4467927A.4000008@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > Thank you for reading my post > does any one has a working sample for RXTX and LPT port ? > Thanks Hi Legolas LPT port support in rxtx is spotty. That means some people have sent in patches for what they do and it works well for them. The original code was not very good. It may have been 3 hours work :/ To get started, Sun has some demo programs with their commapi. With rxtx 2.1 you can change their code from using javax.com to gnu.io and it -should- work. But if it does not you can post here and on bugzilla. There has been more interest lately off the list and maybe there will be enough community resources to get what you need going. If you do get a sample program together, we would gladly put it in the contrib directory so the next person can get things going faster. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:12:12 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:12:12 -0600 (MDT) Subject: [Rxtx] does RXTX support Trigerr on parallel port? In-Reply-To: <446792B1.4040905@gmail.com> References: <446792B1.4040905@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > does RXTX support trigger on LPT port ? > if so , how i can use it ? > Hi Legolas As mentioned in the previous post, rxtx parallel support is not very mature. But if you can point to something that describes the trigger feature, we can probably make sure its there and give a quick code example. -- Trent Jarvi tjarvi at qbang.org From jredman at ergotech.com Sun May 14 22:22:48 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 22:22:48 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: References: <446792E8.4000506@ergotech.com> Message-ID: <44680218.4080008@ergotech.com> Trent, Trent Jarvi wrote: > On Sun, 14 May 2006, Jim Redman wrote: > >> Does anyone know of any work to make RXTX work with Ethernet (telent) >> Terminal Servers? >> >> If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 >> Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? >> > > Hi Jim > > It appears the author of NVTCom has decided to release the library into > the public domain. Integration with rxtx is possible but it would be best > to contact the author and find out what his intent is. > > I would suggest contacting the author with a proposal of what you would > like to do and take it from there. We could 'take' public domain software > but its better to show respect to the authors and respect their wishes. > I sent Marco(?), the author of the library, a note before asking the list - I'll let you know the response. If anyone is already working on it, or has an interest and more time and energy than me, I'd hate to duplicate the efforts. If no one is, and no one objects, maybe I'll see what I can do. Jim > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From Christian.Klemke at t-online.de Mon May 15 02:23:06 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Mon, 15 May 2006 10:23:06 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu><004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: <008a01c677f8$cae18590$02fea8c0@NB600> Hi Trent, Hi Paul, I finally found some time to create a simple patch to enable the optional suppression of version output to the console. It is based on a new system property called "gnu.io.rxtx.NoVersionOutput" which can by set to "true" if necessary. I had some problems accessing CVS, therefore I downloaded the rxtx-2.1-7r2 source archive from ftp.qbang.org (which is linked on the rxtx.org download page) and worked with that release. Please find my proposed patch in the attachment ! Regards, Christian ----- Original Message ----- From: "Trent Jarvi" To: "RXTX Developers and Users" Cc: ""Paul Gettings"" Sent: Friday, May 05, 2006 2:09 PM Subject: Re: [Rxtx] RXTX causing stdout messages > On Fri, 5 May 2006, Christian Klemke wrote: > >> Hi Paul, >> >> I was wondering about the same question some days ago and took a look at >> the >> source files. Unfortunately, I found that you can only get rid of that >> messages by altering and recompiling the Java code. There is a final >> static >> boolean variable called "devel" in the file "RXTXCommDriver.java" which >> is >> set to "true". This constellation causes the output after the native >> libraries have been loaded. No mechanism exists to suppress them >> otherwise >> :-(. >> >> Trent, does that mean that 2.1.7 is still officially a "development" >> version >> ? When will this value be changed to "false" by default ? With 2.1.8 ? It >> would be nice to provide a means to suppress such messages besides that >> static flag (maybe by setting a property called >> "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The >> output can indeed by annoying, especially when used with console >> applications, where the message potentially appears "in the middle" of >> your >> own output. Another possibility would be not to use System.out directly, >> but >> instead some PrintStream field which is initially set to System.out but >> can >> programatically be changed. That would allow for any kind of redirection >> or >> suppression by implementing appropriate user-defined PrintStream >> subclasses >> and making RXTX use that stream. What do you think ? >> > > A patch for using properties would be accepted I'm sure. > > The reason the default is to display the message is not related to the > development state of rxtx anymore. The problem is that people first using > rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. > The message prevents a great deal of email thats easily explained by the > message. > > I question if we should support rxtx 2.0 at all anymore. > > If you post a patch in bugzilla, we'll put it into CVS this weekend. > we'll be going through and doing such things anyhow. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_version_output_patch.diff Type: application/octet-stream Size: 991 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060515/3173c2b6/rxtx_version_output_patch.obj From lyon at docjava.com Mon May 15 06:06:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 May 2006 08:06:21 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Joachim makes several good points. Let me see if I can address some of them below: >Hello Douglas, > >Looking at the current code, leaves me with the feeling, that there? >is a lot to do. Yes! >Defining an API that wraps javax.comm to provide what? >you describe is certainly possible, but I wonder how much benefit it? >will actually provide. > >Personally I think the API defined by javax.comm > >"request/lock" a port with: > cp= new CommunicationPort(identifier) >"release" a port with: > cp.close(); > >works quite nice for 99% of the applications. I don't know what percentage of applications turn off locking, the way that I do in my version of the RXTX lib. I do know that this is not safe practice. I also know that it was motivated by the multi-platform nature of my code and that this was the only way I could make things work, at the time. Java does not appear to have a cross-platform standard for locking resources on various platforms. Each OS appears to have its own standard. The question of who breaks deadlocks and how this is done remains open, as this is not an easy question to resolve. Let me continue, below: > >In my experience, the most efficient and elegant implementation is to? >wrap a port/socket/.. into a business object which declares the? >remote operations that are possible. Ie "uploadFile",? >"waitForPrompt", "getSerialNumber", "sendContact", "executeCommand",? >etc Those methods are then either synchronized or guarded by a? >monitor. I do not see how your design pattern applied to the port? >resource would help implementing this. I have no problem with high-level wrappers that are application specific. That is a very good idea, but orthogonal with respect to the issue of deadlocks. More below: > >[details start, skip if you agree to the above] >When I talked about "thread-safe" I didn't mean several independent? >"sessions" accessing the port concurrently. I think this is a very? >rare usage. That is probably why turning locking off works so well! On the other hand, it is not safe and I shouldn't do it. >I believe the most common use case for serial ports today? >is the control of an external device from a PC running a GUI based? >application. To implement a clean Swing/AWT-GUI one needs to pass any? >action that can block to a "worker" thread (else the GUI blocks, the? >application appears dead). While it is possible to use own prespawned? >thread that will accept Runnables which operate on the port, this is? >not very elegant. It is more common to spawn a new thread for every? >action triggered by the user. Additionally the ABORT of a running? >operation is often implemented via a port.close() delegated to a? >different thread. Here lies the heart of serial port concern. An application opens a serial port and then dies. The application is restarted and finds the port locked. How do we clear the lock? Must the application's user reside in the UUCP group? Must installers of the serial port add users to the UUCP group? Should locking be handled at a high-level of abstraction in an operating system independent way? Should the implementation of the locking mechanism be translated into an API that is dependent on the OS convention? Suppose that we restrict the discussion to serial ports. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on inconsistent naming conventions. Hence my feeling that we need to mirror what is done in other API's; we need a locking toolkit that references peer methods, IMHO. >From the Java programming point of view, the locking API is portable across different platforms, but has, as its implementation, a native peer method that uses the conventions of the underlying OS. This enables portable resource locking (in theory!). Consider, for example: org.apache.commons.transaction.locking with: Interface LockManager at: http://jakarta.apache.org/commons/transaction/apidocs/org/apache/commons/transaction/locking/LockManager.html Or, more recently: java.util.concurrent.locks Interface Lock based on Doug Lea's code: http://kickjava.com/src/EDU/oswego/cs/dl/util/concurrent/ReadWriteLock.java.htm Should we incorporate a clean, portable design into serial port use, one that is consistent with current locking APIs? Basically, a comm port is a resource and resources are typically controlled by managers. Thus, I suggest that we make use of a CommPortManager to help control and centralize serial port usage. The question of how this is done remains open, IMHO, but using core API's like: java.util.concurrent.locks might not be amiss. High-level methods (getAllPorts, getAllSerialPorts, getAllParallelPorts, etc...) might be welcome additions. Basic questions like, "what if a port is in use?" remain open, hence my proposal for the new design pattern. Isn't it the CommPortManager's role to break the deadlock? Cheers! - Doug > >- During the lifetime of a port, it will usually be accessed from? >several different threads. Instance variables need to be set/read in? >synchronized regions to guarantee a correct operation based on the? >Java memory model. >- Synchronizing the access is usually handled on the application? >level (synchronizing the reads/writes is usually useless from the? >applications view because it is not a transaction mechanism). >[details end] > >I am very open to learn about other scenarios where your proposed? >design pattern applied to the port resource is beneficial to the? >application implementor. > >Best regards, >Joachim > >On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > >> Dmitry suggests that we acquire an implementation of >> a serial port reference, use it, then release it (i.e., check it? >> back in). >> > > Joachim says that making serial ports thread friendly might be a? >> good idea. >> >> This is a good idea. The design pattern that is close to this idea >> is the "Object Pool Design Pattern". >> # Object Pool > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Mon May 15 06:58:19 2006 From: joachim at buechse.de (Joachim Buechse) Date: Mon, 15 May 2006 14:58:19 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Doug, I agree fully, that locking of the system resource should be abstracted from the user (programmer). Currently this is already the case, but I agree it might be nice to extract the code into a separate class, which uses platform dependent providers to do its job. What I described in my email was not targeted at allocating the system resource, but at handling an already allocated system resource inside the framework. I agree that it may be possible to combine the two - however, I would suggest to do this in phase2. I can contribute a work over of RXTXPort.java which implements clean internal locking and proper close behavior (which I would call phase 1). I could do this this week. However I strongly believe that there is little sense in trying to do this as a series of patches. It will be closer to a rewrite than to a patch. I have already provided a number of suggested patches via Bugzilla, but this is quite inconvenient (for me). My working copy diverges more and more from the master and hence it gets more and more annoying to provide self contained patches. Best regards, Joachim From tjarvi at qbang.org Mon May 15 08:27:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 May 2006 08:27:51 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Mon, 15 May 2006, Joachim Buechse wrote: > Hello Doug, > > I agree fully, that locking of the system resource should be > abstracted from the user (programmer). Currently this is already the > case, but I agree it might be nice to extract the code into a > separate class, which uses platform dependent providers to do its job. > > What I described in my email was not targeted at allocating the > system resource, but at handling an already allocated system resource > inside the framework. I agree that it may be possible to combine the > two - however, I would suggest to do this in phase2. > > I can contribute a work over of RXTXPort.java which implements clean > internal locking and proper close behavior (which I would call phase > 1). I could do this this week. > > However I strongly believe that there is little sense in trying to do > this as a series of patches. It will be closer to a rewrite than to a > patch. I have already provided a number of suggested patches via > Bugzilla, but this is quite inconvenient (for me). My working copy > diverges more and more from the master and hence it gets more and > more annoying to provide self contained patches. > For methodical testing purposes (which does go on) the incremental patches are better. I'm lagging behind in bugzilla but thats soon to change (this week). It has just been rather chaotic up until now. I moved, purchased a house, and jumped into the fire of a feature freeze timeframe at a new job. btw, we see the Solaris close issues on 2.8 also. 9 and 10 are fine. I'll work towards making those test results public and allow others to run new rxtx code through them. We had the OK at one point but setting up the environment is involved. It isn't just a collection of java classes. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Tue May 16 02:01:47 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:01:47 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] Message-ID: <446986EB.209@willicon.de> Hi, any ideas for my problem? Hans -------- Original-Nachricht -------- Betreff: [Rxtx] Problem under Mac OSX 10.3.9 Datum: Mon, 08 May 2006 18:47:20 +0200 Von: WILLICon Antwort an: RXTX Developers and Users An: RXTX Developers and Users Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/b0741c2b/attachment.html From joachim at buechse.de Tue May 16 02:15:08 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 10:15:08 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: Hello Hans, I am using RXTX on OS X for my own project. I do not see the problem you describe. I had some troubles installing it because the current version uses lock files which is non-standard on OS X. I have created a patched version which I currently use. This version does not need to modify user groups and hence does not need an installer. I just pop it in the application directory. If you send me a link where I can download your OSX installer, I will have a quick look. Regards, Joachim On 16.05.2006, at 10:01, WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we > have some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + > spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + > spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always > the value "false". > I can only get the status, while I open the port and catch the > exception. > > Any ideas? > > Hans > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail at willicon.de Tue May 16 02:26:53 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:26:53 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: References: <446986EB.209@willicon.de> Message-ID: <44698CCD.7050709@willicon.de> Joachim, tanks for the answer. I'll send You a mail. Hans Joachim Buechse schrieb: > Hello Hans, > > I am using RXTX on OS X for my own project. I do not see the problem > you describe. > > I had some troubles installing it because the current version uses > lock files which is non-standard on OS X. I have created a patched > version which I currently use. This version does not need to modify > user groups and hence does not need an installer. I just pop it in > the application directory. If you send me a link where I can download > your OSX installer, I will have a quick look. > > Regards, > Joachim > > On 16.05.2006, at 10:01, WILLICon wrote: > > >> Hi, >> >> any ideas for my problem? >> >> Hans >> >> -------- Original-Nachricht -------- >> Betreff: [Rxtx] Problem under Mac OSX 10.3.9 >> Datum: Mon, 08 May 2006 18:47:20 +0200 >> Von: WILLICon >> Antwort an: RXTX Developers and Users >> An: RXTX Developers and Users >> >> >> Hi, >> >> I use for RXTX for communicate with CyclingComputers. >> >> It works good under Win32, Sloaris and Linux but with Mac OSX we >> have some problems. >> >> My users install the Mac OSX serial lib from the actual binary. >> >> After starting the program, they get this error message: >> >> java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while >> loading gnu.io.RXTXCommDriver >> >> Remember, this error comes only under Mac OSX. >> >> That is the code for the error: >> >> Enumeration portList = CommPortIdentifier.getPortIdentifiers(); >> spInUse = getBundleStr("serialPortInUse"); >> spFree = getBundleStr("serialPortFree"); >> while (portList.hasMoreElements()) { >> CommPortIdentifier portId = (CommPortIdentifier) >> portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (osName != null && osName.startsWith("mac")) { >> if (!portId.getName().startsWith("dev/cu.")) { >> continue; >> } >> } >> if (portId.isCurrentlyOwned()) { >> serialPortNames.add(portId.getName() + " - " + >> spInUse); >> } >> else { >> serialPortNames.add(portId.getName() + " - " + >> spFree); >> } >> } >> } >> if (serialPortNames.size() == 0) { >> serialPortNames.add(getBundleStr("serialPortNotFound")); >> } >> >> BTW: The methode isCurrentlyOwned() is not working. I get always >> the value "false". >> I can only get the status, while I open the port and catch the >> exception. >> >> Any ideas? >> >> Hans >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/948333be/attachment.html From jredman at ergotech.com Tue May 16 07:35:52 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 16 May 2006 07:35:52 -0600 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: <4469D538.6070408@ergotech.com> Hans, I have no direct insight, but would note that what you have is a "NoClassDefFoundError" not a "ClassNotFoundException". So the class javax/comm/CommDriver is found, but one of its dependencies is missing. NoClassDefFoundError are a bigger problem to resolve because you get no indication of the real problem. Jim WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we have > some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > * spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always the > value "false". > I can only get the status, while I open the port and catch the exception. > > Any ideas? > > Hans > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.de Tue May 16 08:01:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 16:01:21 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 In-Reply-To: <4469AFC3.6000002@willicon.de> References: <44698EBC.8000008@willicon.de> <8C5680C4-E2BA-42FF-B221-36E1124FA6A4@buechse.de> <4469AFC3.6000002@willicon.de> Message-ID: <9825A602-D6ED-4C28-BF33-9A7C984FACD5@buechse.de> Hallo Hans, you include RXTX 2.17 in your "bikeXexperience.jar" (2.17 uses Interfaces from gnu.io.* not javax.comm.*). Now inspect your error log closely: The class gnu.io.RXTXCommDriver tries to load javax.comm.CommDriver: this is only the case for RXTX 2.07. I assume, that the user has installed Version 2.07 into one of the java.ext.dirs . The VM always tries to load classes from the "system" path first. The current Mac installer distributed with RXTX in fact installs RXTXcomm.jar and librxtxSerial.jnilib into /Library/Java/Extensions. (I wrote some time ago that I consider this as a bad idea because of potential version conflicts-> thanks for delivering the example). For 2.07 it does so without installing the javax.comm classes it seems. I would recommend that you instruct your users to install version 2.17 only. Until RXTX is changed to use TIOCEXCL instead of lock files, you can hardly avoid the installer, as the user needs to be added to a special group and a lockfile directory needs be created. More precisely you are waiting for: http://bugzilla.qbang.org/show_bug.cgi?id=50 [RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL)] Regards, Joachim -------------- next part -------------- A non-text attachment was scrubbed... Name: log.tiff Type: image/tiff Size: 38394 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/e3e52128/log.tiff -------------- next part -------------- > > Ich verwende RXTX 2.17. Das orginal RXTXcomm.jar ist in > CyclingDataManager.jar enthalten. > From tjarvi at qbang.org Wed May 17 23:18:15 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 May 2006 23:18:15 -0600 (MDT) Subject: [Rxtx] update Message-ID: So we have several patches and these have stacked up. I'd like to thank everyone for being patient. Tests for the most intrusive patches look good so far. I still have to get some bits together on my end but it looks like we can catch everything up in CVS this week. I'll try to post a normal list of what went in by whom with links Saturday. But I'm not seeing anything that raises flags yet. I also think I'll be able to submit a patch for nonstandard baud rates. I have to confirm w32 but I think its going to be a one line fix. I don't know if its bugzilla or people tinkering with patch files before submitting but patches are not applying cleanly. So the patches have to be done by hand. This may make things difficult for people hoping to add other patches on top. I'm trying to make that go well but ... -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Thu May 18 02:23:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 May 2006 10:23:47 +0200 Subject: [Rxtx] update In-Reply-To: References: Message-ID: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Hello Trent, in fact I tinkered with the patches (never used this mechanism before, usually I "communicate" via cvs) ... so sorry for any trouble you had applying them. Basicly I edited the patches to make them self contained. Having the tests run with different speeds on different platforms, may well be an effect of caching. I have seen quite interesting propagation delays for the closing flag on my PowerPC system, which makes me doubt, that the propagation of output_buffer_empty_flag works as it should. Maybe the communication mechanism between the two threads should be replaced by something like pthread_cond_*. Could you describe which problems you see on Solaris/SPARC? I'd be interested to see if they exist on OS X (PowerPC) as well... As you seem to work on the stuff at the moment I would like to suggest the following additions (it looks more than it is, I posted some context to make clear where to apply the change). See the comments in braces for what was changed Greetings, Joachim (1) The end of the drain loop could be: --- report("drain_loop: received EINTR in tcdrain\n"); --- (added "in tcdrain" to make debug output clearer) (2) The start of the drain loop should be: --- for(i=0;;i++) { report_verbose("drain_loop: looping\n"); #if defined(__sun__) /* FIXME: No time to test on all OS's for production */ if( eis->eventloop_interrupted ) { goto end; } if (usleep(5000)) { report("drain_loop: received EINTR"); } #else if (usleep(1000000)) { report("drain_loop: received EINTR"); } #endif /* __sun__ */ --- (added a check for "eis->eventloop_interrupted" before the sleep) (3) The end of interrupt_event_loop could (and maybe should) be: --- #if !defined(TIOCSERGETLSR) && !defined(WIN32) /* make sure that the drainloop unblocks from tcdrain */ pthread_kill(index->drain_tid, SIGABRT); /* TODO use wait/join/SIGCHLD/?? instead of sleep? */ usleep(50 * 1000); /* Under normal conditions, SIGABRT will unblock tcdrain. However a non-responding USB device combined with an unclean driver may still block. This is very ugly because it may block the call to close indefinetly. */ if (index->closing != 1) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); index->closing = 1; } #endif report("interruptEventLoop: interrupted\n"); --- (added some comments and pthread_cancel for resisting drain thread) On 18.05.2006, at 07:18, Trent Jarvi wrote: > > So we have several patches and these have stacked up. I'd like to > thank > everyone for being patient. > > Tests for the most intrusive patches look good so far. I still > have to > get some bits together on my end but it looks like we can catch > everything > up in CVS this week. > > I'll try to post a normal list of what went in by whom with links > Saturday. But I'm not seeing anything that raises flags yet. I also > think I'll be able to submit a patch for nonstandard baud rates. > I have > to confirm w32 but I think its going to be a one line fix. > > I don't know if its bugzilla or people tinkering with patch files > before > submitting but patches are not applying cleanly. So the patches > have to > be done by hand. This may make things difficult for people hoping > to add > other patches on top. I'm trying to make that go well but ... > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu May 18 22:28:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 18 May 2006 22:28:00 -0600 (MDT) Subject: [Rxtx] update In-Reply-To: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> References: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Message-ID: On Thu, 18 May 2006, Joachim Buechse wrote: > Hello Trent, > > in fact I tinkered with the patches (never used this mechanism > before, usually I "communicate" via cvs) ... so sorry for any trouble > you had applying them. Basicly I edited the patches to make them self > contained. I think we are close to moving towards that. > > Having the tests run with different speeds on different platforms, > may well be an effect of caching. I have seen quite interesting > propagation delays for the closing flag on my PowerPC system, which > makes me doubt, that the propagation of output_buffer_empty_flag > works as it should. Maybe the communication mechanism between the two > threads should be replaced by something like pthread_cond_*. Could > you describe which problems you see on Solaris/SPARC? I'd be > interested to see if they exist on OS X (PowerPC) as well... This is interesting. I have seen problems with output buffer empty in applications that require it. I'm trying to get a bug list and or test results open for everyone to see but that may take time. But missed output buffer events ... yep. With Sparc, we have seen a few things. One was a kernel race condition that went away when we reimaged and updated 2.8. RXTX was hanging on close, top showed no cpu use but there was 2 second delays just typing on console. The other is our tests now take ~4 times longer on Solaris. Someone is looking at timing just open, close, read, write, ... to see if they can find where the slowdown is. This happened after solaris 2.8. I'll try to share more when/if there is something interesting. This may well not be solvable in userland. > > As you seem to work on the stuff at the moment I would like to > suggest the following additions (it looks more than it is, I posted > some context to make clear where to apply the change). See the > comments in braces for what was changed I'll take a look. This could all come together Saturday but I also have an event to attend that day. I may not wrap this up until Sunday. -- Trent Jarvi tjarvi at qbang.org From andrewlord at internode.on.net Sun May 21 20:10:02 2006 From: andrewlord at internode.on.net (Andrew Lord) Date: Mon, 22 May 2006 11:40:02 +0930 Subject: [Rxtx] Kernel include files do not match kernel Message-ID: <200605221140.03271.andrewlord@internode.on.net> Hi, I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel 2.6.12-18 with the command: ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include However I get the message: ## checking java.version 1.5.0_06 ## checking os.version 2.6.12-18mdk ## ## WARNING: Kernel include files do not match the current kernel ## ## configure: creating ./config.status etc. Is there a problem with the way I'm specifying the 'include' directory ? If not, how else can I specify the correct directory for the include files please ? Cheers, Andrew From tjarvi at qbang.org Sun May 21 20:31:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 May 2006 20:31:31 -0600 (MDT) Subject: [Rxtx] Kernel include files do not match kernel In-Reply-To: <200605221140.03271.andrewlord@internode.on.net> References: <200605221140.03271.andrewlord@internode.on.net> Message-ID: On Mon, 22 May 2006, Andrew Lord wrote: > Hi, > > I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel > 2.6.12-18 with the command: > > ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk > CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include > > However I get the message: > > ## checking java.version 1.5.0_06 > ## checking os.version 2.6.12-18mdk > ## > ## WARNING: Kernel include files do not match the current kernel > ## > ## configure: creating ./config.status > etc. > > Is there a problem with the way I'm specifying the 'include' directory ? If > not, how else can I specify the correct directory for the include files > please ? > Hi Andrew I'm fairly sure your --with-kernel option does nothing. The CPPFLAGS should do what you want. Maybe put an #error message in /usr/src/linux.../incude/linux/version.h But I don't recall a recent problem with version missmatches. It should work. Distros will even ship include files that don't match versions exactly. In theory it should never matter for users. I used to compile new kernels by hand and really didnt have a distro. I didnt have a seperate package of kernel headers for users (myself). When changing a gateway from linux 1.2.12 to 2.1.77, I would worry about such messages. So if you are doing something that weird, the message may be of use to you. If you just see the message on a distro you installed, it is more than likely harmless. -- Trent Jarvi tjarvi at qbang.org From mrogers at spro.net Mon May 22 14:45:39 2006 From: mrogers at spro.net (Mike Rogers) Date: Mon, 22 May 2006 14:45:39 -0600 Subject: [Rxtx] Sun's CommAPI -- think May? Message-ID: <447222F3.9040302@spro.net> Hi, Any word from Sun about progress towards fixing the Java CommAPI v3 "incompatibilities" so RXTX 2.0 can operate within the framework's namespace (javax.comm)? I recall mention of a May time frame. Thanks, Mike From paul.klissner at sun.com Mon May 22 15:09:27 2006 From: paul.klissner at sun.com (Paul Klissner) Date: Mon, 22 May 2006 14:09:27 -0700 Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <447222F3.9040302@spro.net> References: <447222F3.9040302@spro.net> Message-ID: <44722887.8080308@sun.com> Mike Rogers wrote: > Hi, > > Any word from Sun about progress towards fixing the Java CommAPI v3 > "incompatibilities" so RXTX 2.0 can operate within the framework's > namespace (javax.comm)? I recall mention of a May time frame. > > Thanks, > > Mike > We've had a lot of work come in. This hasn't been the only priority. I'm running behind the plan in addressing this, but will be looking at it again soon. Rather than state a new, I'll just say it is in progress, and not off the table. I'll get this fixed as soon as I can. Good timing for asking as we just started discussing javax.comm plans today, and I'll have some cycles to work on it soon. Paul From yhua537 at cse.unsw.edu.au Mon May 22 16:03:05 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Tue, 23 May 2006 08:03:05 +1000 (EST) Subject: [Rxtx] install rxtx in XP Message-ID: Hi Guys, I am new to serial port programming, and have no experience on programming java in xp, but my project require me to builld a communication link between xp and a UART device. Most of the information in the web site seems for linux only. including the commands such as export and chmod. How do I install rxtx in xp? cheers YiQi Huang From mark at mdsh.com Tue May 23 01:24:20 2006 From: mark at mdsh.com (Mark Himsley) Date: Tue, 23 May 2006 08:24:20 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off , it includes DLLs for Windows and the JAR for Java. Follow the Windows instructions in the INSTALL. ie RXTXcomm.jar goes in \jre\lib\ext (under java) rxtxSerial.dll goes in \jre\bin So, assuming a fairly standard Java install, copy RXTXcomm.jar into C:\Program Files\Java\jre1.5.0_06\lib\ext and copy rxtxSerial.dll into C:\Program Files\Java\jre1.5.0_06\bin Yes, it really is that simple. On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > I am new to serial port programming, and have no experience on > programming java in xp, but my project require me to builld a > communication link between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang -- Mark Himsley From joachim at buechse.de Tue May 23 02:51:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 23 May 2006 10:51:47 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) Unless it is absolutely required you should NOT install RXTX in your global Java Runtime Environment. This will for sure create versioning conflicts - if not now, than in the future, if not on your system than at your clients. Instead put the dll in your application directory and include the RXTXcomm.jar in your classpath. This is much safer and not a bit more complicated. Regards, Joachim On 23.05.2006, at 09:24, Mark Himsley wrote: > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR > for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > >> I am new to serial port programming, and have no experience on >> programming java in xp, but my project require me to builld a >> communication link between xp and a UART device. >> >> Most of the information in the web site seems for linux only. >> including >> the commands such as export and chmod. How do I install rxtx in xp? >> >> cheers >> YiQi Huang > > > > -- > Mark Himsley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tod at todbot.com Tue May 23 03:12:22 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 02:12:22 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I totally agree: do not contaminate the Java installation. I put all the RXTX files in a directory and then change my java invocation to be: % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* Alternatively, use Launch4J to create a double-clickable application and keep the RXTX libraries in the directory of the application. -=tod On May 23, 2006, at 1:51 AM, Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > >> Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off >> , it includes DLLs for Windows and the JAR >> for Java. >> >> Follow the Windows instructions in the INSTALL. >> >> ie >> >> RXTXcomm.jar goes in \jre\lib\ext (under java) >> rxtxSerial.dll goes in \jre\bin >> >> So, assuming a fairly standard Java install, copy RXTXcomm.jar into >> C:\Program Files\Java\jre1.5.0_06\lib\ext >> and copy rxtxSerial.dll into >> C:\Program Files\Java\jre1.5.0_06\bin >> >> Yes, it really is that simple. >> >> >> >> On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: >> >>> I am new to serial port programming, and have no experience on >>> programming java in xp, but my project require me to builld a >>> communication link between xp and a UART device. >>> >>> Most of the information in the web site seems for linux only. >>> including >>> the commands such as export and chmod. How do I install rxtx in xp? >>> >>> cheers >>> YiQi Huang >> >> >> >> -- >> Mark Himsley >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From smontgomery at mediaspansoftware.com Tue May 23 08:46:53 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Tue, 23 May 2006 10:46:53 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: Message-ID: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Joachim and Tod mentioned how to keep the files RXTX requires on Windows XP out of the Java installations - thanks gentlemen! Are there similar suggestions for an RXTX install on OS X? The current "canonical" OS X installation instructions "contaminate the Java installation", to use Tod's words. Our app will run fine under 1.4.2 and 5.0 on OS X, and a lot of users will have both. We've already been burned by the recent switch from 1.4.2 to 5.0 as the platform default. Any suggestions welcomed. From tod at todbot.com Tue May 23 13:27:55 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 12:27:55 -0700 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <9BA0F670-A862-42E7-BB2C-130D775ABDF9@todbot.com> Hi Sean, It depends on how you build and deploy your code. If you're using shell scripts, you can do something like this: #!/bin/sh # pick one JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/ Commands/java #JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/ Commands/java $JAVA -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* That both picks which VM to use and uses the RXTX in the directory called 'rxtxlib'. If you want your shell script to be clever, you could test for the existence of the different 'java' executables and go from there (maybe even use different jar files). I am almost positive all OS X systems with Java 1.5 are guaranteed to also have Java 1.4.2. If you're using Jar Builder or XCode, you can specify which JVM to use and add the extra args in the Info.plist file. The paths specified in the 'java' invocation then are based off of the $JAVAROOT variable that the JavaApplicationStub sets for you. For my app, I've have been compiling two sets of jars, one compiled with 1.4.2 and one with 1.5, but they both run under 1.5. So I have a similar shell script that chooses a different 'javac' depending on the need. -=tod On May 23, 2006, at 7:46 AM, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From yhua537 at cse.unsw.edu.au Tue May 23 11:09:37 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 03:09:37 +1000 (EST) Subject: [Rxtx] install rxtx in XP (Mark Himsley, Joachim Buechse, Tod E. Kurt> In-Reply-To: References: Message-ID: > Message: 8 > Date: Tue, 23 May 2006 08:03:05 +1000 (EST) > From: YiQi Huang > Subject: [Rxtx] install rxtx in XP > To: rxtx at qbang.org > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > Hi Guys, > > I am new to serial port programming, and have no experience on programming > java in xp, but my project require me to builld a communication link > between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang > > > ------------------------------ > > Message: 9 > Date: Tue, 23 May 2006 08:24:20 +0100 > From: Mark Himsley > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=us-ascii; format=flowed > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > ------------------------------ > > Message: 10 > Date: Tue, 23 May 2006 10:51:47 +0200 > From: Joachim Buechse > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > > ------------------------------ > > Message: 11 > Date: Tue, 23 May 2006 02:12:22 -0700 > From: "Tod E. Kurt" > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I totally agree: do not contaminate the Java installation. > > I put all the RXTX files in a directory and then change my java > invocation to be: > > % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* > > Alternatively, use Launch4J to create a double-clickable application > and keep the RXTX libraries in the directory of the application. > > -=tod > > Hi, Thanks guys, I don't know if this is the correct way to reply your mecessage, if wrong, please point out. Thank you for Mark to give the detail instructions and Joachim to point out the cons ot installing in the java directory, and specially thanks for Tod to give the instrection in detail. Sorry to ask another stupid question: I have followed Tod's instruction. Now I think i am ready to start hacking. But where is the RXTX API documentation? Is it the same as using normal java comm API? btw, where could i find some examples to start with? Thanks very much cheers YiQi Huang From tjarvi at qbang.org Tue May 23 16:09:32 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 May 2006 16:09:32 -0600 (MDT) Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <44722887.8080308@sun.com> References: <447222F3.9040302@spro.net> <44722887.8080308@sun.com> Message-ID: > Good timing for asking as we just started discussing javax.comm plans > today, and I'll have some cycles to work on it soon. Hi Paul I assume you mean Sun is discussing plans concerning its own internal actions and there is no community involvment at this point. -- Trent Jarvi tjarvi at qbang.org From yhua537 at cse.unsw.edu.au Tue May 23 22:50:01 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 14:50:01 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } From mmester at sps.edu Tue May 23 22:58:21 2006 From: mmester at sps.edu (Michael Mester) Date: Wed, 24 May 2006 00:58:21 -0400 Subject: [Rxtx] install rxtx in XP References: Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below -----Original Message----- From: rxtx-bounces at qbang.org on behalf of YiQi Huang Sent: Wed 5/24/2006 12:50 AM To: RXTX Developers and Users Subject: Re: [Rxtx] install rxtx in XP Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3950 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060523/b36d0c63/attachment.bin From yhua537 at cse.unsw.edu.au Tue May 23 23:05:50 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 15:05:50 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: Yes, Michael you are right, it should be semicolons, But it still can't find the correct library. On Wed, 24 May 2006, Michael Mester wrote: > I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below > > > -----Original Message----- > From: rxtx-bounces at qbang.org on behalf of YiQi Huang > Sent: Wed 5/24/2006 12:50 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] install rxtx in XP > > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > cheers YiQi Huang From tod at todbot.com Wed May 24 00:01:57 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 23:01:57 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Yes, sorry, classpath entries are semicolon-separated on Windows and colon-separated on everything else. Your example code below is importing the wrong set of classes. It should not "import javax.comm.*", instead it should "import gnu.io.*". When I make that change, your example program compiles. The "javax.comm" package is the one released by Sun, the "gnu.io" package is the RXTX one. You might've seen some discussion that the two will be merged or become compatible, but that hasn't happened yet. -=tod On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > > Yes, Michael you are right, it should be semicolons, But it still > can't > find the correct library. > > On Wed, 24 May 2006, Michael Mester wrote: > >> I believe the entries in the classpath need to be seperated with >> semicolons, not a colon as you have in your command below >> >> >> -----Original Message----- >> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >> Sent: Wed 5/24/2006 12:50 AM >> To: RXTX Developers and Users >> Subject: Re: [Rxtx] install rxtx in XP >> >> Hi, >> >> Sorry guys.I follow Tod's instruction, and here is what i did: >> >> put >> RXTXcomm.jar, >> rxtxParallel.dll, >> rxtxSerial.dll >> in >> C:\RXTX_files >> >> and I got a SimpleRead class attached below, compile it with : >> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >> it still saying "cannot find symbol". >> >> Is there anything I did wrong? Do I need the comm.jar from Sun? >> >> Thanks & regards >> YiQi Huang >> >> >> //////////////////////////////////////////////////////// >> // SimpleRead.java >> //////////////////////////////////////////////////////// >> >> import java.io.*; >> import java.util.*; >> import javax.comm.*; >> >> public class SimpleRead >> implements Runnable, SerialPortEventListener { >> static CommPortIdentifier portId; >> static Enumeration portList; >> InputStream inputStream; >> SerialPort serialPort; >> Thread readThread; >> public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == >> CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals("COM1")) { >> //if (portId.getName().equals("/dev/term/a")) { >> SimpleRead reader = new SimpleRead(); >> } >> } >> } >> } >> public SimpleRead() { >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", >> 2000); >> } catch (PortInUseException e) {} >> try { >> inputStream = serialPort.getInputStream(); >> } catch (IOException e) {} >> try { >> serialPort.addEventListener(this); >> } catch (TooManyListenersException e) {} >> serialPort.notifyOnDataAvailable(true); >> try { >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } catch (UnsupportedCommOperationException e) {} >> readThread = new Thread(this); >> readThread.start(); >> } >> public void run() { >> try { >> Thread.sleep(20000); >> } catch (InterruptedException e) {} >> } >> public void serialEvent(SerialPortEvent event) { >> switch(event.getEventType()) { >> case SerialPortEvent.BI: >> case SerialPortEvent.OE: >> case SerialPortEvent.FE: >> case SerialPortEvent.PE: >> case SerialPortEvent.CD: >> case SerialPortEvent.CTS: >> case SerialPortEvent.DSR: >> case SerialPortEvent.RI: >> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >> break; >> case SerialPortEvent.DATA_AVAILABLE: >> byte[] readBuffer = new byte[20]; >> try { >> while (inputStream.available() > 0) { >> int numBytes = inputStream.read(readBuffer); >> } >> System.out.print(new String(readBuffer)); >> } catch (IOException e) {} >> break; >> } >> } >> } >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > cheers > YiQi Huang > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From joachim at buechse.de Wed May 24 00:10:06 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:10:06 +0200 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Hi Sean, my preferred way of dealing with RXTX on OS X is to include the RXTX classes into my application jar and to put the RXTX lib in the same directory as this jar. To make it even more comfortable, you can include the lib in the jar and have some startup code extract it and write it to a temporary file from which you load it with System.load(). Unfortunately the current version of RXTX for OS X requires tinkering with user groups as it is based on lockfiles - and hence it needs the RXTX OS X installer or you need to duplicated this functionality in your own installer. I have created my own native version which is not based on lockfiles but tty locking (the standard way to do it on OSX). I hope that these patches will be integrated soon into the distribution. Regards, Joachim On 23.05.2006, at 16:46, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Wed May 24 00:16:12 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:16:12 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <7017ECFC-B13E-4806-B321-9FFCAC5830F0@buechse.de> I assume you downloaded rxtx-217 (not 207). Instead of importing javax.comm.* you must import gnu.io.* The classes have the same name, but they are not in the same package. On 24.05.2006, at 06:50, YiQi Huang wrote: > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From yhua537 at cse.unsw.edu.au Wed May 24 00:17:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 16:17:45 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Message-ID: Thanks Tod again, i kept reading "gnu.io.*" as "gun.io.*" last few hours after i read some commons from web. Thanks very much Tod. thanks YiQi Huang On Tue, 23 May 2006, Tod E. Kurt wrote: > Yes, sorry, classpath entries are semicolon-separated on Windows and > colon-separated on everything else. > > Your example code below is importing the wrong set of classes. It > should not "import javax.comm.*", instead it should "import > gnu.io.*". When I make that change, your example program compiles. > The "javax.comm" package is the one released by Sun, the "gnu.io" > package is the RXTX one. You might've seen some discussion that the > two will be merged or become compatible, but that hasn't happened yet. > > -=tod > > > On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > >> >> Yes, Michael you are right, it should be semicolons, But it still >> can't >> find the correct library. >> >> On Wed, 24 May 2006, Michael Mester wrote: >> >>> I believe the entries in the classpath need to be seperated with >>> semicolons, not a colon as you have in your command below >>> >>> >>> -----Original Message----- >>> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >>> Sent: Wed 5/24/2006 12:50 AM >>> To: RXTX Developers and Users >>> Subject: Re: [Rxtx] install rxtx in XP >>> >>> Hi, >>> >>> Sorry guys.I follow Tod's instruction, and here is what i did: >>> >>> put >>> RXTXcomm.jar, >>> rxtxParallel.dll, >>> rxtxSerial.dll >>> in >>> C:\RXTX_files >>> >>> and I got a SimpleRead class attached below, compile it with : >>> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >>> it still saying "cannot find symbol". >>> >>> Is there anything I did wrong? Do I need the comm.jar from Sun? >>> >>> Thanks & regards >>> YiQi Huang >>> >>> >>> //////////////////////////////////////////////////////// >>> // SimpleRead.java >>> //////////////////////////////////////////////////////// >>> >>> import java.io.*; >>> import java.util.*; >>> import javax.comm.*; >>> >>> public class SimpleRead >>> implements Runnable, SerialPortEventListener { >>> static CommPortIdentifier portId; >>> static Enumeration portList; >>> InputStream inputStream; >>> SerialPort serialPort; >>> Thread readThread; >>> public static void main(String[] args) { >>> portList = CommPortIdentifier.getPortIdentifiers(); >>> while (portList.hasMoreElements()) { >>> portId = (CommPortIdentifier) portList.nextElement(); >>> if (portId.getPortType() == >>> CommPortIdentifier.PORT_SERIAL) { >>> if (portId.getName().equals("COM1")) { >>> //if (portId.getName().equals("/dev/term/a")) { >>> SimpleRead reader = new SimpleRead(); >>> } >>> } >>> } >>> } >>> public SimpleRead() { >>> try { >>> serialPort = (SerialPort) portId.open("SimpleReadApp", >>> 2000); >>> } catch (PortInUseException e) {} >>> try { >>> inputStream = serialPort.getInputStream(); >>> } catch (IOException e) {} >>> try { >>> serialPort.addEventListener(this); >>> } catch (TooManyListenersException e) {} >>> serialPort.notifyOnDataAvailable(true); >>> try { >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, >>> SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> } catch (UnsupportedCommOperationException e) {} >>> readThread = new Thread(this); >>> readThread.start(); >>> } >>> public void run() { >>> try { >>> Thread.sleep(20000); >>> } catch (InterruptedException e) {} >>> } >>> public void serialEvent(SerialPortEvent event) { >>> switch(event.getEventType()) { >>> case SerialPortEvent.BI: >>> case SerialPortEvent.OE: >>> case SerialPortEvent.FE: >>> case SerialPortEvent.PE: >>> case SerialPortEvent.CD: >>> case SerialPortEvent.CTS: >>> case SerialPortEvent.DSR: >>> case SerialPortEvent.RI: >>> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >>> break; >>> case SerialPortEvent.DATA_AVAILABLE: >>> byte[] readBuffer = new byte[20]; >>> try { >>> while (inputStream.available() > 0) { >>> int numBytes = inputStream.read(readBuffer); >>> } >>> System.out.print(new String(readBuffer)); >>> } catch (IOException e) {} >>> break; >>> } >>> } >>> } >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> >> cheers >> YiQi Huang >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From smontgomery at mediaspansoftware.com Wed May 24 10:24:13 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 12:24:13 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: Tod & Joachim, Thanks for the info, that's very helpful. I'll give that a whirl when I move to rxtx 2.1. I'm still using the older 2.0.7 version for now (don't ask), which probably requires the Sun comm.jar, javax.comm.properties and librxtxSerial.jnilib to be in very specific places in each jvm's file hierarchy. From tjarvi at qbang.org Wed May 24 11:59:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 11:59:16 -0600 (MDT) Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: On Wed, 24 May 2006, Sean Montgomery wrote: > Tod & Joachim, > > Thanks for the info, that's very helpful. I'll give that a whirl > when I move to rxtx 2.1. I'm still using the older 2.0.7 version for > now (don't ask), which probably requires the Sun comm.jar, > javax.comm.properties and librxtxSerial.jnilib to be in very specific > places in each jvm's file hierarchy. > You will need comm.jar from Sun then. It must be Sun's version 2.* or older for Linux or Solaris. I assume they have this in download archives. The default offering from Sun is version 3.0. This version currently does not support rxtx. The older version will probably be fine for your needs. -- Trent Jarvi tjarvi at qbang.org From smontgomery at mediaspansoftware.com Wed May 24 12:19:06 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 14:19:06 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: <3939EFB8-11E1-4E3E-A684-5B3C525577CD@mediaspansoftware.com> Yup, that's right, thanks Trent. I've been using these files for quite a while now. Thanks for bringing it up. I almost didn't mention using 2.0.7 because I didn't want to give any new members of the list the wrong idea! :-) On May 24, 2006, at 1:59 PM, Trent Jarvi wrote: > On Wed, 24 May 2006, Sean Montgomery wrote: > >> Tod & Joachim, >> >> Thanks for the info, that's very helpful. I'll give that a whirl >> when I move to rxtx 2.1. I'm still using the older 2.0.7 version for >> now (don't ask), which probably requires the Sun comm.jar, >> javax.comm.properties and librxtxSerial.jnilib to be in very specific >> places in each jvm's file hierarchy. >> > > You will need comm.jar from Sun then. It must be Sun's version 2.* or > older for Linux or Solaris. I assume they have this in download > archives. > > The default offering from Sun is version 3.0. This version > currently does > not support rxtx. > > The older version will probably be fine for your needs. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mark at mdsh.com Wed May 24 15:55:46 2006 From: mark at mdsh.com (Mark Himsley) Date: Wed, 24 May 2006 22:55:46 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <37B0FC4B1F3237321F093ABE@MacMini.local> On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) That's no problem. BUT, do note that the instructions I elaborated on are in the INSTALL file within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone please update the INSTALL file? > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > > , it includes DLLs for Windows and the JAR > > for Java. > > > > Follow the Windows instructions in the INSTALL. > > > > ie > > > > RXTXcomm.jar goes in \jre\lib\ext (under java) > > rxtxSerial.dll goes in \jre\bin > > > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > > C:\Program Files\Java\jre1.5.0_06\lib\ext > > and copy rxtxSerial.dll into > > C:\Program Files\Java\jre1.5.0_06\bin > > > > Yes, it really is that simple. > > > > > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > > > >> I am new to serial port programming, and have no experience on > >> programming java in xp, but my project require me to builld a > >> communication link between xp and a UART device. > >> > >> Most of the information in the web site seems for linux only. > >> including > >> the commands such as export and chmod. How do I install rxtx in xp? > >> > >> cheers > >> YiQi Huang > > > > > > > > -- > > Mark Himsley > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Mark Himsley From tjarvi at qbang.org Wed May 24 16:41:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 16:41:46 -0600 (MDT) Subject: [Rxtx] install rxtx in XP In-Reply-To: <37B0FC4B1F3237321F093ABE@MacMini.local> References: <37B0FC4B1F3237321F093ABE@MacMini.local> Message-ID: On Wed, 24 May 2006, Mark Himsley wrote: > > > On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > >> I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > That's no problem. > > BUT, do note that the instructions I elaborated on are in the INSTALL file > within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone > please update the INSTALL file? > > The INSTALL file may be updated by anyone at anytime. http://rxtx.qbang.org/wiki/index.php/Installation We are moving it to the wiki so end users may put the type of answers they would like to see in. Sometimes it's best if developers don't give what appears to be cryptic answers. You can even put in that jre/lib/ext is not the right place but you don't understand the classpath solution mentioned on the mail-list and then we know what to add. -- Trent Jarvi tjarvi at qbang.org From stramit at gmail.com Wed May 24 21:45:31 2006 From: stramit at gmail.com (Tim Cooper) Date: Thu, 25 May 2006 13:45:31 +1000 Subject: [Rxtx] Accessing Virtual Com Port Message-ID: Hi, I have to develop an application that talks to a virtual com port (in this case com3) which translates any messages sent across a USB cable to a micro. Using C++ I can talk to this com port and I know that it is configured, present, and working. For the application that I am trying to write I want to use RXTX for the communication. My problem is that the configured virtual port (in windows) is not showing up when I do an enumeration over the available ports. The output I get is (com 3 is not present) : Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 PORT FOUND: COM1 PORT FOUND: LPT1 Is there anything that I need to do to make com3 available to RXTX and my application? Timothy Cooper -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060524/c5591648/attachment.html From antonio.luis at iscte.pt Thu May 25 01:39:13 2006 From: antonio.luis at iscte.pt (=?ISO-8859-1?Q?Ant=F3nio_Lopes?=) Date: Thu, 25 May 2006 08:39:13 +0100 Subject: [Rxtx] RXTX on Pocket PC Message-ID: <44755F21.8060103@iscte.pt> Hello everyone, I've been using RXTX to communicate with serial ports in Windows and it's been quite successful. However, I'm now considering porting my application from Windows to Pocket PC but I can't seem to find the RXTX binaries (*.jar and *.dll) to use in Pocket PC. I've been "digging" on the mailing list's archives and also on the web and I can't find these anywhere. Can anyone in this mailing list give me some pointers on this? Where can I find the necessary files and basic installation instructions? Thanks very much for your help. I very much appreciate any help that you can provide me. Regards, -- Ant?nio Lopes @contact: antonio.luis at iscte.pt @work: ADETTI - ISCTE @web: http://antonio.lopes.googlepages.com/home From doug at dupreeinc.com Fri May 26 15:45:50 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Fri, 26 May 2006 14:45:50 -0700 Subject: [Rxtx] rxtx slow startup Message-ID: <4477770E.9010400@dupreeinc.com> Hello, I hope there are people still reading this mailing list. The archive appeared to not have anything new after 4/2005. I was using the commapi from sun for a project where a java application reads data from test equipment connected to the serial port. I had to upgrade the ftdi vcp driver on my pc and the old sun commapi no longer works with hardware flow control. as an experiment I replaced the javax.com with gnu.io in the SerialDemo.java project that was included with the commapi. This compiled fine using JBuilder 2006 and JRE 1.5.0_05. RXTX also works with the latest ftdi drivers so life is wonderful again... almost... When using the commapi jar the SerialDemo program starts in about 1 second on my system. Using the RXTX jar it takes over 56 seconds to start. Has anyone else seen this problem? Is there a workaround to get the startup performance close to the old commapi? The last thing printed to the console before this delay is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks for your time! Doug From yhua537 at cse.unsw.edu.au Sat May 27 05:46:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 21:46:45 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <4477770E.9010400@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> Message-ID: hi Doug The archive hasn't been update for a long time, But people certainly still reading the list. I don't have enough experience to help on your problem, but without any detail about what your problem doing during that 56 seconds, it is hard to target the your question, I think. cheers YiQi On Fri, 26 May 2006, Doug Thistlethwaite wrote: > Hello, > > I hope there are people still reading this mailing list. The archive > appeared to not have anything new after 4/2005. > > I was using the commapi from sun for a project where a java application > reads data from test equipment connected to the serial port. I had to > upgrade the ftdi vcp driver on my pc and the old sun commapi no longer > works with hardware flow control. as an experiment I replaced the > javax.com with gnu.io in the SerialDemo.java project that was included > with the commapi. This compiled fine using JBuilder 2006 and JRE > 1.5.0_05. RXTX also works with the latest ftdi drivers so life is > wonderful again... almost... > > When using the commapi jar the SerialDemo program starts in about 1 > second on my system. Using the RXTX jar it takes over 56 seconds to > start. Has anyone else seen this problem? Is there a workaround to get > the startup performance close to the old commapi? > > The last thing printed to the console before this delay is: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Thanks for your time! > > Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------- Just a student, Still a student ------------------------------- From yhua537 at cse.unsw.edu.au Sat May 27 06:04:26 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 22:04:26 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: Sorry, I don't think you could understand what I mean .I mean this: Without any detail about what your program is doing during that 56 seconds, it is hard for anyone to target the problem. On Sat, 27 May 2006, YiQi Huang wrote: > hi Doug > > The archive hasn't been update for a long time, But people certainly still > reading the list. > > I don't have enough experience to help on your problem, but without any > detail about what your problem doing during that 56 seconds, it is hard to > target the your question, I think. > > cheers > YiQi > > On Fri, 26 May 2006, Doug Thistlethwaite wrote: > >> Hello, >> >> I hope there are people still reading this mailing list. The archive >> appeared to not have anything new after 4/2005. >> >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From jredman at ergotech.com Sat May 27 08:32:02 2006 From: jredman at ergotech.com (Jim Redman) Date: Sat, 27 May 2006 08:32:02 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: <447862E2.4080506@ergotech.com> Doug, Since you mentioned it, we have a system that is also seems slow. From memory (I don't have one of the slow systems around), I'm not sure that it's consistent, it seems that sometimes it may take longer than others. Since it's part of the bootup it hasn't raised a flag and I haven't researched it. The same code runs much faster on other systems, so now you've got me wondering what's different. The slow system boots DSL (http://www.damnsmalllinux.org/) from a compact flash. FC4 is on my desktop where I haven't noticed a slow down. I think that the rxtx code is the same in both cases with lock files disabled. The slow system has a bunch of serial ports defined, including 4 USB serial ports that do not exist - they are not plugged in. Any clues in there? Jim > On Fri, 26 May 2006, Doug Thistlethwaite wrote: >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Sat May 27 10:41:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 May 2006 10:41:54 -0600 (MDT) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447862E2.4080506@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: On Sat, 27 May 2006, Jim Redman wrote: > Doug, > > Since you mentioned it, we have a system that is also seems slow. From > memory (I don't have one of the slow systems around), I'm not sure that > it's consistent, it seems that sometimes it may take longer than others. > Since it's part of the bootup it hasn't raised a flag and I haven't > researched it. > > The same code runs much faster on other systems, so now you've got me > wondering what's different. > > The slow system boots DSL (http://www.damnsmalllinux.org/) from a > compact flash. FC4 is on my desktop where I haven't noticed a slow > down. I think that the rxtx code is the same in both cases with lock > files disabled. > > The slow system has a bunch of serial ports defined, including 4 USB > serial ports that do not exist - they are not plugged in. > > Any clues in there? > rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. When it does this, it will try to open each port and do a timed out read. most systems will not have entries in device if the port is not there. But some minimal systems will just put all the device files there in case hardware is added. The list of devices scanned used to be ~10-20 times longer than it is today. That was getting very slow. I suspect moving the device files not used to a backup directory would increase the enumeration. I'll look into why the mail-list archive is not updating. The last update was about when I thought I 'fixed' the cron jobs. I probably didn't actually fix it but rather moved the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon May 29 19:46:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 May 2006 19:46:47 -0600 (MDT) Subject: [Rxtx] Mail-List Archives are updating. Message-ID: It was pointed out earlier that the archive is dated. This was a missing crontab entry. The list is currently archived by the week on the web page. It is updated once a day. So every 7 days it starts a new link and updates it daily. I've been limited in what I could do while my cable modem was disconnected this last week. rxtx.org is something I do on my own time. The patches and credits will be comming next. Many of these can be seen in bugzilla right now. -- Trent Jarvi tjarvi at qbang.org From doug at dupreeinc.com Tue May 30 11:18:41 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 10:18:41 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: <447C7E71.4080204@dupreeinc.com> Trent, YiQi, and Jim: Thanks to all for the replies and information! I am just back from a long weekend and I am now trying to figure out what I was doing! :) As for more information. First off, this example is being run under windows XP. I am developing test equipment that communicates with a java application via a serial port. I have been using the commapi for several years and have not had a problem. Recently, I have started a design modification that will replace the RS232 connection with a USB port. I am using the ftdi module for prototyping and I discovered that their virtual com port driver was not compatible with the commapi that Sun released. It turns out that it has problems with hardware flow control ( it works on incoming but not outgoing communications). The way I figured this out was by experimenting with the SerialDemo that was included with the Sum commapi. One nice thing about this example is it has the ability to set incoming and outgoing flow control independently. After I installed RXTX into my JBuilder 2006 IDE, I just replaced all all instances of javax.comm with gnu.io and it compiled and runs without a hitch (except for the slow startup). I Paused the JBuilder IDE during this long pause and the last few entries in the stack trace are: testRead() : -1, gnu.io.RXTXCommDriver registerValidPorts() : 255, gnu.io.RXTXCommDriver registerScannedPorts() : 777, gnu.io.RXTXCommDriver This was all initiated by the following call in the programs init routine: Enumeration en = CommPortIdentifier.getPortIdentifiers(); After looking at this, My guess is that Trent is correct in that the delay is in scanning for ports. I guess one solution would be to not scan for ports, though it would be nice to detect what is available on the system. Is there any way to reduce the number of ports scanned by this function in windows XP? Thanks again for your time, Doug Trent Jarvi wrote: >On Sat, 27 May 2006, Jim Redman wrote: > > > >>Doug, >> >>Since you mentioned it, we have a system that is also seems slow. From >>memory (I don't have one of the slow systems around), I'm not sure that >>it's consistent, it seems that sometimes it may take longer than others. >>Since it's part of the bootup it hasn't raised a flag and I haven't >>researched it. >> >>The same code runs much faster on other systems, so now you've got me >>wondering what's different. >> >>The slow system boots DSL (http://www.damnsmalllinux.org/) from a >>compact flash. FC4 is on my desktop where I haven't noticed a slow >>down. I think that the rxtx code is the same in both cases with lock >>files disabled. >> >>The slow system has a bunch of serial ports defined, including 4 USB >>serial ports that do not exist - they are not plugged in. >> >>Any clues in there? >> >> >> > >rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. > >When it does this, it will try to open each port and do a timed out read. >most systems will not have entries in device if the port is not there. >But some minimal systems will just put all the device files there in case >hardware is added. > >The list of devices scanned used to be ~10-20 times longer than it is >today. That was getting very slow. > >I suspect moving the device files not used to a backup directory would >increase the enumeration. > >I'll look into why the mail-list archive is not updating. The last update >was about when I thought I 'fixed' the cron jobs. I probably didn't >actually fix it but rather moved the problem. > >-- >Trent Jarvi >tjarvi at qbang.org > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/86796453/attachment.html From doug at dupreeinc.com Tue May 30 14:36:09 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 13:36:09 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447C7E71.4080204@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com> Message-ID: <447CACB9.1000801@dupreeinc.com> Hello all, I also notice this pause (not as long however) when I call: CommPortIdentifier.getPortIdentifier(PortName); I would think that if I supply the name of the port, it would not have to go through the same discovery process. If you have any ideas of how to get rid of this startup delay, I would really appreciate it. Thanks, Doug Doug Thistlethwaite wrote: > Trent, YiQi, and Jim: > > Thanks to all for the replies and information! I am just back from a > long weekend and I am now trying to figure out what I was doing! :) > > As for more information. First off, this example is being run under > windows XP. I am developing test equipment that communicates with a > java application via a serial port. I have been using the commapi for > several years and have not had a problem. Recently, I have started a > design modification that will replace the RS232 connection with a USB > port. I am using the ftdi module for prototyping and I discovered > that their virtual com port driver was not compatible with the commapi > that Sun released. It turns out that it has problems with hardware > flow control ( it works on incoming but not outgoing communications). > The way I figured this out was by experimenting with the SerialDemo > that was included with the Sum commapi. One nice thing about this > example is it has the ability to set incoming and outgoing flow > control independently. > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup). > > I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are: > > testRead() : -1, gnu.io.RXTXCommDriver > registerValidPorts() : 255, gnu.io.RXTXCommDriver > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > This was all initiated by the following call in the programs init routine: > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > After looking at this, My guess is that Trent is correct in that the > delay is in scanning for ports. I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system. Is there any way to reduce the number of ports scanned by > this function in windows XP? > > Thanks again for your time, > > Doug > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/edaa5c3c/attachment.html From lynn at swcp.com Tue May 30 15:07:18 2006 From: lynn at swcp.com (lynn@swcp.com) Date: Tue, 30 May 2006 21:07:18 -0000 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CACB9.1000801@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: *IF* the name of the port is supplied, we might want to use the preferences mechanism (java.util.prefs) where we could have previously saved the info for the port. We could do a quick check to see that things have not changed before using it. If things have changed (or never been defined) we would do a full port scan and save detected ports in the preferences. This way if the hardware is not changed, you only pay the time penalty one time. just an idea... Lynn Doug Thistlethwaite said: > This is a multi-part message in MIME format. > --------------070808020900080005070500 > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > Content-Transfer-Encoding: 7bit > > Hello all, > > I also notice this pause (not as long however) when I call: > > CommPortIdentifier.getPortIdentifier(PortName); > > I would think that if I supply the name of the port, it would not have > to go through the same discovery process. If you have any ideas of how > to get rid of this startup delay, I would really appreciate it. > > Thanks, > > Doug > > Doug Thistlethwaite wrote: > > > Trent, YiQi, and Jim: > > > > Thanks to all for the replies and information! I am just back from a > > long weekend and I am now trying to figure out what I was doing! :) > > > > As for more information. First off, this example is being run under > > windows XP. I am developing test equipment that communicates with a > > java application via a serial port. I have been using the commapi for > > several years and have not had a problem. Recently, I have started a > > design modification that will replace the RS232 connection with a USB > > port. I am using the ftdi module for prototyping and I discovered > > that their virtual com port driver was not compatible with the commapi > > that Sun released. It turns out that it has problems with hardware > > flow control ( it works on incoming but not outgoing communications). > > The way I figured this out was by experimenting with the SerialDemo > > that was included with the Sum commapi. One nice thing about this > > example is it has the ability to set incoming and outgoing flow > > control independently. > > > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > > all instances of javax.comm with gnu.io and it compiled and runs > > without a hitch (except for the slow startup). > > > > I Paused the JBuilder IDE during this long pause and the last few > > entries in the stack trace are: > > > > testRead() : -1, gnu.io.RXTXCommDriver > > registerValidPorts() : 255, gnu.io.RXTXCommDriver > > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > > > This was all initiated by the following call in the programs init routine: > > > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > > > After looking at this, My guess is that Trent is correct in that the > > delay is in scanning for ports. I guess one solution would be to not > > scan for ports, though it would be nice to detect what is available on > > the system. Is there any way to reduce the number of ports scanned by > > this function in windows XP? > > > > Thanks again for your time, > > > > Doug > > > > --------------070808020900080005070500 > Content-Type: text/html; charset=ISO-8859-1 > Content-Transfer-Encoding: 7bit > > > > > > > > > Hello all,
>
> I also notice this pause (not as long however) when I call:
>
>          CommPortIdentifier.getPortIdentifier(PortName);
>
> I would think that if I supply the name of the port, it would not have > to go through the same discovery process.  If you have any ideas of how > to get rid of this startup delay, I would really appreciate it.
>
> Thanks,
>
> Doug
>
> Doug Thistlethwaite wrote: >
> > Trent, YiQi, and Jim:
>
> Thanks to all for the replies and information!  I am just back from a > long weekend and I am now trying to figure out what I was doing! :)
>
> As for more information.  First off, this example is being run under > windows XP.  I am developing test equipment that communicates with a > java application via a serial port.  I have been using the commapi for > several years and have not had a problem.  Recently, I have started a > design modification that will replace the RS232 connection with a USB > port.  I am using the ftdi module for prototyping and I discovered that > their virtual com port driver was not compatible with the commapi that > Sun released.  It turns out that it has problems with hardware flow > control ( it works on incoming but not outgoing communications).  The > way I figured this out was by experimenting with the SerialDemo that > was included with the Sum commapi.  One nice thing about this example > is it has the ability to set incoming and outgoing flow control > independently.
>
> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup).
>
> I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are:
>
> testRead() : -1, gnu.io.RXTXCommDriver
> registerValidPorts() : 255, gnu.io.RXTXCommDriver
> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>
> This was all initiated by the following call in the programs init > routine:
>
> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>
> After looking at this,  My guess is that Trent is correct in that the > delay is in scanning for ports.  I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system.  Is there any way to reduce the number of ports scanned by > this function in windows XP? 
>
> Thanks again for your time,
>
> Doug
>
>
> > > > --------------070808020900080005070500-- > -- From jredman at ergotech.com Tue May 30 15:42:35 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 30 May 2006 15:42:35 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: <447CBC4B.2080206@ergotech.com> Lynn, If I understand your idea correctly, I don't think that this would work well for, say, USB ports since these can be easily added/removed by the end user. Jim lynn at swcp.com wrote: > *IF* the name of the port is supplied, we might want to use the preferences > mechanism (java.util.prefs) where we could have previously saved the info for > the port. We could do a quick check to see that things have not changed > before using it. If things have changed (or never been defined) we would do a > full port scan and save detected ports in the preferences. > > This way if the hardware is not changed, you only pay the time penalty one time. > > just an idea... > Lynn > > > Doug Thistlethwaite said: > >> This is a multi-part message in MIME format. >> --------------070808020900080005070500 >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >> Content-Transfer-Encoding: 7bit >> >> Hello all, >> >> I also notice this pause (not as long however) when I call: >> >> CommPortIdentifier.getPortIdentifier(PortName); >> >> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process. If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it. >> >> Thanks, >> >> Doug >> >> Doug Thistlethwaite wrote: >> >>> Trent, YiQi, and Jim: >>> >>> Thanks to all for the replies and information! I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :) >>> >>> As for more information. First off, this example is being run under >>> windows XP. I am developing test equipment that communicates with a >>> java application via a serial port. I have been using the commapi for >>> several years and have not had a problem. Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port. I am using the ftdi module for prototyping and I discovered >>> that their virtual com port driver was not compatible with the commapi >>> that Sun released. It turns out that it has problems with hardware >>> flow control ( it works on incoming but not outgoing communications). >>> The way I figured this out was by experimenting with the SerialDemo >>> that was included with the Sum commapi. One nice thing about this >>> example is it has the ability to set incoming and outgoing flow >>> control independently. >>> >>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup). >>> >>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are: >>> >>> testRead() : -1, gnu.io.RXTXCommDriver >>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>> >>> This was all initiated by the following call in the programs init routine: >>> >>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>> >>> After looking at this, My guess is that Trent is correct in that the >>> delay is in scanning for ports. I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system. Is there any way to reduce the number of ports scanned by >>> this function in windows XP? >>> >>> Thanks again for your time, >>> >>> Doug >>> >> --------------070808020900080005070500 >> Content-Type: text/html; charset=ISO-8859-1 >> Content-Transfer-Encoding: 7bit >> >> >> >> >> >> >> >> >> Hello all,
>>
>> I also notice this pause (not as long however) when I call:
>>
>>         >  CommPortIdentifier.getPortIdentifier(PortName);
>>
>> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process.  If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it.
>>
>> Thanks,
>>
>> Doug
>>
>> Doug Thistlethwaite wrote: >>
>> >> Trent, YiQi, and Jim:
>>
>> Thanks to all for the replies and information!  I am just back from a >> long weekend and I am now trying to figure out what I was doing! :)
>>
>> As for more information.  First off, this example is being run under >> windows XP.  I am developing test equipment that communicates with a >> java application via a serial port.  I have been using the commapi for >> several years and have not had a problem.  Recently, I have started a >> design modification that will replace the RS232 connection with a USB >> port.  I am using the ftdi module for prototyping and I discovered that >> their virtual com port driver was not compatible with the commapi that >> Sun released.  It turns out that it has problems with hardware flow >> control ( it works on incoming but not outgoing communications).  The >> way I figured this out was by experimenting with the SerialDemo that >> was included with the Sum commapi.  One nice thing about this example >> is it has the ability to set incoming and outgoing flow control >> independently.
>>
>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >> all instances of javax.comm with gnu.io and it compiled and runs >> without a hitch (except for the slow startup).
>>
>> I Paused the JBuilder IDE during this long pause and the last few >> entries in the stack trace are:
>>
>> testRead() : -1, gnu.io.RXTXCommDriver
>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>
>> This was all initiated by the following call in the programs init >> routine:
>>
>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>
>> After looking at this,  My guess is that Trent is correct in that the >> delay is in scanning for ports.  I guess one solution would be to not >> scan for ports, though it would be nice to detect what is available on >> the system.  Is there any way to reduce the number of ports scanned by >> this function in windows XP? 
>>
>> Thanks again for your time,
>>
>> Doug
>>
>>
>> >> >> >> --------------070808020900080005070500-- >> > > > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From yhua537 at cse.unsw.edu.au Tue May 30 18:10:23 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 31 May 2006 10:10:23 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CBC4B.2080206@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: Doug, In the SerialDemo, it allow us to save the parameters into a file, and use it when your program start up. Would this help? YiQi On Tue, 30 May 2006, Jim Redman wrote: > Lynn, > > If I understand your idea correctly, I don't think that this would work > well for, say, USB ports since these can be easily added/removed by the > end user. > > Jim > > lynn at swcp.com wrote: >> *IF* the name of the port is supplied, we might want to use the preferences >> mechanism (java.util.prefs) where we could have previously saved the info for >> the port. We could do a quick check to see that things have not changed >> before using it. If things have changed (or never been defined) we would do a >> full port scan and save detected ports in the preferences. >> >> This way if the hardware is not changed, you only pay the time penalty one time. >> >> just an idea... >> Lynn >> >> >> Doug Thistlethwaite said: >> >>> This is a multi-part message in MIME format. >>> --------------070808020900080005070500 >>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>> Content-Transfer-Encoding: 7bit >>> >>> Hello all, >>> >>> I also notice this pause (not as long however) when I call: >>> >>> CommPortIdentifier.getPortIdentifier(PortName); >>> >>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process. If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it. >>> >>> Thanks, >>> >>> Doug >>> >>> Doug Thistlethwaite wrote: >>> >>>> Trent, YiQi, and Jim: >>>> >>>> Thanks to all for the replies and information! I am just back from a >>>> long weekend and I am now trying to figure out what I was doing! :) >>>> >>>> As for more information. First off, this example is being run under >>>> windows XP. I am developing test equipment that communicates with a >>>> java application via a serial port. I have been using the commapi for >>>> several years and have not had a problem. Recently, I have started a >>>> design modification that will replace the RS232 connection with a USB >>>> port. I am using the ftdi module for prototyping and I discovered >>>> that their virtual com port driver was not compatible with the commapi >>>> that Sun released. It turns out that it has problems with hardware >>>> flow control ( it works on incoming but not outgoing communications). >>>> The way I figured this out was by experimenting with the SerialDemo >>>> that was included with the Sum commapi. One nice thing about this >>>> example is it has the ability to set incoming and outgoing flow >>>> control independently. >>>> >>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>> all instances of javax.comm with gnu.io and it compiled and runs >>>> without a hitch (except for the slow startup). >>>> >>>> I Paused the JBuilder IDE during this long pause and the last few >>>> entries in the stack trace are: >>>> >>>> testRead() : -1, gnu.io.RXTXCommDriver >>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>> >>>> This was all initiated by the following call in the programs init routine: >>>> >>>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>> >>>> After looking at this, My guess is that Trent is correct in that the >>>> delay is in scanning for ports. I guess one solution would be to not >>>> scan for ports, though it would be nice to detect what is available on >>>> the system. Is there any way to reduce the number of ports scanned by >>>> this function in windows XP? >>>> >>>> Thanks again for your time, >>>> >>>> Doug >>>> >>> --------------070808020900080005070500 >>> Content-Type: text/html; charset=ISO-8859-1 >>> Content-Transfer-Encoding: 7bit >>> >>> >>> >>> >>> >>> >>> >>> >>> Hello all,
>>>
>>> I also notice this pause (not as long however) when I call:
>>>
>>>         >>  CommPortIdentifier.getPortIdentifier(PortName);
>>>
>>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process.  If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it.
>>>
>>> Thanks,
>>>
>>> Doug
>>>
>>> Doug Thistlethwaite wrote: >>>
>>> >>> Trent, YiQi, and Jim:
>>>
>>> Thanks to all for the replies and information!  I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :)
>>>
>>> As for more information.  First off, this example is being run under >>> windows XP.  I am developing test equipment that communicates with a >>> java application via a serial port.  I have been using the commapi for >>> several years and have not had a problem.  Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port.  I am using the ftdi module for prototyping and I discovered that >>> their virtual com port driver was not compatible with the commapi that >>> Sun released.  It turns out that it has problems with hardware flow >>> control ( it works on incoming but not outgoing communications).  The >>> way I figured this out was by experimenting with the SerialDemo that >>> was included with the Sum commapi.  One nice thing about this example >>> is it has the ability to set incoming and outgoing flow control >>> independently.
>>>
>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup).
>>>
>>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are:
>>>
>>> testRead() : -1, gnu.io.RXTXCommDriver
>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>
>>> This was all initiated by the following call in the programs init >>> routine:
>>>
>>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>
>>> After looking at this,  My guess is that Trent is correct in that the >>> delay is in scanning for ports.  I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system.  Is there any way to reduce the number of ports scanned by >>> this function in windows XP? 
>>>
>>> Thanks again for your time,
>>>
>>> Doug
>>>
>>>
>>> >>> >>> >>> --------------070808020900080005070500-- >>> >> >> >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From halbleib at rechnerbetriebsgruppe.de Wed May 31 02:06:16 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 10:06:16 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp Message-ID: <447D4E78.30302@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, I getting an error while reloading my app in tomcat. At the first start everything runs well, but if i reload mit webapp by tomcat manager i get the following error. java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader Is there a possibility to unload the native library rxtxSerial.dll? thx for all help! regards tom -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 b8FT80HQ1xlbDLnRecDANCc= =heb1 -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 02:52:17 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 10:52:17 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D4E78.30302@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> Message-ID: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Hello Tom, To the best of my knowledge it is impossible to unload native libraries once loaded into the JVM. The exception you see stems from the fact, that Tomcat creates a new classloader when you "reload" the weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar is loaded from the session class loader. Try to add RXTXComm.jar to your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. Regards, Joachim On 31.05.2006, at 10:06, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 > b8FT80HQ1xlbDLnRecDANCc= > =heb1 > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From halbleib at rechnerbetriebsgruppe.de Wed May 31 03:28:35 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 11:28:35 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Message-ID: <447D61C3.1030807@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Joachim, I'm still not getting it. How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml-file? Perhaps web.xml? Regards, Tom Joachim Buechse schrieb: > Hello Tom, > > To the best of my knowledge it is impossible to unload native > libraries once loaded into the JVM. The exception you see stems from > the fact, that Tomcat creates a new classloader when you "reload" the > weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar > is loaded from the session class loader. Try to add RXTXComm.jar to > your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. > > Regards, > Joachim > > On 31.05.2006, at 10:06, Tom Halbleib wrote: > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL tzNy+/0iIUfkYYgt1+UT1ko= =pkpY -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 04:03:42 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 12:03:42 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D61C3.1030807@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> <447D61C3.1030807@rechnerbetriebsgruppe.de> Message-ID: -Xbootclasspath/a: is a start option to the java vm. Google is your friend in finding how to modfiy it and what it means: tomcat modifying bootclasspath Regards, Joachim On 31.05.2006, at 11:28, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Joachim, > > I'm still not getting it. > How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml- > file? > Perhaps web.xml? > > Regards, > Tom > > Joachim Buechse schrieb: >> Hello Tom, >> >> To the best of my knowledge it is impossible to unload native >> libraries once loaded into the JVM. The exception you see stems from >> the fact, that Tomcat creates a new classloader when you "reload" the >> weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar >> is loaded from the session class loader. Try to add RXTXComm.jar to >> your bootlclasspath (-Xbootclasspath/a:) and the problem should go >> away. >> >> Regards, >> Joachim >> >> On 31.05.2006, at 10:06, Tom Halbleib wrote: >> >> Hi all, >> >> I getting an error while reloading my app in tomcat. At the first >> start >> everything runs well, but if i reload mit webapp by tomcat manager >> i get >> the following error. >> >> java.lang.UnsatisfiedLinkError: Native Library >> C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in >> another classloader thrown while loading gnu.io.RXTXCommDriver >> Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: >> Native >> Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already >> loaded >> in another classloader >> >> >> Is there a possibility to unload the native library rxtxSerial.dll? >> >> thx for all help! >> >> regards >> >> tom > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL > tzNy+/0iIUfkYYgt1+UT1ko= > =pkpY > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From impakt01 at optusnet.com.au Wed May 31 06:55:42 2006 From: impakt01 at optusnet.com.au (Daren) Date: Wed, 31 May 2006 22:55:42 +1000 Subject: [Rxtx] (no subject) Message-ID: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/ade7ad37/attachment.html From doug at dupreeinc.com Wed May 31 10:19:19 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 31 May 2006 09:19:19 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: <447DC207.3070702@dupreeinc.com> I am not sure what you are saying. The Save parameters menu option saves the current settings (baud, data bits, etc.). The long pause (~60 seconds) is when the application first starts (before loading the saved parameters). This does bring up a question, though I hate this type of kludge approach to getting this library to work... What exactly is a PortIdentifier? Is it always the same? If I stored the results from "CommPortIdentifier.getPortIdentifier(PortName);" in a file, could I use this the next time the program is executed? In this case I am using a virtual com port driver to connect to the device through a USB port. Doug YiQi Huang wrote: >Doug, > >In the SerialDemo, it allow us to save the parameters into a file, and use >it when your program start up. Would this help? > >YiQi > >On Tue, 30 May 2006, Jim Redman wrote: > > > >>Lynn, >> >>If I understand your idea correctly, I don't think that this would work >>well for, say, USB ports since these can be easily added/removed by the >>end user. >> >>Jim >> >>lynn at swcp.com wrote: >> >> >>>*IF* the name of the port is supplied, we might want to use the preferences >>>mechanism (java.util.prefs) where we could have previously saved the info for >>>the port. We could do a quick check to see that things have not changed >>>before using it. If things have changed (or never been defined) we would do a >>>full port scan and save detected ports in the preferences. >>> >>>This way if the hardware is not changed, you only pay the time penalty one time. >>> >>>just an idea... >>>Lynn >>> >>> >>>Doug Thistlethwaite said: >>> >>> >>> >>>>This is a multi-part message in MIME format. >>>>--------------070808020900080005070500 >>>>Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>>>Content-Transfer-Encoding: 7bit >>>> >>>>Hello all, >>>> >>>>I also notice this pause (not as long however) when I call: >>>> >>>> CommPortIdentifier.getPortIdentifier(PortName); >>>> >>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process. If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it. >>>> >>>>Thanks, >>>> >>>>Doug >>>> >>>>Doug Thistlethwaite wrote: >>>> >>>> >>>> >>>>>Trent, YiQi, and Jim: >>>>> >>>>>Thanks to all for the replies and information! I am just back from a >>>>>long weekend and I am now trying to figure out what I was doing! :) >>>>> >>>>>As for more information. First off, this example is being run under >>>>>windows XP. I am developing test equipment that communicates with a >>>>>java application via a serial port. I have been using the commapi for >>>>>several years and have not had a problem. Recently, I have started a >>>>>design modification that will replace the RS232 connection with a USB >>>>>port. I am using the ftdi module for prototyping and I discovered >>>>>that their virtual com port driver was not compatible with the commapi >>>>>that Sun released. It turns out that it has problems with hardware >>>>>flow control ( it works on incoming but not outgoing communications). >>>>>The way I figured this out was by experimenting with the SerialDemo >>>>>that was included with the Sum commapi. One nice thing about this >>>>>example is it has the ability to set incoming and outgoing flow >>>>>control independently. >>>>> >>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>>without a hitch (except for the slow startup). >>>>> >>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>>entries in the stack trace are: >>>>> >>>>>testRead() : -1, gnu.io.RXTXCommDriver >>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>>> >>>>>This was all initiated by the following call in the programs init routine: >>>>> >>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>>> >>>>>After looking at this, My guess is that Trent is correct in that the >>>>>delay is in scanning for ports. I guess one solution would be to not >>>>>scan for ports, though it would be nice to detect what is available on >>>>>the system. Is there any way to reduce the number of ports scanned by >>>>>this function in windows XP? >>>>> >>>>>Thanks again for your time, >>>>> >>>>>Doug >>>>> >>>>> >>>>> >>>>--------------070808020900080005070500 >>>>Content-Type: text/html; charset=ISO-8859-1 >>>>Content-Transfer-Encoding: 7bit >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>>Hello all,
>>>>
>>>>I also notice this pause (not as long however) when I call:
>>>>
>>>>        >>>> >>>> >>> CommPortIdentifier.getPortIdentifier(PortName);
>>> >>> >>>>
>>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process.  If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it.
>>>>
>>>>Thanks,
>>>>
>>>>Doug
>>>>
>>>>Doug Thistlethwaite wrote: >>>>
>>>> >>>>Trent, YiQi, and Jim:
>>>>
>>>>Thanks to all for the replies and information!  I am just back from a >>>>long weekend and I am now trying to figure out what I was doing! :)
>>>>
>>>>As for more information.  First off, this example is being run under >>>>windows XP.  I am developing test equipment that communicates with a >>>>java application via a serial port.  I have been using the commapi for >>>>several years and have not had a problem.  Recently, I have started a >>>>design modification that will replace the RS232 connection with a USB >>>>port.  I am using the ftdi module for prototyping and I discovered that >>>>their virtual com port driver was not compatible with the commapi that >>>>Sun released.  It turns out that it has problems with hardware flow >>>>control ( it works on incoming but not outgoing communications).  The >>>>way I figured this out was by experimenting with the SerialDemo that >>>>was included with the Sum commapi.  One nice thing about this example >>>>is it has the ability to set incoming and outgoing flow control >>>>independently.
>>>>
>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>without a hitch (except for the slow startup).
>>>>
>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>entries in the stack trace are:
>>>>
>>>>testRead() : -1, gnu.io.RXTXCommDriver
>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>>
>>>>This was all initiated by the following call in the programs init >>>>routine:
>>>>
>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>>
>>>>After looking at this,  My guess is that Trent is correct in that the >>>>delay is in scanning for ports.  I guess one solution would be to not >>>>scan for ports, though it would be nice to detect what is available on >>>>the system.  Is there any way to reduce the number of ports scanned by >>>>this function in windows XP? 
>>>>
>>>>Thanks again for your time,
>>>>
>>>>Doug
>>>>
>>>>
>>>> >>>> >>>> >>>>--------------070808020900080005070500-- >>>> >>>> >>>> >>> >>> >>> >>-- >>Jim Redman >>(505) 662 5156 x85 >>http://www.ergotech.com >>_______________________________________________ >>Rxtx mailing list >>Rxtx at qbang.org >>http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > >cheers >YiQi Huang >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/61d4d4c9/attachment.html From impakt01 at optusnet.com.au Wed May 31 17:02:54 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 09:02:54 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Message-ID: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Hi all, I downloaded 2.1.7-pre16 and managed to build it and get it going. I made the changes as suggested by Peter Smith in an old post, by adding his code to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. Still not working, it opens the port at 9600 according to portmon.exe . Has anyone managed to get this going at a custom rate? Here is the post I'm referring to: http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 Thanks, Daren ________________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Daren Sent: Wednesday, 31 May 2006 10:56 PM To: rxtx at qbang.org Subject: [Rxtx] (no subject) Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren From tjarvi at qbang.org Wed May 31 21:44:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 May 2006 21:44:01 -0600 (MDT) Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> References: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Message-ID: On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org From impakt01 at optusnet.com.au Wed May 31 22:06:04 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 14:06:04 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: Message-ID: <200606010406.k51464X2010447@mail03.syd.optusnet.com.au> Trent, I have managed to successfully open the port at this speed using Realterm (available on sourceforge). From memory this uses DLPortIO. Using portmon.exe with realterm, even there it says that the port has opened at 1953. I changed termios.c:560 to dcb->BaudRate = 1953 ; and it still opens the port at 9600. Daren -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Thursday, 1 June 2006 1:44 PM To: RXTX Developers and Users Subject: Re: [Rxtx] custom baud rate win32 On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From smontgomery at mediaspansoftware.com Mon May 1 09:52:28 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 11:52:28 -0400 Subject: [Rxtx] RXTX, Java COMM and Windows Server 2003 on x64 experiences? Message-ID: Just wondering if anybody here has had to deploy RXTX or the javax.comm on Windows Server 2003 machines running on x64 (i.e. Xeon EM64T) and would like to relate how things went. From Sun's site, the Supported System Configurations pages give the options for that system: Java 5.0: - 32-bit Java 5.0 running on the OS in the 32-bit mode - 64-bit Java 5.0 running on the OS in the 64-bit native mode Java 1.4.2: - no options listed for EM64T processors, but potentially the standard 32-bit Java 1.4.2 could run on the OS in 32-bit mode? I guess the two main points of failure would be 1) the JVM itself and 2) the jni components. Make that three: there's gotta be hardware vendor driver support for the OS in the various modes, too. Guess I better go look at Keyspan's website... Thanks in advance for any info anyone might be able to provide. From smontgomery at mediaspansoftware.com Mon May 1 10:18:33 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 12:18:33 -0400 Subject: [Rxtx] Mailing list archive out of date? Message-ID: The mailing list archive at: http://mailman.qbang.org/pipermail/rxtx/ only shows emails through the end of March. Is there a new archive somewhere else? Didn't see anything mentioned on the wiki. From p.cain at phasefale.com.au Mon May 1 22:33:09 2006 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 02 May 2006 14:33:09 +1000 Subject: [Rxtx] RXTX and the Linux kernel. Message-ID: <4456E105.5080106@phasefale.com.au> Hi, First off the problem I am having isn't caused by RXTX itself but I'm hoping someone out there may have some knowledge that may help me. Background: I have an application monitoring a control system through a standard PC serial port which I talk to with rxtx-2.0.5. The application runs on RedHat7.3 kernel version 2.4.18 using Java 1.4. This configuration has been in use for several years and has proved to be stable. But it has become necessary for me to upgrade the OS but I'm running into problems with the serial communications. Its not that the comms don't work on the new OS (its never that simple) the comms work for a variable period of time (sometimes several hours) and then just stop, nothing on the data lines and control lines all indicate that data could flow. The new OS is Ubuntu 5.10 running kernel version 2.6.12. I have installed the OS and software on a PC and had it perform ok, then install the new OS and same software on the very same hardware and experienced the problems of them comms stopping. In the new OS I'm using Java5 to run the app but since I have experience the problem I reverted back to Java1.4 which didn't fix the problem. I've moved the app to a different system RedHat FC3 running 2.6.14 had experienced the problem. Not wanting to go through all the thing I have tried but I have established that it seems to be the 2.6 versions of the kernel that seem to be the problem and not an individual distribution of Linux. I should point out that I am using the same jar and library files for each java and OS combination. So I'm just wondering if anyone has had or heard of problems similar to these ? Or perhaps might know of what changed in the Linux serial driver (something I'm having a hard time establishing). I'm starting to run low on ideas of what to try so any help would be much appreciated. -- Peter Cain Senior Programmer Phasefale Pty Ltd From tjarvi at qbang.org Wed May 3 07:31:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 May 2006 07:31:00 -0600 (MDT) Subject: [Rxtx] Re: Concering ircomm and RXTX In-Reply-To: References: Message-ID: On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From legolas.w at gmail.com Wed May 3 08:46:23 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 19:16:23 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <4458C23F.2000003@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From legolas.w at gmail.com Wed May 3 13:10:57 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 23:40:57 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <44590041.80706@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From Lars.Hennig at wow-portal.com Thu May 4 00:39:15 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Thu, 4 May 2006 08:39:15 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: Message-ID: Hi, I could not find any solution. I therefore decided to to my own native implementation. Allthough it only supports the functions I need, it works pretty well now for me. I think the main problem there is the use of a wrong Windows API function and not setting an timeout. Regards, Lars Hennig W?rth Online World GmbH Tel. (0049)7181-258183 Mob. (0049)160-3522889 Fax. (0049)7940-153299 Lars.Hennig at wow-portal.com Gesendet von: rxtx-bounces at qbang.org 09.04.2006 10:42 Bitte antworten zu RXTX Developers and Users An d.herwald at dsh-elektronik.de, RXTX Developers and Users Kopie Thema Re: [Rxtx] USB Serialport - disconnection problems WV Proj./Teilpr.: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/7b39f374/attachment-0001.html From Pawan.Kharbanda at dot.state.co.us Thu May 4 11:00:58 2006 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Thu, 4 May 2006 11:00:58 -0600 Subject: [Rxtx] Dangling Lock Files Message-ID: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Hi, I have been using RXTX API's for the Serial Communication for quite some time now and for some of the devices we are opening and closing the connection every 2 minutes. This works great for few days and then suddenly I start seeing some "Port in Use Exception" and I see that the Lock files are still in the /var/lock folder after manually removing the lock files it works good for few hours and I see the same problem again. Can somebody explain me the scenarios why I am seeing the dangling Lock files? I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise Servers. Thanks Pawan Kharbanda -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/ba0e9261/attachment-0001.html From tjarvi at qbang.org Thu May 4 14:10:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:10:30 -0600 (MDT) Subject: [Rxtx] Dangling Lock Files In-Reply-To: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> References: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Message-ID: On Thu, 4 May 2006, Kharbanda, Pawan wrote: > Hi, > I have been using RXTX API's for the Serial Communication for quite > some time now and for some of the devices we are opening and closing the > connection every 2 minutes. This works great for few days and then > suddenly I start seeing some "Port in Use Exception" and I see that the > Lock files are still in the /var/lock folder after manually removing the > lock files it works good for few hours and I see the same problem again. > Can somebody explain me the scenarios why I am seeing the dangling Lock > files? > > I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise > Servers. Hi Pawan The next time it happens, look in the lockfile. There will be a pid. ps aux |grep 'pid' I think you will see that the application is still running for some reason. RXTX does a kill -0 on the pid to see if its alive. If not, it will remove the lockfile. So I suspect the previous program did not exit as you expected. -- Trent Jarvi tjarvi at qbang.org From Scott.Hughes at dalsemi.com Thu May 4 14:23:11 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 4 May 2006 15:23:11 -0500 Subject: [Rxtx] Wiki instructions... Message-ID: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire demo apps, when I stumbled across this tip on the wiki to add yourself to the uucp group: It may be simpler to just run usermod -G uucp jarvi Taken from: http://rxtx.qbang.org/wiki/index.php/Installation This does not work as advertised. I should have read the man page for usermod before I tried that out. If there are any groups which are not listed after the -G switch, the user is removed from those groups. On Ubuntu, this is bad... I removed myself from the Admin group, which removed my sudo priviledges. Ubuntu has no root account, so I've disabled the only account which could fix it. Anyone know of a good workaround? Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor From tjarvi at qbang.org Thu May 4 14:32:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:32:09 -0600 (MDT) Subject: [Rxtx] Wiki instructions... In-Reply-To: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> Message-ID: On Thu, 4 May 2006, Scott Hughes wrote: > I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire > demo apps, when I stumbled across this tip on the wiki to add yourself to > the uucp group: > > It may be simpler to just run > > usermod -G uucp jarvi > > Taken from: > http://rxtx.qbang.org/wiki/index.php/Installation > > This does not work as advertised. I should have read the man page for > usermod before I tried that out. If there are any groups which are not > listed after the -G switch, the user is removed from those groups. On > Ubuntu, this is bad... I removed myself from the Admin group, which removed > my sudo priviledges. Ubuntu has no root account, so I've disabled the only > account which could fix it. > > Anyone know of a good workaround? > Yikes This will get your permissions back: in grub/lilo/.. pass the following option to the kernel init=/bin/sh You are now root. when it boots, mount -o remount,rw / add yourself to the groups, reboot to get normal init going. Thats about all I can think of without sudo/root. -- Trent Jarvi tjarvi at qbang.org From Gettings at earth.utah.edu Thu May 4 14:41:22 2006 From: Gettings at earth.utah.edu (Paul Gettings) Date: Thu, 4 May 2006 14:41:22 -0600 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <20060504204122.GA6534@earth.utah.edu> When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get messages on stdout from the JVM: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 As the only change was the version of RXTX (from 2.1.6), I am unsure why the messages suddenly appeared. Anyone know how to get rid of them? Thanks. -- 101 USES FOR A DEAD MICROPROCESSOR (23) Dead cat brush From mmester at sps.edu Mon May 1 21:22:28 2006 From: mmester at sps.edu (Michael Mester) Date: Mon, 1 May 2006 23:22:28 -0400 Subject: [Rxtx] Windows PortInUseException Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> I'm trying to get simple serial communication going with RxTx under Windows XP. I can enumerate the ports fine, but I always run into problems when I try to open one. I get a PortInUseException, but the owner application is "Unknown" and the port is never open. I've tried this on several different systems and all of them give the same behavior. The only thing I can thiunk of that might be causing the problem is that fact that I had to put the serial .dll file in system32 instead of the reccommended folder, because it didn't work in the folder the documentation gives. The library loads fine, though, so I'm not sure whether that makes sense, and I don't know how to fix it anyway. Any help is greatly appreciated. Below is the output of the program, right up to the PortInUseException and the NullPointerException it causes (because the serial port object is not instantiated). C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI Starting GPSTalkerGUI... Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 gnu.io.PortInUseException: Unknown Application Exception in thread "main" java.lang.NullPointerException at GPSTalkerGUI.(GPSTalkerGUI.java:102) at GPSTalkerGUI.main(GPSTalkerGUI.java:161) Again, thank you very much for any help you can give. From lshellman at qwest.net Wed May 3 01:38:34 2006 From: lshellman at qwest.net (Lucious Shellman) Date: Wed, 03 May 2006 01:38:34 -0600 Subject: [Rxtx] Help needed: Project using parallel port Message-ID: <1146641914.8337.14.camel@localhost.localdomain> I was looking for a way to access the parallel port on a PC using Java. Searching the Internet, I came across this site (rxtx.org). What I am trying to do is detect logic levels from a TTL logic IC on the parallel port. I am not trying to do classic parallel port communication. I just want to detect whether a line(s) is (are) high or low. I am using Windows 98. Can rxtx be used to do this? If yes, is there a tutorial for using rxtx posted on the Internet that someone can direct me to. If you need more information, feel free to e-mail me. Unfortunately for me, I need the information ASAP. Thanks. lshellman at qwest.net From webmaster at egyhelp.com Wed May 3 18:43:39 2006 From: webmaster at egyhelp.com (Mohamed Samy) Date: Thu, 4 May 2006 02:43:39 +0200 Subject: [Rxtx] RE: Concering ircomm and RXTX In-Reply-To: Message-ID: <20060503184362.SM01044@Geek> Hey, I issue the command "modprobe ircomm-tty" yet no ttyircomm appears, while the ircomm appear by "modprobe ircomm" so forgive me but I am bit lost. Even searching google for the keyword "ttyircomm" only returns 3 matches. So any way I can start the ttyircomm???? Thanks a lot. -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Wednesday, May 03, 2006 3:31 PM To: Mohamed Samy; rxtx at qbang.org Cc: taj at www.linux.org.uk Subject: Re: Concering ircomm and RXTX On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 4 15:49:49 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 15:49:49 -0600 (MDT) Subject: [Rxtx] Windows PortInUseException In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> Message-ID: On Mon, 1 May 2006, Michael Mester wrote: > > I'm trying to get simple serial communication going with RxTx under > Windows XP. I can enumerate the ports fine, but I always run into > problems when I try to open one. I get a PortInUseException, but the > owner application is "Unknown" and the port is never open. I've tried > this on several different systems and all of them give the same > behavior. The only thing I can thiunk of that might be causing the > problem is that fact that I had to put the serial .dll file in system32 > instead of the reccommended folder, because it didn't work in the folder > the documentation gives. The library loads fine, though, so I'm not sure > whether that makes sense, and I don't know how to fix it anyway. Any > help is greatly appreciated. Below is the output of the program, right > up to the PortInUseException and the NullPointerException it causes > (because the serial port object is not instantiated). > > C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI > Starting GPSTalkerGUI... > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > gnu.io.PortInUseException: Unknown Application > Exception in thread "main" java.lang.NullPointerException > at GPSTalkerGUI.(GPSTalkerGUI.java:102) > at GPSTalkerGUI.main(GPSTalkerGUI.java:161) > Perhaps you are trying to open the port twice in your code? rxtx does open the ports, do a timed out read and then close the ports during enumeration. I think the port is being opened fine. The Unknown Application is always reported. On linux, there is some code that finds the actual application but on windows, its always unknown. If the port enumeration is returning the ports you expect, rxtx has opened the port and closed it with success. The port should open. There is also example code in the contrib directory that comes with rxtx source that has examples you can modify to work. -- Trent Jarvi tjarvi at qbang.org From Christian.Klemke at t-online.de Thu May 4 23:37:23 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Fri, 5 May 2006 07:37:23 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu> Message-ID: <004f01c67005$fc72fee0$016a10ac@NB600> Hi Paul, I was wondering about the same question some days ago and took a look at the source files. Unfortunately, I found that you can only get rid of that messages by altering and recompiling the Java code. There is a final static boolean variable called "devel" in the file "RXTXCommDriver.java" which is set to "true". This constellation causes the output after the native libraries have been loaded. No mechanism exists to suppress them otherwise :-(. Trent, does that mean that 2.1.7 is still officially a "development" version ? When will this value be changed to "false" by default ? With 2.1.8 ? It would be nice to provide a means to suppress such messages besides that static flag (maybe by setting a property called "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The output can indeed by annoying, especially when used with console applications, where the message potentially appears "in the middle" of your own output. Another possibility would be not to use System.out directly, but instead some PrintStream field which is initially set to System.out but can programatically be changed. That would allow for any kind of redirection or suppression by implementing appropriate user-defined PrintStream subclasses and making RXTX use that stream. What do you think ? Best regards, Christian ----- Original Message ----- From: "Paul Gettings" To: Sent: Thursday, May 04, 2006 10:41 PM Subject: [Rxtx] RXTX causing stdout messages > When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get > messages on stdout from the JVM: > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > As the only change was the version of RXTX (from 2.1.6), I am unsure > why the messages suddenly appeared. Anyone know how to get rid of > them? > > Thanks. > > -- > 101 USES FOR A DEAD MICROPROCESSOR > (23) Dead cat brush > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri May 5 06:09:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 06:09:46 -0600 (MDT) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <004f01c67005$fc72fee0$016a10ac@NB600> References: <20060504204122.GA6534@earth.utah.edu> <004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: On Fri, 5 May 2006, Christian Klemke wrote: > Hi Paul, > > I was wondering about the same question some days ago and took a look at the > source files. Unfortunately, I found that you can only get rid of that > messages by altering and recompiling the Java code. There is a final static > boolean variable called "devel" in the file "RXTXCommDriver.java" which is > set to "true". This constellation causes the output after the native > libraries have been loaded. No mechanism exists to suppress them otherwise > :-(. > > Trent, does that mean that 2.1.7 is still officially a "development" version > ? When will this value be changed to "false" by default ? With 2.1.8 ? It > would be nice to provide a means to suppress such messages besides that > static flag (maybe by setting a property called > "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The > output can indeed by annoying, especially when used with console > applications, where the message potentially appears "in the middle" of your > own output. Another possibility would be not to use System.out directly, but > instead some PrintStream field which is initially set to System.out but can > programatically be changed. That would allow for any kind of redirection or > suppression by implementing appropriate user-defined PrintStream subclasses > and making RXTX use that stream. What do you think ? > A patch for using properties would be accepted I'm sure. The reason the default is to display the message is not related to the development state of rxtx anymore. The problem is that people first using rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. The message prevents a great deal of email thats easily explained by the message. I question if we should support rxtx 2.0 at all anymore. If you post a patch in bugzilla, we'll put it into CVS this weekend. we'll be going through and doing such things anyhow. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri May 5 13:23:56 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 13:23:56 -0600 (MDT) Subject: [Rxtx] How to read from RxTx parallel port in Win XP In-Reply-To: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> References: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> Message-ID: On Thu, 27 Apr 2006, Worsley, Bob (Development Engineer) wrote: > I'm sorry if this is a dumb question, but I didn't find the answer in > the archives. > > I'm using the RxTx binaries for Windows on a reasonably current notebook > PC running Windows XP. I can send stuff to a printer on the parallel > port (LPT1), but I can't get anything back. > > I wrote a class that has the methods listed below. I write some data to > the printer with the "write" method and then try to read a response > using the "read" method, but I never get any data. I'd greatly > appreciate any help you can give! > > Bob Worsley > bobwoyid2 at yahoo.com > > > > > private ParallelPort parallelPort = null; > private RXTXCommDriver parallelPortDriver = null; > > > public boolean initialize() throws IOException { > if (parallelPort != null) { > return false; // Already initialized > } > > // Create the parallel port; > parallelPortDriver = new RXTXCommDriver(); > parallelPort = > (ParallelPort)parallelPortDriver.getCommPort(address, > CommPortIdentifier.PORT_PARALLEL); > > // Set the parallel port parameters. > try { > parallelPort.enableReceiveTimeout(READ_TIMEOUT); > parallelPort.disableReceiveFraming(); > parallelPort.disableReceiveThreshold(); > //parallelPort.setMode(mode); !!!!errors > } catch (UnsupportedCommOperationException e) { > throw (new IOException("Parallel port with address '" + > address > + "' cannot be configured as specified")); > } > > return true; > } > > > > public void write(final byte[] bytes) throws IOException { > initialize(); > while (busyReading) { > Thread.yield(); > } > busyWriting = true; > if (bytes.length < 1) { > return; > } > OutputStream outputStream = parallelPort.getOutputStream(); > outputStream.write(bytes); > outputStream.flush(); > outputStream.close(); > Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); > busyWriting = false; > } > > > public byte[] read() throws IOException { > > // Read up to MAX_BYTES bytes. > initialize(); > while (busyWriting) { > Thread.yield(); > } > busyReading = true; > byte[] buff = new byte[MAX_BYTES_READ]; > InputStream inputStream = parallelPort.getInputStream(); > // This read blocks until input data is available > int bytesRead = inputStream.read(buff); > inputStream.close(); > // If no data read, create empty array > if (bytesRead == -1) { > bytesRead = 0; > } > byte[] deviceBytes = new byte[bytesRead]; > System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); > if (bytesRead > 0) { > Debug.p("PPIOP.read - got data: '" + new > String(deviceBytes) + "'"); > } > busyReading = false; > return deviceBytes; > } > Hi Bob I've only used rxtx to test a hello world page printing but there are others that have used it. PPIOP? hmm what is this? :) The rxtx parallel support is behind the serial support but should be OK. As you note, the setting of modes is not supported. rxtx uses what is provided when the port is open. Are your asserting the pin for the printer being online? I suspect what often happens is people try to just use the data pins but the C API rxtx uses wants the printer to be online. There should be some posts relating to this in the rxtx mail-list archive. Some APIs are probably reading and writing from the port address (also suggested in your code as something you are looking at). RXTX currently uses a higher level C/C++ API for port access. This can still work if the API thinks the 'printer' is there. -- Trent Jarvi tjarvi at qbang.org From agrodellic at gmail.com Sat May 6 08:39:40 2006 From: agrodellic at gmail.com (Leigh Stewart) Date: Sat, 6 May 2006 10:39:40 -0400 Subject: [Rxtx] sun commapi 3 Message-ID: I think I read here: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html that rxtx-2.0 is basically fracked for now? Does anyone know of a workaround? ie can i somehow get an older version of sun's comm api and use that (not easy to find)? i mean 2.0 must be working for someone...how is it being tested. 2.1 isnt working for me....im getting nasty native exceptions etc, which is why im so set on 2.0... any ideas? From tjarvi at qbang.org Sun May 7 15:40:27 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 7 May 2006 15:40:27 -0600 (MDT) Subject: [Rxtx] sun commapi 3 In-Reply-To: References: Message-ID: On Sat, 6 May 2006, Leigh Stewart wrote: > > 2.1 isnt working for me....im getting nasty native exceptions etc, > which is why im so set on 2.0... any ideas? > Hi Leigh What native exceptions are you seeing? Which OS? The native code is almost identical between rxtx 2.0 and 2.1. Only the names have been changed to protect the inocent. :) ie: javax_comm_... vs gnu_io_... So the odds are very likely that even if you do find commapi 2.0 and get it installed, you will run into the same error. It would be better to just find and fix the problem. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Mon May 8 10:47:20 2006 From: mail at willicon.de (WILLICon) Date: Mon, 08 May 2006 18:47:20 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 Message-ID: <445F7618.3070303@willicon.de> Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/ef37e8ec/attachment-0001.html From tjarvi at qbang.org Mon May 8 16:14:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 May 2006 16:14:51 -0600 (MDT) Subject: [Rxtx] Screenshot of Application using RXTX (fwd) Message-ID: Just though someone may end up searching for 0x0D and 0x0A. Here are the details from his system. SuSE Linux 10.0 (x86_64) Kernel 2.6.13-15.8 j2se 1.4.2_11 (i586) Sun: comm3.0_u1 rxtx: rxtx-2.1-7 ---------- Forwarded message ---------- Date: Sat, 6 May 2006 20:01:46 +0200 From: Michael Poppitz To: taj at www.linux.org.uk Subject: Screenshot of Application using RXTX Hi Trent, the rxtx package works like a charm. Sun's package seemed to replace all 0x0D with 0x0A in received data on my Linux box, which is really annoying when transfering binary data. But rxtx came and saved the day - and turned out to be a lot more convenient as it does not require a configuration file. I use it for connecting to a home made logic analyzer. (http://www.sump.org/projects/analyzer/) Thanks for your great job, Michael -------------- next part -------------- A non-text attachment was scrubbed... Name: la_client.png Type: image/png Size: 16592 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/45494fbb/la_client-0001.png From tjarvi at qbang.org Tue May 9 14:56:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 May 2006 14:56:05 -0600 (MDT) Subject: [Rxtx] RXTX javax.comm: which one to install? In-Reply-To: <20060509161742.43547.qmail@web53814.mail.yahoo.com> References: <20060509161742.43547.qmail@web53814.mail.yahoo.com> Message-ID: On Tue, 9 May 2006, Adenilson Cavalcanti wrote: > Dear Trent Jarvi > > I'm trying to write a small Java app running in linux that interfaces with a device connected to serial port. > > I do have some questions about RXTX and javax.comm state of affairs, since I'm new to Java programming (used to program in plain old C writting to devices using termios and open/write/read syscalls, but this is another story). > > I ask you the favor to clarify this issues (if possible...): > > a) Sun offers to download a file (comm3.0_u1_PUTAUNIXVERSION.zip) which does contain .so files. Does it work out of box? > > b) Case negative, its there that we should use 'librxtx*.so' provided by your site? > > c) Sun's comm3 API version does work with which version of rxtx? > > I already searched google and read documentation available in rxtx site ("Java Comm Serial API How-to") but still have this issues unsolved. Any help will be appreciated. > > Best regards > > Adenilson Hi Adenilson, RXTX does not currently support javax.comm in Sun's CommAPI 3.0. I would recommend using package gnu.io provided by rxtx 2.1. -- Trent Jarvi tjarvi at qbang.org From chris.develder at intec.ugent.be Wed May 10 08:45:40 2006 From: chris.develder at intec.ugent.be (Chris Develder) Date: Wed, 10 May 2006 16:45:40 +0200 Subject: [Rxtx] rxtx troubles on ARM Message-ID: <4461FC94.6040909@intec.ugent.be> Hi all, Sorry to bother you, but I don't seem to get RXTX working on an ARM processor (xscale ixp 425, big endian). I managed to crosscompile the rxtx libs and moved it over to the ARM. Using jamvm (which is the only open source java VM we got working on the ARM), I get the following error result when running SimpleRead from Sun's javax.comm examples (commapi\examples\Simple\SimpleRead) -- see bottom of mail for complete output: "java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver" However, output shows that the RXTXCommDriver code is accessible (cf. debug and devel output of lib versions). So it doesn't seem to be a missing lib/jar issue. The error happens before RXTXCommDriver.initialize() is called, since the first line there is System.out.println("RXTXCommDriver:initialize()"); Any ideas? Cheers, Chris ---------------------------- [root at xxx(ttyp1) /work/cdvelder/xscale/test]# jamvm -Djava.library.path=/work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/jre/lib/arm -classpath /work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/lib/ext/RXTXcomm.jar:./comm.jar:. SimpleRead RXTXCommDriver {} Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTXCommDriver: Jar version = RXTX-2.1-7 native lib Version = RXTX-2.1-7 java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver gnu/io/RXTXCommDriver at javax.comm.CommPortIdentifier.loadDriver (CommPortIdentifier.java:239) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:109) at SimpleRead.main (Unknown Source) java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive (Native Method) at com.sun.comm.Portmapping.registerCommPorts (Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase (Portmapping.java:100) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:138) at SimpleRead.main (Unknown Source) From joachim at buechse.de Fri May 12 00:44:48 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 08:44:48 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) Message-ID: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Good day, I guess that only a selected few (hi Trent) will be able to answer this question, but the answer might be interesting for anyone trying to debug or understand the code. Apparently the MonitorThread is started and stopped in RXTXPort.addEventListener and RXTXPort.removeEventListener. This would indicate that (originally?) the MonitorThread is only required when there is an EventListener. However the MonitorThread is also started in the RXTXPort constructor, which could mean that RXTX won't work at all if it isn't there. It seems to me, that if anyone would add an event listener and later on remove it, he could potentially wreak the port. Because the second action would kill the MonitorThread. For the moment I am only trying to understand the role of and idea behind the MonitorThread. But of course there is a deeper reason thor my question: If the MonitorThread needs to exist anyway, it could be the thread that cleans up the port (ie calls nativeClose) - this would eliminate (a further) problem I am seeing with some USB drivers on Mac OSX. (Close blocks (after releasing the tty, but still) in the USB driver if the device is "not responding"). Greetings, Joachim From tjarvi at qbang.org Fri May 12 07:10:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 12 May 2006 07:10:59 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Fri, 12 May 2006, Joachim Buechse wrote: > Good day, > > I guess that only a selected few (hi Trent) will be able to answer > this question, but the answer might be interesting for anyone trying > to debug or understand the code. > > Apparently the MonitorThread is started and stopped in > RXTXPort.addEventListener and RXTXPort.removeEventListener. This > would indicate that (originally?) the MonitorThread is only required > when there is an EventListener. However the MonitorThread is also > started in the RXTXPort constructor, which could mean that RXTX won't > work at all if it isn't there. > > It seems to me, that if anyone would add an event listener and later > on remove it, he could potentially wreak the port. Because the second > action would kill the MonitorThread. > > > For the moment I am only trying to understand the role of and idea > behind the MonitorThread. But of course there is a deeper reason thor > my question: > > If the MonitorThread needs to exist anyway, it could be the thread > that cleans up the port (ie calls nativeClose) - this would eliminate > (a further) problem I am seeing with some USB drivers on Mac OSX. > (Close blocks (after releasing the tty, but still) in the USB driver > if the device is "not responding"). > Hi Jaochim Before commapi, rxtx did not support events. You could read, write and change port settings. The MonitorThread was added as an afterthought to support commapi events. So the way things are now his historical spaghetti not a well devised plan. It is my opinion that the MonitorThread should exist as long as the port is open. The odd starting of the thread in the constructor and addEventListener was just to get past the obvious problem of people using the port without adding listeners. -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Fri May 12 07:59:50 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 15:59:50 +0200 Subject: [Rxtx] MonitorThread -> ChangeRequest In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: <2B1E508C-8CEE-4AB7-914D-E7BA25C871A2@buechse.de> In this case I suggest removing the starting/stopping of MonitorThread in addEventListener / removeEventListener. This should not affect existing projects. On 12.05.2006, at 15:10, Trent Jarvi wrote: > It is my opinion that the MonitorThread should exist as long as the > port > is open. The odd starting of the thread in the constructor and > addEventListener was just to get past the obvious problem of people > using > the port without adding listeners. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Fri May 12 11:43:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 19:43:21 +0200 Subject: [Rxtx] Spring Cleaning - some suggestions Message-ID: The current implementation of RXTX contains quite a lot of code that will break if it is used from several threads (especially on a multi processor machine). I think it would be nice to clean this up. I suggest the following changes (which keep the current semantics and should not influence existing projects in a negative way): - InterruptedException will never be ignored or reset - read methods will be protected with a Monitor - write methods will be protected with a (separate) Monitor - close() sets the read and write monitors into a "closed" state which will lead to IOExceptions for any following call to RXTXPort.read/write. - close() will wait a finite amount of time (maybe 500ms) for the release of the read and write monitors after that, it will trigger the closing of the file descriptor to abort any pending read or write. - close() will not call close(file_desc). Instead it will "interrupt" (ie set a flag and then, pthread_kill(ABRT)) the MonitorThread, the MonitorThread will call close(file_desc). - the monitors are properly released in a finally block the try of which starts directly after obtaining the monitor. - finally will not call close(file_desc) it will only "interrupt" the MonitorThread (see above) - the native-code (esp read) does not use SA_RESTART but checks Thread.interrupted() when it receives a SIGNAL (ie system call returns with EINTR or other signalling method). The read/write monitors will be allocated from a factory whose mode can be set to fast/normal/advanced. In fast-mode it will create "non thread safe, non synchronized" pseudo-monitors. In default mode, the monitors will store the owning thread. In "advanced" mode setting the monitors into closed state will "interrupt()" threads which are blocked in a native read/write. {Reasoning close behaviour: Calling close on a file descriptor in Windows unblocks any read() or write() on the same file descriptor with an error. On Solaris < 2.7 and MacOS X however the close() will/ can block - until the read or write have finished:-(( Even the JDK people have trouble with this. I dont know how Linux reacts in this case. The best practice for BSD/Solaris is to send a signal to the thread which will usually unblock the read/write with an EINTR - this however is not guarenteed as it also depends on the device driver. So the only resolution that will certainly not block the thread calling RXTXPort.close() (which will often enough be the AWT event dispatcher or the VM finalizer thread) is to call close(fd) from another thread.} {Reasoning read behaviour: It is rather uncommon to receive a signal while reading or writing - it will happen, but checking Thread.interrupted() when it happens will not degrade performance. The checking of Thread.interrupted() can be handled by returning to Java and potententially reentering into the native code if the thread was not interrupted or by calling back into the VM from the native code. On top of this, many functions like read(byte[]) or read(byte [], int, int) are allowed to return less than the requested amount of data. Only int read() is a bit more tricky. } [Trent: From the code I can tell, that you experimented quite a bit with signals. Do you know if the Java Thread.interrupt() triggers a unix signal on Linux/Solaris? If so, which one?? References: - http://java.sun.com/docs/hotspot/VMOptions.html - http://www.hp.com/products1/unix/java/infolibrary/prog_guide/ signals.html ] On OS X (hotspot client jdk-1.4.2) I did not see any signal propagated to the SELECT of the event_loop/MonitorThread (ie no EINTR) when I call monThread.interrupt(). This is a pitty, but thats the way it is. I simply assume this is true for most system calls. How to handle this? Of course it would be possible to install/ deinstall a specific signal handler before/after every native read and to natively send an ABRT signal if RXTXPort.close is called. A more elegant solution might be to have an additional "signaling" socket which is always included in the SELECT. Or the simplest solution: cap the timeout of the select to 500 ms (the loop around it exists already) after every timeout check the Thread.interrupted() flag. From a performance perspective this should be completely invisible... On the other hand, all write() calls need to be preceeded by a SELECT as well, to avoid running into a blocking write. Best regards, Joachim From lyon at docjava.com Sat May 13 05:54:52 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 13 May 2006 07:54:52 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Dmitry suggests that we acquire an implementation of a serial port reference, use it, then release it (i.e., check it back in). Joachim says that making serial ports thread friendly might be a good idea. This is a good idea. The design pattern that is close to this idea is the "Object Pool Design Pattern". # Object Pool Manage the reuse of objects for a type of object that is expensive to create or only a limited number of a kind of object can be created. It has been described at: http://www.developer.com/java/ent/article.php/626171 and in Marks' book, Patterns in Java, Volume 1. However, the Object Pool is intended to pool objects so that each object is just like every other object. The intent of the Parametric Singleton is to enable others to access the same resource at the same time (as long as the same parameters were used in construction). It sounds like we need a NEW Design Pattern (Oh no, Doug is doing it again!). Yes friends, you got me on a role (roll) :) If you like design patterns, you can thank me later. If you don't like design patterns, blame Dmitry, it was his idea ;) And Dave, thanks for the feedback on Singleton abuse. It has led me to change the way I think about application contexts, which we will see, below. We need (drum roll please): The Parametric Object Pool Design Pattern (POP) By Douglas A. Lyon ABSTRACT The goal of the Parametric Singleton design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values, in a given context. In comparison, the goal of the POP design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values and that only one reference to the class is checked out at a time, in a given context. A context is a namespace for holding identifiers during execution. In Java, A context can be changed in any of several ways. For example, creation of a new class loader, the deserialization of an old POP or the creation of a new process all create a new namespace. The POP Design Pattern combines the Parametric Singleton Design Pattern with the check out mechanism of the Object Pool Design Pattern. This enables unique creation of instances of a class. These instances are cached in a table. When a clients asks for an instance with these parameters, the cache is checked. If the instance is not in the cache it is created. If the instance is available, the clients checks out the instance. A reference is left to the clients that checked out the instance. The POP has the role of creating objects uniquely, from parameters. It also has the role of keeping track of which clients has checked out a given object. This is just like a library keeping track of who borrowed a book. If a resource is left unavailable in a system, a deadlock can occur. Deadlock debugging is facilitated by mapping a resource to the clients that have checked it out. We apply our POP Design Pattern to the retrieval of serial ports. The goal of our system is to make sure that serial ports are checked out to only one client at a time, and that they be checked back in when the client is done. The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. Users are discouraged from calling this the Parametric Object Oriented Pool (POOP). Introduction The intent of the POP Design Pattern is to ensure that a class has only one instance for a given set of parameter values. It also provides a point of access that is global to a given context. The POP uses the Singleton Design Pattern to ensure that there is only one POP, in the given context. The POP DP is responsible for checking out a reference to a given instance, and keeping track of that instance. The instance is responsible for sharing that instance. POP requires that users of the DP implement an interface that enables a recall facility. Thus, if there is a contention for a consumed resource, the deadlock can be resolved in an orderly fashion. Motivation A system cannot tolerate multiple instances of some classes with identical parameters used by different instances at the same time. For example, you cannot have two instances use the same serial port, at the same time. You cannot have two instances that are trying to listen to the same socket connection. You cannot have two instances writing to the same file structure at the same time. Further, once a serial port is checked out by a client, it is assigned to the client. This is like the spin-lock service provided by the operating system, only in the application layer. Naturally, deadlock will occur if a resource is not released, therefore the client of the resource is tracked. Recalling a resource is required for the POP DP by virtue of the implementation of an interface. The policy on how to break a deadlock (by honoring the recall) is application specific. As the operating system is often thought of as the arbiter of consumed resources (i.e., tape drives, serial ports, etc.) we frequently leave it to an operating system implementation to resolve these contention issues. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on naming conventions (which are not well standardized). The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. The POP Design Pattern can take on the role of the peer method mapper that homogenizes the API for different operating environments. That is, it can wrapper the different locking mechanisms used in different operating systems. POP that is responsible for keeping track of the instances created and the client that has checked them out. The POP Design Pattern is implemented using the Singleton Design Pattern. In Java, the POP implementation is declared final, so that it cannot be subclassed. The class also has a private constructor, so that other classes cannot instance it. The new design pattern is called the POP design pattern and it provides a way to check out and create instances with given parameters. Applicability Use the POP Design Pattern when: 1. There must be exactly one instance of a class with the given parameters in a given context. 2. The instances must be accessible to clients from a well-known access point. 3. The instances are reusable. 4. Only one client can check out an instance at a time. Structure Insert UML diagram here. Participants The POP Clients that need instances 1. The POP defines an instance upon request from a client, if, and only if, the instance does not already exist. 2. The POP returns the instance to the client. 3. The POP is responsible for creating unique instances from given parameters. 4. The POP is responsible to recalling instances from clients. Collaborations Clients obtain a reference to a POP instance only through the singleton design pattern. If the POP instance is left in an improper state (e.g., the serial port was left open) it is NOT the role of the POP to close the IO port. However, the POP can be requested to get the instance released. Nor is it the role of the POP Design Pattern to open the port. That role is delegate to some other part of the system. Further, it is the role of the POP Design Pattern to check out resources. However, it is still possible to have, multiple threads that have multiple references to the same resource at the same time. Checkout and resource requests are MUTEX locked (i.e., synchronized). Consequences The POP Design Pattern has several benefits: 1. Controlled access to parametrically defined instances. Since the POP encapsulates its instances, there is some limited control over how and when clients access it. 2. Reduced name space. The POP pattern avoids global variables that store instances created from the same parameter. Implementation Here are implementation issues to consider when using the POP pattern: 1. Unique mapping of parameters. The POP pattern requires that there be a mean to isomorphically map the parameter space into the instance space and back again. 2. Ensure unique instances. The POP pattern makes unique instances from parameters, and it does so only once. 3. Cache instances for fast retrieval. The POP must be able to look up instances, given some set of parameters, and do so from some data structure. That is, there must be enough space to hold references to all the instances the program will need. Also, a mechanism is needed to look up and retrieve the instances quickly enough to satisfy the clients. Sample Code To be written....any volunteers? Thanks! - Doug >I don't think I get it > >On Mar 22, 2006, at 9:36 AM, David Garnier wrote: >>Using the singleton pattern in this case is >>just convenient for the programmer. Problems >>arises >>pretty quickly, especially if you attempt to unit-test your classes. > > >so you're saying that something isn't so good >because you can not test it in the convenient >way? >if that's true, I'm totally disagree >change your test, debug whatever, but if >software is efficient at runtime, works fine and >only problem is some unit test >(which is some kind of framework for testing) >then dump that unit test , dump that unit >framework and make something appropriate to the >software >you're testing > >so if Douglas want to use singletons, what's the problem? >and what do you mean by abusing of singleton usage? > >of course singleton doesn't prevent concurrent >access to the resource across the processes >unless >you're using some OS facility to prevent it, besides >singleton as it was introduced is relevant only >and only inside of the same process >otherwise it's not singleton it's something else >(let's say network singleton: so you have remote >invocation facility >and some factory method that return object created by that facility) > >I don't have any problem with using any kind of singletons. > Parametric Singleton idea (if I understand it >right) could be easily implemented in the >following way: >use a map >populate map with instances of some class and key is your parameter >(you can use lazy population too) > >if somebody ask the key check the value if it's null so resource is taken >if somebody returns the resource put it back to the map > >public synchronized static Object getSomeResource(Object parameter); >public synchronized static void returnResource(Object parameter); > >getSomeResource (inside of the same process) could return null in 2 cases >1. if somebody (from other thread for example) already took that resource >2. if OS API said that resource corresponded to >that parameter (serial port with parameter = 1 >(port #)) >is locked and unavailable; >I'm not sure that in case of serial ports we >even need those Parametric Singletons >(unless lock checking is a very expensive operation) >just ask the OS about availability of that >resource and if it's available give it away >and then OS will lock it and therefore in next >time somebody ask it just answer that resource >is locked >and return null > >for example system has 2 serial ports available >so I ask getResource("tty"); >or I ask getResource("Bluetooth-Modem"); > >and if OS is ok you can give tty or Bluetooth-Modem or both > >no need for any additional pattern I think > >back to the problem >mac os x doesn't recognize locking via files, so >it handles locking via some API >an instance of the singleton in each process >should recognize that resource is locked >(by using that API) that's all >we don't have to make things more complicate >then they are just because there is some nice >design pattern or nice unit test framework or whatever >keep things simple, make them work fast, don't introduce middle layers >unless you have really good reason to do so > >of course I could be entirely wrong, so sorry about that in advance > >thanks > > >Dmitry Markman > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx >Good day, > >I guess that only a selected few (hi Trent) will be able to answer? >this question, but the answer might be interesting for anyone trying? >to debug or understand the code. > >Apparently the MonitorThread is started and stopped in? >RXTXPort.addEventListener and RXTXPort.removeEventListener. This? >would indicate that (originally?) the MonitorThread is only required? >when there is an EventListener. However the MonitorThread is also? >started in the RXTXPort constructor, which could mean that RXTX won't? >work at all if it isn't there. > >It seems to me, that if anyone would add an event listener and later? >on remove it, he could potentially wreak the port. Because the second? >action would kill the MonitorThread. > > >For the moment I am only trying to understand the role of and idea? >behind the MonitorThread. But of course there is a deeper reason thor? >my question: > >If the MonitorThread needs to exist anyway, it could be the thread? >that cleans up the port (ie calls nativeClose) - this would eliminate? >(a further) problem I am seeing with some USB drivers on Mac OSX.? >(Close blocks (after releasing the tty, but still) in the USB driver? >if the device is "not responding"). > >Greetings, >Joachim > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Sat May 13 10:07:37 2006 From: joachim at buechse.de (Joachim Buechse) Date: Sat, 13 May 2006 18:07:37 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Douglas, Looking at the current code, leaves me with the feeling, that there is a lot to do. Defining an API that wraps javax.comm to provide what you describe is certainly possible, but I wonder how much benefit it will actually provide. Personally I think the API defined by javax.comm "request/lock" a port with: cp= new CommunicationPort(identifier) "release" a port with: cp.close(); works quite nice for 99% of the applications. In my experience, the most efficient and elegant implementation is to wrap a port/socket/.. into a business object which declares the remote operations that are possible. Ie "uploadFile", "waitForPrompt", "getSerialNumber", "sendContact", "executeCommand", etc Those methods are then either synchronized or guarded by a monitor. I do not see how your design pattern applied to the port resource would help implementing this. [details start, skip if you agree to the above] When I talked about "thread-safe" I didn't mean several independent "sessions" accessing the port concurrently. I think this is a very rare usage. I believe the most common use case for serial ports today is the control of an external device from a PC running a GUI based application. To implement a clean Swing/AWT-GUI one needs to pass any action that can block to a "worker" thread (else the GUI blocks, the application appears dead). While it is possible to use own prespawned thread that will accept Runnables which operate on the port, this is not very elegant. It is more common to spawn a new thread for every action triggered by the user. Additionally the ABORT of a running operation is often implemented via a port.close() delegated to a different thread. - During the lifetime of a port, it will usually be accessed from several different threads. Instance variables need to be set/read in synchronized regions to guarantee a correct operation based on the Java memory model. - Synchronizing the access is usually handled on the application level (synchronizing the reads/writes is usually useless from the applications view because it is not a transaction mechanism). [details end] I am very open to learn about other scenarios where your proposed design pattern applied to the port resource is beneficial to the application implementor. Best regards, Joachim On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > Dmitry suggests that we acquire an implementation of > a serial port reference, use it, then release it (i.e., check it > back in). > > Joachim says that making serial ports thread friendly might be a > good idea. > > This is a good idea. The design pattern that is close to this idea > is the "Object Pool Design Pattern". > # Object Pool From jredman at ergotech.com Sun May 14 14:28:24 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 14:28:24 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers Message-ID: <446792E8.4000506@ergotech.com> Does anyone know of any work to make RXTX work with Ethernet (telent) Terminal Servers? If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? We've used RXTX with upwards of 100 virtual COM ports on Windows and it works well. Linux is more problematic. It would be good to have an OS independent solution to accesses remote Ethernet serial ports. Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From legolas.w at gmail.com Sun May 14 14:26:34 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:56:34 +0430 Subject: [Rxtx] does any one have a working sample of RXTX and LPT port Message-ID: <4467927A.4000008@gmail.com> Hi Thank you for reading my post does any one has a working sample for RXTX and LPT port ? Thanks From legolas.w at gmail.com Sun May 14 14:27:29 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:57:29 +0430 Subject: [Rxtx] does RXTX support Trigerr on parallel port? Message-ID: <446792B1.4040905@gmail.com> Hi does RXTX support trigger on LPT port ? if so , how i can use it ? Thanks From tjarvi at qbang.org Sun May 14 17:40:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 17:40:59 -0600 (MDT) Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: <446792E8.4000506@ergotech.com> References: <446792E8.4000506@ergotech.com> Message-ID: On Sun, 14 May 2006, Jim Redman wrote: > Does anyone know of any work to make RXTX work with Ethernet (telent) > Terminal Servers? > > If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 > Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? > Hi Jim It appears the author of NVTCom has decided to release the library into the public domain. Integration with rxtx is possible but it would be best to contact the author and find out what his intent is. I would suggest contacting the author with a proposal of what you would like to do and take it from there. We could 'take' public domain software but its better to show respect to the authors and respect their wishes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:10:23 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:10:23 -0600 (MDT) Subject: [Rxtx] does any one have a working sample of RXTX and LPT port In-Reply-To: <4467927A.4000008@gmail.com> References: <4467927A.4000008@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > Thank you for reading my post > does any one has a working sample for RXTX and LPT port ? > Thanks Hi Legolas LPT port support in rxtx is spotty. That means some people have sent in patches for what they do and it works well for them. The original code was not very good. It may have been 3 hours work :/ To get started, Sun has some demo programs with their commapi. With rxtx 2.1 you can change their code from using javax.com to gnu.io and it -should- work. But if it does not you can post here and on bugzilla. There has been more interest lately off the list and maybe there will be enough community resources to get what you need going. If you do get a sample program together, we would gladly put it in the contrib directory so the next person can get things going faster. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:12:12 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:12:12 -0600 (MDT) Subject: [Rxtx] does RXTX support Trigerr on parallel port? In-Reply-To: <446792B1.4040905@gmail.com> References: <446792B1.4040905@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > does RXTX support trigger on LPT port ? > if so , how i can use it ? > Hi Legolas As mentioned in the previous post, rxtx parallel support is not very mature. But if you can point to something that describes the trigger feature, we can probably make sure its there and give a quick code example. -- Trent Jarvi tjarvi at qbang.org From jredman at ergotech.com Sun May 14 22:22:48 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 22:22:48 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: References: <446792E8.4000506@ergotech.com> Message-ID: <44680218.4080008@ergotech.com> Trent, Trent Jarvi wrote: > On Sun, 14 May 2006, Jim Redman wrote: > >> Does anyone know of any work to make RXTX work with Ethernet (telent) >> Terminal Servers? >> >> If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 >> Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? >> > > Hi Jim > > It appears the author of NVTCom has decided to release the library into > the public domain. Integration with rxtx is possible but it would be best > to contact the author and find out what his intent is. > > I would suggest contacting the author with a proposal of what you would > like to do and take it from there. We could 'take' public domain software > but its better to show respect to the authors and respect their wishes. > I sent Marco(?), the author of the library, a note before asking the list - I'll let you know the response. If anyone is already working on it, or has an interest and more time and energy than me, I'd hate to duplicate the efforts. If no one is, and no one objects, maybe I'll see what I can do. Jim > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From Christian.Klemke at t-online.de Mon May 15 02:23:06 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Mon, 15 May 2006 10:23:06 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu><004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: <008a01c677f8$cae18590$02fea8c0@NB600> Hi Trent, Hi Paul, I finally found some time to create a simple patch to enable the optional suppression of version output to the console. It is based on a new system property called "gnu.io.rxtx.NoVersionOutput" which can by set to "true" if necessary. I had some problems accessing CVS, therefore I downloaded the rxtx-2.1-7r2 source archive from ftp.qbang.org (which is linked on the rxtx.org download page) and worked with that release. Please find my proposed patch in the attachment ! Regards, Christian ----- Original Message ----- From: "Trent Jarvi" To: "RXTX Developers and Users" Cc: ""Paul Gettings"" Sent: Friday, May 05, 2006 2:09 PM Subject: Re: [Rxtx] RXTX causing stdout messages > On Fri, 5 May 2006, Christian Klemke wrote: > >> Hi Paul, >> >> I was wondering about the same question some days ago and took a look at >> the >> source files. Unfortunately, I found that you can only get rid of that >> messages by altering and recompiling the Java code. There is a final >> static >> boolean variable called "devel" in the file "RXTXCommDriver.java" which >> is >> set to "true". This constellation causes the output after the native >> libraries have been loaded. No mechanism exists to suppress them >> otherwise >> :-(. >> >> Trent, does that mean that 2.1.7 is still officially a "development" >> version >> ? When will this value be changed to "false" by default ? With 2.1.8 ? It >> would be nice to provide a means to suppress such messages besides that >> static flag (maybe by setting a property called >> "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The >> output can indeed by annoying, especially when used with console >> applications, where the message potentially appears "in the middle" of >> your >> own output. Another possibility would be not to use System.out directly, >> but >> instead some PrintStream field which is initially set to System.out but >> can >> programatically be changed. That would allow for any kind of redirection >> or >> suppression by implementing appropriate user-defined PrintStream >> subclasses >> and making RXTX use that stream. What do you think ? >> > > A patch for using properties would be accepted I'm sure. > > The reason the default is to display the message is not related to the > development state of rxtx anymore. The problem is that people first using > rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. > The message prevents a great deal of email thats easily explained by the > message. > > I question if we should support rxtx 2.0 at all anymore. > > If you post a patch in bugzilla, we'll put it into CVS this weekend. > we'll be going through and doing such things anyhow. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_version_output_patch.diff Type: application/octet-stream Size: 991 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060515/3173c2b6/rxtx_version_output_patch-0001.obj From lyon at docjava.com Mon May 15 06:06:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 May 2006 08:06:21 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Joachim makes several good points. Let me see if I can address some of them below: >Hello Douglas, > >Looking at the current code, leaves me with the feeling, that there? >is a lot to do. Yes! >Defining an API that wraps javax.comm to provide what? >you describe is certainly possible, but I wonder how much benefit it? >will actually provide. > >Personally I think the API defined by javax.comm > >"request/lock" a port with: > cp= new CommunicationPort(identifier) >"release" a port with: > cp.close(); > >works quite nice for 99% of the applications. I don't know what percentage of applications turn off locking, the way that I do in my version of the RXTX lib. I do know that this is not safe practice. I also know that it was motivated by the multi-platform nature of my code and that this was the only way I could make things work, at the time. Java does not appear to have a cross-platform standard for locking resources on various platforms. Each OS appears to have its own standard. The question of who breaks deadlocks and how this is done remains open, as this is not an easy question to resolve. Let me continue, below: > >In my experience, the most efficient and elegant implementation is to? >wrap a port/socket/.. into a business object which declares the? >remote operations that are possible. Ie "uploadFile",? >"waitForPrompt", "getSerialNumber", "sendContact", "executeCommand",? >etc Those methods are then either synchronized or guarded by a? >monitor. I do not see how your design pattern applied to the port? >resource would help implementing this. I have no problem with high-level wrappers that are application specific. That is a very good idea, but orthogonal with respect to the issue of deadlocks. More below: > >[details start, skip if you agree to the above] >When I talked about "thread-safe" I didn't mean several independent? >"sessions" accessing the port concurrently. I think this is a very? >rare usage. That is probably why turning locking off works so well! On the other hand, it is not safe and I shouldn't do it. >I believe the most common use case for serial ports today? >is the control of an external device from a PC running a GUI based? >application. To implement a clean Swing/AWT-GUI one needs to pass any? >action that can block to a "worker" thread (else the GUI blocks, the? >application appears dead). While it is possible to use own prespawned? >thread that will accept Runnables which operate on the port, this is? >not very elegant. It is more common to spawn a new thread for every? >action triggered by the user. Additionally the ABORT of a running? >operation is often implemented via a port.close() delegated to a? >different thread. Here lies the heart of serial port concern. An application opens a serial port and then dies. The application is restarted and finds the port locked. How do we clear the lock? Must the application's user reside in the UUCP group? Must installers of the serial port add users to the UUCP group? Should locking be handled at a high-level of abstraction in an operating system independent way? Should the implementation of the locking mechanism be translated into an API that is dependent on the OS convention? Suppose that we restrict the discussion to serial ports. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on inconsistent naming conventions. Hence my feeling that we need to mirror what is done in other API's; we need a locking toolkit that references peer methods, IMHO. >From the Java programming point of view, the locking API is portable across different platforms, but has, as its implementation, a native peer method that uses the conventions of the underlying OS. This enables portable resource locking (in theory!). Consider, for example: org.apache.commons.transaction.locking with: Interface LockManager at: http://jakarta.apache.org/commons/transaction/apidocs/org/apache/commons/transaction/locking/LockManager.html Or, more recently: java.util.concurrent.locks Interface Lock based on Doug Lea's code: http://kickjava.com/src/EDU/oswego/cs/dl/util/concurrent/ReadWriteLock.java.htm Should we incorporate a clean, portable design into serial port use, one that is consistent with current locking APIs? Basically, a comm port is a resource and resources are typically controlled by managers. Thus, I suggest that we make use of a CommPortManager to help control and centralize serial port usage. The question of how this is done remains open, IMHO, but using core API's like: java.util.concurrent.locks might not be amiss. High-level methods (getAllPorts, getAllSerialPorts, getAllParallelPorts, etc...) might be welcome additions. Basic questions like, "what if a port is in use?" remain open, hence my proposal for the new design pattern. Isn't it the CommPortManager's role to break the deadlock? Cheers! - Doug > >- During the lifetime of a port, it will usually be accessed from? >several different threads. Instance variables need to be set/read in? >synchronized regions to guarantee a correct operation based on the? >Java memory model. >- Synchronizing the access is usually handled on the application? >level (synchronizing the reads/writes is usually useless from the? >applications view because it is not a transaction mechanism). >[details end] > >I am very open to learn about other scenarios where your proposed? >design pattern applied to the port resource is beneficial to the? >application implementor. > >Best regards, >Joachim > >On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > >> Dmitry suggests that we acquire an implementation of >> a serial port reference, use it, then release it (i.e., check it? >> back in). >> > > Joachim says that making serial ports thread friendly might be a? >> good idea. >> >> This is a good idea. The design pattern that is close to this idea >> is the "Object Pool Design Pattern". >> # Object Pool > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Mon May 15 06:58:19 2006 From: joachim at buechse.de (Joachim Buechse) Date: Mon, 15 May 2006 14:58:19 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Doug, I agree fully, that locking of the system resource should be abstracted from the user (programmer). Currently this is already the case, but I agree it might be nice to extract the code into a separate class, which uses platform dependent providers to do its job. What I described in my email was not targeted at allocating the system resource, but at handling an already allocated system resource inside the framework. I agree that it may be possible to combine the two - however, I would suggest to do this in phase2. I can contribute a work over of RXTXPort.java which implements clean internal locking and proper close behavior (which I would call phase 1). I could do this this week. However I strongly believe that there is little sense in trying to do this as a series of patches. It will be closer to a rewrite than to a patch. I have already provided a number of suggested patches via Bugzilla, but this is quite inconvenient (for me). My working copy diverges more and more from the master and hence it gets more and more annoying to provide self contained patches. Best regards, Joachim From tjarvi at qbang.org Mon May 15 08:27:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 May 2006 08:27:51 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Mon, 15 May 2006, Joachim Buechse wrote: > Hello Doug, > > I agree fully, that locking of the system resource should be > abstracted from the user (programmer). Currently this is already the > case, but I agree it might be nice to extract the code into a > separate class, which uses platform dependent providers to do its job. > > What I described in my email was not targeted at allocating the > system resource, but at handling an already allocated system resource > inside the framework. I agree that it may be possible to combine the > two - however, I would suggest to do this in phase2. > > I can contribute a work over of RXTXPort.java which implements clean > internal locking and proper close behavior (which I would call phase > 1). I could do this this week. > > However I strongly believe that there is little sense in trying to do > this as a series of patches. It will be closer to a rewrite than to a > patch. I have already provided a number of suggested patches via > Bugzilla, but this is quite inconvenient (for me). My working copy > diverges more and more from the master and hence it gets more and > more annoying to provide self contained patches. > For methodical testing purposes (which does go on) the incremental patches are better. I'm lagging behind in bugzilla but thats soon to change (this week). It has just been rather chaotic up until now. I moved, purchased a house, and jumped into the fire of a feature freeze timeframe at a new job. btw, we see the Solaris close issues on 2.8 also. 9 and 10 are fine. I'll work towards making those test results public and allow others to run new rxtx code through them. We had the OK at one point but setting up the environment is involved. It isn't just a collection of java classes. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Tue May 16 02:01:47 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:01:47 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] Message-ID: <446986EB.209@willicon.de> Hi, any ideas for my problem? Hans -------- Original-Nachricht -------- Betreff: [Rxtx] Problem under Mac OSX 10.3.9 Datum: Mon, 08 May 2006 18:47:20 +0200 Von: WILLICon Antwort an: RXTX Developers and Users An: RXTX Developers and Users Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/b0741c2b/attachment-0001.html From joachim at buechse.de Tue May 16 02:15:08 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 10:15:08 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: Hello Hans, I am using RXTX on OS X for my own project. I do not see the problem you describe. I had some troubles installing it because the current version uses lock files which is non-standard on OS X. I have created a patched version which I currently use. This version does not need to modify user groups and hence does not need an installer. I just pop it in the application directory. If you send me a link where I can download your OSX installer, I will have a quick look. Regards, Joachim On 16.05.2006, at 10:01, WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we > have some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + > spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + > spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always > the value "false". > I can only get the status, while I open the port and catch the > exception. > > Any ideas? > > Hans > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail at willicon.de Tue May 16 02:26:53 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:26:53 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: References: <446986EB.209@willicon.de> Message-ID: <44698CCD.7050709@willicon.de> Joachim, tanks for the answer. I'll send You a mail. Hans Joachim Buechse schrieb: > Hello Hans, > > I am using RXTX on OS X for my own project. I do not see the problem > you describe. > > I had some troubles installing it because the current version uses > lock files which is non-standard on OS X. I have created a patched > version which I currently use. This version does not need to modify > user groups and hence does not need an installer. I just pop it in > the application directory. If you send me a link where I can download > your OSX installer, I will have a quick look. > > Regards, > Joachim > > On 16.05.2006, at 10:01, WILLICon wrote: > > >> Hi, >> >> any ideas for my problem? >> >> Hans >> >> -------- Original-Nachricht -------- >> Betreff: [Rxtx] Problem under Mac OSX 10.3.9 >> Datum: Mon, 08 May 2006 18:47:20 +0200 >> Von: WILLICon >> Antwort an: RXTX Developers and Users >> An: RXTX Developers and Users >> >> >> Hi, >> >> I use for RXTX for communicate with CyclingComputers. >> >> It works good under Win32, Sloaris and Linux but with Mac OSX we >> have some problems. >> >> My users install the Mac OSX serial lib from the actual binary. >> >> After starting the program, they get this error message: >> >> java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while >> loading gnu.io.RXTXCommDriver >> >> Remember, this error comes only under Mac OSX. >> >> That is the code for the error: >> >> Enumeration portList = CommPortIdentifier.getPortIdentifiers(); >> spInUse = getBundleStr("serialPortInUse"); >> spFree = getBundleStr("serialPortFree"); >> while (portList.hasMoreElements()) { >> CommPortIdentifier portId = (CommPortIdentifier) >> portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (osName != null && osName.startsWith("mac")) { >> if (!portId.getName().startsWith("dev/cu.")) { >> continue; >> } >> } >> if (portId.isCurrentlyOwned()) { >> serialPortNames.add(portId.getName() + " - " + >> spInUse); >> } >> else { >> serialPortNames.add(portId.getName() + " - " + >> spFree); >> } >> } >> } >> if (serialPortNames.size() == 0) { >> serialPortNames.add(getBundleStr("serialPortNotFound")); >> } >> >> BTW: The methode isCurrentlyOwned() is not working. I get always >> the value "false". >> I can only get the status, while I open the port and catch the >> exception. >> >> Any ideas? >> >> Hans >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/948333be/attachment-0001.html From jredman at ergotech.com Tue May 16 07:35:52 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 16 May 2006 07:35:52 -0600 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: <4469D538.6070408@ergotech.com> Hans, I have no direct insight, but would note that what you have is a "NoClassDefFoundError" not a "ClassNotFoundException". So the class javax/comm/CommDriver is found, but one of its dependencies is missing. NoClassDefFoundError are a bigger problem to resolve because you get no indication of the real problem. Jim WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we have > some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > * spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always the > value "false". > I can only get the status, while I open the port and catch the exception. > > Any ideas? > > Hans > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.de Tue May 16 08:01:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 16:01:21 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 In-Reply-To: <4469AFC3.6000002@willicon.de> References: <44698EBC.8000008@willicon.de> <8C5680C4-E2BA-42FF-B221-36E1124FA6A4@buechse.de> <4469AFC3.6000002@willicon.de> Message-ID: <9825A602-D6ED-4C28-BF33-9A7C984FACD5@buechse.de> Hallo Hans, you include RXTX 2.17 in your "bikeXexperience.jar" (2.17 uses Interfaces from gnu.io.* not javax.comm.*). Now inspect your error log closely: The class gnu.io.RXTXCommDriver tries to load javax.comm.CommDriver: this is only the case for RXTX 2.07. I assume, that the user has installed Version 2.07 into one of the java.ext.dirs . The VM always tries to load classes from the "system" path first. The current Mac installer distributed with RXTX in fact installs RXTXcomm.jar and librxtxSerial.jnilib into /Library/Java/Extensions. (I wrote some time ago that I consider this as a bad idea because of potential version conflicts-> thanks for delivering the example). For 2.07 it does so without installing the javax.comm classes it seems. I would recommend that you instruct your users to install version 2.17 only. Until RXTX is changed to use TIOCEXCL instead of lock files, you can hardly avoid the installer, as the user needs to be added to a special group and a lockfile directory needs be created. More precisely you are waiting for: http://bugzilla.qbang.org/show_bug.cgi?id=50 [RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL)] Regards, Joachim -------------- next part -------------- A non-text attachment was scrubbed... Name: log.tiff Type: image/tiff Size: 38394 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/e3e52128/log-0001.tiff -------------- next part -------------- > > Ich verwende RXTX 2.17. Das orginal RXTXcomm.jar ist in > CyclingDataManager.jar enthalten. > From tjarvi at qbang.org Wed May 17 23:18:15 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 May 2006 23:18:15 -0600 (MDT) Subject: [Rxtx] update Message-ID: So we have several patches and these have stacked up. I'd like to thank everyone for being patient. Tests for the most intrusive patches look good so far. I still have to get some bits together on my end but it looks like we can catch everything up in CVS this week. I'll try to post a normal list of what went in by whom with links Saturday. But I'm not seeing anything that raises flags yet. I also think I'll be able to submit a patch for nonstandard baud rates. I have to confirm w32 but I think its going to be a one line fix. I don't know if its bugzilla or people tinkering with patch files before submitting but patches are not applying cleanly. So the patches have to be done by hand. This may make things difficult for people hoping to add other patches on top. I'm trying to make that go well but ... -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Thu May 18 02:23:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 May 2006 10:23:47 +0200 Subject: [Rxtx] update In-Reply-To: References: Message-ID: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Hello Trent, in fact I tinkered with the patches (never used this mechanism before, usually I "communicate" via cvs) ... so sorry for any trouble you had applying them. Basicly I edited the patches to make them self contained. Having the tests run with different speeds on different platforms, may well be an effect of caching. I have seen quite interesting propagation delays for the closing flag on my PowerPC system, which makes me doubt, that the propagation of output_buffer_empty_flag works as it should. Maybe the communication mechanism between the two threads should be replaced by something like pthread_cond_*. Could you describe which problems you see on Solaris/SPARC? I'd be interested to see if they exist on OS X (PowerPC) as well... As you seem to work on the stuff at the moment I would like to suggest the following additions (it looks more than it is, I posted some context to make clear where to apply the change). See the comments in braces for what was changed Greetings, Joachim (1) The end of the drain loop could be: --- report("drain_loop: received EINTR in tcdrain\n"); --- (added "in tcdrain" to make debug output clearer) (2) The start of the drain loop should be: --- for(i=0;;i++) { report_verbose("drain_loop: looping\n"); #if defined(__sun__) /* FIXME: No time to test on all OS's for production */ if( eis->eventloop_interrupted ) { goto end; } if (usleep(5000)) { report("drain_loop: received EINTR"); } #else if (usleep(1000000)) { report("drain_loop: received EINTR"); } #endif /* __sun__ */ --- (added a check for "eis->eventloop_interrupted" before the sleep) (3) The end of interrupt_event_loop could (and maybe should) be: --- #if !defined(TIOCSERGETLSR) && !defined(WIN32) /* make sure that the drainloop unblocks from tcdrain */ pthread_kill(index->drain_tid, SIGABRT); /* TODO use wait/join/SIGCHLD/?? instead of sleep? */ usleep(50 * 1000); /* Under normal conditions, SIGABRT will unblock tcdrain. However a non-responding USB device combined with an unclean driver may still block. This is very ugly because it may block the call to close indefinetly. */ if (index->closing != 1) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); index->closing = 1; } #endif report("interruptEventLoop: interrupted\n"); --- (added some comments and pthread_cancel for resisting drain thread) On 18.05.2006, at 07:18, Trent Jarvi wrote: > > So we have several patches and these have stacked up. I'd like to > thank > everyone for being patient. > > Tests for the most intrusive patches look good so far. I still > have to > get some bits together on my end but it looks like we can catch > everything > up in CVS this week. > > I'll try to post a normal list of what went in by whom with links > Saturday. But I'm not seeing anything that raises flags yet. I also > think I'll be able to submit a patch for nonstandard baud rates. > I have > to confirm w32 but I think its going to be a one line fix. > > I don't know if its bugzilla or people tinkering with patch files > before > submitting but patches are not applying cleanly. So the patches > have to > be done by hand. This may make things difficult for people hoping > to add > other patches on top. I'm trying to make that go well but ... > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu May 18 22:28:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 18 May 2006 22:28:00 -0600 (MDT) Subject: [Rxtx] update In-Reply-To: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> References: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Message-ID: On Thu, 18 May 2006, Joachim Buechse wrote: > Hello Trent, > > in fact I tinkered with the patches (never used this mechanism > before, usually I "communicate" via cvs) ... so sorry for any trouble > you had applying them. Basicly I edited the patches to make them self > contained. I think we are close to moving towards that. > > Having the tests run with different speeds on different platforms, > may well be an effect of caching. I have seen quite interesting > propagation delays for the closing flag on my PowerPC system, which > makes me doubt, that the propagation of output_buffer_empty_flag > works as it should. Maybe the communication mechanism between the two > threads should be replaced by something like pthread_cond_*. Could > you describe which problems you see on Solaris/SPARC? I'd be > interested to see if they exist on OS X (PowerPC) as well... This is interesting. I have seen problems with output buffer empty in applications that require it. I'm trying to get a bug list and or test results open for everyone to see but that may take time. But missed output buffer events ... yep. With Sparc, we have seen a few things. One was a kernel race condition that went away when we reimaged and updated 2.8. RXTX was hanging on close, top showed no cpu use but there was 2 second delays just typing on console. The other is our tests now take ~4 times longer on Solaris. Someone is looking at timing just open, close, read, write, ... to see if they can find where the slowdown is. This happened after solaris 2.8. I'll try to share more when/if there is something interesting. This may well not be solvable in userland. > > As you seem to work on the stuff at the moment I would like to > suggest the following additions (it looks more than it is, I posted > some context to make clear where to apply the change). See the > comments in braces for what was changed I'll take a look. This could all come together Saturday but I also have an event to attend that day. I may not wrap this up until Sunday. -- Trent Jarvi tjarvi at qbang.org From andrewlord at internode.on.net Sun May 21 20:10:02 2006 From: andrewlord at internode.on.net (Andrew Lord) Date: Mon, 22 May 2006 11:40:02 +0930 Subject: [Rxtx] Kernel include files do not match kernel Message-ID: <200605221140.03271.andrewlord@internode.on.net> Hi, I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel 2.6.12-18 with the command: ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include However I get the message: ## checking java.version 1.5.0_06 ## checking os.version 2.6.12-18mdk ## ## WARNING: Kernel include files do not match the current kernel ## ## configure: creating ./config.status etc. Is there a problem with the way I'm specifying the 'include' directory ? If not, how else can I specify the correct directory for the include files please ? Cheers, Andrew From tjarvi at qbang.org Sun May 21 20:31:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 May 2006 20:31:31 -0600 (MDT) Subject: [Rxtx] Kernel include files do not match kernel In-Reply-To: <200605221140.03271.andrewlord@internode.on.net> References: <200605221140.03271.andrewlord@internode.on.net> Message-ID: On Mon, 22 May 2006, Andrew Lord wrote: > Hi, > > I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel > 2.6.12-18 with the command: > > ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk > CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include > > However I get the message: > > ## checking java.version 1.5.0_06 > ## checking os.version 2.6.12-18mdk > ## > ## WARNING: Kernel include files do not match the current kernel > ## > ## configure: creating ./config.status > etc. > > Is there a problem with the way I'm specifying the 'include' directory ? If > not, how else can I specify the correct directory for the include files > please ? > Hi Andrew I'm fairly sure your --with-kernel option does nothing. The CPPFLAGS should do what you want. Maybe put an #error message in /usr/src/linux.../incude/linux/version.h But I don't recall a recent problem with version missmatches. It should work. Distros will even ship include files that don't match versions exactly. In theory it should never matter for users. I used to compile new kernels by hand and really didnt have a distro. I didnt have a seperate package of kernel headers for users (myself). When changing a gateway from linux 1.2.12 to 2.1.77, I would worry about such messages. So if you are doing something that weird, the message may be of use to you. If you just see the message on a distro you installed, it is more than likely harmless. -- Trent Jarvi tjarvi at qbang.org From mrogers at spro.net Mon May 22 14:45:39 2006 From: mrogers at spro.net (Mike Rogers) Date: Mon, 22 May 2006 14:45:39 -0600 Subject: [Rxtx] Sun's CommAPI -- think May? Message-ID: <447222F3.9040302@spro.net> Hi, Any word from Sun about progress towards fixing the Java CommAPI v3 "incompatibilities" so RXTX 2.0 can operate within the framework's namespace (javax.comm)? I recall mention of a May time frame. Thanks, Mike From paul.klissner at sun.com Mon May 22 15:09:27 2006 From: paul.klissner at sun.com (Paul Klissner) Date: Mon, 22 May 2006 14:09:27 -0700 Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <447222F3.9040302@spro.net> References: <447222F3.9040302@spro.net> Message-ID: <44722887.8080308@sun.com> Mike Rogers wrote: > Hi, > > Any word from Sun about progress towards fixing the Java CommAPI v3 > "incompatibilities" so RXTX 2.0 can operate within the framework's > namespace (javax.comm)? I recall mention of a May time frame. > > Thanks, > > Mike > We've had a lot of work come in. This hasn't been the only priority. I'm running behind the plan in addressing this, but will be looking at it again soon. Rather than state a new, I'll just say it is in progress, and not off the table. I'll get this fixed as soon as I can. Good timing for asking as we just started discussing javax.comm plans today, and I'll have some cycles to work on it soon. Paul From yhua537 at cse.unsw.edu.au Mon May 22 16:03:05 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Tue, 23 May 2006 08:03:05 +1000 (EST) Subject: [Rxtx] install rxtx in XP Message-ID: Hi Guys, I am new to serial port programming, and have no experience on programming java in xp, but my project require me to builld a communication link between xp and a UART device. Most of the information in the web site seems for linux only. including the commands such as export and chmod. How do I install rxtx in xp? cheers YiQi Huang From mark at mdsh.com Tue May 23 01:24:20 2006 From: mark at mdsh.com (Mark Himsley) Date: Tue, 23 May 2006 08:24:20 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off , it includes DLLs for Windows and the JAR for Java. Follow the Windows instructions in the INSTALL. ie RXTXcomm.jar goes in \jre\lib\ext (under java) rxtxSerial.dll goes in \jre\bin So, assuming a fairly standard Java install, copy RXTXcomm.jar into C:\Program Files\Java\jre1.5.0_06\lib\ext and copy rxtxSerial.dll into C:\Program Files\Java\jre1.5.0_06\bin Yes, it really is that simple. On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > I am new to serial port programming, and have no experience on > programming java in xp, but my project require me to builld a > communication link between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang -- Mark Himsley From joachim at buechse.de Tue May 23 02:51:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 23 May 2006 10:51:47 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) Unless it is absolutely required you should NOT install RXTX in your global Java Runtime Environment. This will for sure create versioning conflicts - if not now, than in the future, if not on your system than at your clients. Instead put the dll in your application directory and include the RXTXcomm.jar in your classpath. This is much safer and not a bit more complicated. Regards, Joachim On 23.05.2006, at 09:24, Mark Himsley wrote: > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR > for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > >> I am new to serial port programming, and have no experience on >> programming java in xp, but my project require me to builld a >> communication link between xp and a UART device. >> >> Most of the information in the web site seems for linux only. >> including >> the commands such as export and chmod. How do I install rxtx in xp? >> >> cheers >> YiQi Huang > > > > -- > Mark Himsley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tod at todbot.com Tue May 23 03:12:22 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 02:12:22 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I totally agree: do not contaminate the Java installation. I put all the RXTX files in a directory and then change my java invocation to be: % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* Alternatively, use Launch4J to create a double-clickable application and keep the RXTX libraries in the directory of the application. -=tod On May 23, 2006, at 1:51 AM, Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > >> Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off >> , it includes DLLs for Windows and the JAR >> for Java. >> >> Follow the Windows instructions in the INSTALL. >> >> ie >> >> RXTXcomm.jar goes in \jre\lib\ext (under java) >> rxtxSerial.dll goes in \jre\bin >> >> So, assuming a fairly standard Java install, copy RXTXcomm.jar into >> C:\Program Files\Java\jre1.5.0_06\lib\ext >> and copy rxtxSerial.dll into >> C:\Program Files\Java\jre1.5.0_06\bin >> >> Yes, it really is that simple. >> >> >> >> On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: >> >>> I am new to serial port programming, and have no experience on >>> programming java in xp, but my project require me to builld a >>> communication link between xp and a UART device. >>> >>> Most of the information in the web site seems for linux only. >>> including >>> the commands such as export and chmod. How do I install rxtx in xp? >>> >>> cheers >>> YiQi Huang >> >> >> >> -- >> Mark Himsley >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From smontgomery at mediaspansoftware.com Tue May 23 08:46:53 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Tue, 23 May 2006 10:46:53 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: Message-ID: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Joachim and Tod mentioned how to keep the files RXTX requires on Windows XP out of the Java installations - thanks gentlemen! Are there similar suggestions for an RXTX install on OS X? The current "canonical" OS X installation instructions "contaminate the Java installation", to use Tod's words. Our app will run fine under 1.4.2 and 5.0 on OS X, and a lot of users will have both. We've already been burned by the recent switch from 1.4.2 to 5.0 as the platform default. Any suggestions welcomed. From tod at todbot.com Tue May 23 13:27:55 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 12:27:55 -0700 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <9BA0F670-A862-42E7-BB2C-130D775ABDF9@todbot.com> Hi Sean, It depends on how you build and deploy your code. If you're using shell scripts, you can do something like this: #!/bin/sh # pick one JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/ Commands/java #JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/ Commands/java $JAVA -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* That both picks which VM to use and uses the RXTX in the directory called 'rxtxlib'. If you want your shell script to be clever, you could test for the existence of the different 'java' executables and go from there (maybe even use different jar files). I am almost positive all OS X systems with Java 1.5 are guaranteed to also have Java 1.4.2. If you're using Jar Builder or XCode, you can specify which JVM to use and add the extra args in the Info.plist file. The paths specified in the 'java' invocation then are based off of the $JAVAROOT variable that the JavaApplicationStub sets for you. For my app, I've have been compiling two sets of jars, one compiled with 1.4.2 and one with 1.5, but they both run under 1.5. So I have a similar shell script that chooses a different 'javac' depending on the need. -=tod On May 23, 2006, at 7:46 AM, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From yhua537 at cse.unsw.edu.au Tue May 23 11:09:37 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 03:09:37 +1000 (EST) Subject: [Rxtx] install rxtx in XP (Mark Himsley, Joachim Buechse, Tod E. Kurt> In-Reply-To: References: Message-ID: > Message: 8 > Date: Tue, 23 May 2006 08:03:05 +1000 (EST) > From: YiQi Huang > Subject: [Rxtx] install rxtx in XP > To: rxtx at qbang.org > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > Hi Guys, > > I am new to serial port programming, and have no experience on programming > java in xp, but my project require me to builld a communication link > between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang > > > ------------------------------ > > Message: 9 > Date: Tue, 23 May 2006 08:24:20 +0100 > From: Mark Himsley > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=us-ascii; format=flowed > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > ------------------------------ > > Message: 10 > Date: Tue, 23 May 2006 10:51:47 +0200 > From: Joachim Buechse > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > > ------------------------------ > > Message: 11 > Date: Tue, 23 May 2006 02:12:22 -0700 > From: "Tod E. Kurt" > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I totally agree: do not contaminate the Java installation. > > I put all the RXTX files in a directory and then change my java > invocation to be: > > % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* > > Alternatively, use Launch4J to create a double-clickable application > and keep the RXTX libraries in the directory of the application. > > -=tod > > Hi, Thanks guys, I don't know if this is the correct way to reply your mecessage, if wrong, please point out. Thank you for Mark to give the detail instructions and Joachim to point out the cons ot installing in the java directory, and specially thanks for Tod to give the instrection in detail. Sorry to ask another stupid question: I have followed Tod's instruction. Now I think i am ready to start hacking. But where is the RXTX API documentation? Is it the same as using normal java comm API? btw, where could i find some examples to start with? Thanks very much cheers YiQi Huang From tjarvi at qbang.org Tue May 23 16:09:32 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 May 2006 16:09:32 -0600 (MDT) Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <44722887.8080308@sun.com> References: <447222F3.9040302@spro.net> <44722887.8080308@sun.com> Message-ID: > Good timing for asking as we just started discussing javax.comm plans > today, and I'll have some cycles to work on it soon. Hi Paul I assume you mean Sun is discussing plans concerning its own internal actions and there is no community involvment at this point. -- Trent Jarvi tjarvi at qbang.org From yhua537 at cse.unsw.edu.au Tue May 23 22:50:01 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 14:50:01 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } From mmester at sps.edu Tue May 23 22:58:21 2006 From: mmester at sps.edu (Michael Mester) Date: Wed, 24 May 2006 00:58:21 -0400 Subject: [Rxtx] install rxtx in XP References: Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below -----Original Message----- From: rxtx-bounces at qbang.org on behalf of YiQi Huang Sent: Wed 5/24/2006 12:50 AM To: RXTX Developers and Users Subject: Re: [Rxtx] install rxtx in XP Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3950 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060523/b36d0c63/attachment-0001.bin From yhua537 at cse.unsw.edu.au Tue May 23 23:05:50 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 15:05:50 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: Yes, Michael you are right, it should be semicolons, But it still can't find the correct library. On Wed, 24 May 2006, Michael Mester wrote: > I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below > > > -----Original Message----- > From: rxtx-bounces at qbang.org on behalf of YiQi Huang > Sent: Wed 5/24/2006 12:50 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] install rxtx in XP > > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > cheers YiQi Huang From tod at todbot.com Wed May 24 00:01:57 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 23:01:57 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Yes, sorry, classpath entries are semicolon-separated on Windows and colon-separated on everything else. Your example code below is importing the wrong set of classes. It should not "import javax.comm.*", instead it should "import gnu.io.*". When I make that change, your example program compiles. The "javax.comm" package is the one released by Sun, the "gnu.io" package is the RXTX one. You might've seen some discussion that the two will be merged or become compatible, but that hasn't happened yet. -=tod On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > > Yes, Michael you are right, it should be semicolons, But it still > can't > find the correct library. > > On Wed, 24 May 2006, Michael Mester wrote: > >> I believe the entries in the classpath need to be seperated with >> semicolons, not a colon as you have in your command below >> >> >> -----Original Message----- >> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >> Sent: Wed 5/24/2006 12:50 AM >> To: RXTX Developers and Users >> Subject: Re: [Rxtx] install rxtx in XP >> >> Hi, >> >> Sorry guys.I follow Tod's instruction, and here is what i did: >> >> put >> RXTXcomm.jar, >> rxtxParallel.dll, >> rxtxSerial.dll >> in >> C:\RXTX_files >> >> and I got a SimpleRead class attached below, compile it with : >> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >> it still saying "cannot find symbol". >> >> Is there anything I did wrong? Do I need the comm.jar from Sun? >> >> Thanks & regards >> YiQi Huang >> >> >> //////////////////////////////////////////////////////// >> // SimpleRead.java >> //////////////////////////////////////////////////////// >> >> import java.io.*; >> import java.util.*; >> import javax.comm.*; >> >> public class SimpleRead >> implements Runnable, SerialPortEventListener { >> static CommPortIdentifier portId; >> static Enumeration portList; >> InputStream inputStream; >> SerialPort serialPort; >> Thread readThread; >> public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == >> CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals("COM1")) { >> //if (portId.getName().equals("/dev/term/a")) { >> SimpleRead reader = new SimpleRead(); >> } >> } >> } >> } >> public SimpleRead() { >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", >> 2000); >> } catch (PortInUseException e) {} >> try { >> inputStream = serialPort.getInputStream(); >> } catch (IOException e) {} >> try { >> serialPort.addEventListener(this); >> } catch (TooManyListenersException e) {} >> serialPort.notifyOnDataAvailable(true); >> try { >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } catch (UnsupportedCommOperationException e) {} >> readThread = new Thread(this); >> readThread.start(); >> } >> public void run() { >> try { >> Thread.sleep(20000); >> } catch (InterruptedException e) {} >> } >> public void serialEvent(SerialPortEvent event) { >> switch(event.getEventType()) { >> case SerialPortEvent.BI: >> case SerialPortEvent.OE: >> case SerialPortEvent.FE: >> case SerialPortEvent.PE: >> case SerialPortEvent.CD: >> case SerialPortEvent.CTS: >> case SerialPortEvent.DSR: >> case SerialPortEvent.RI: >> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >> break; >> case SerialPortEvent.DATA_AVAILABLE: >> byte[] readBuffer = new byte[20]; >> try { >> while (inputStream.available() > 0) { >> int numBytes = inputStream.read(readBuffer); >> } >> System.out.print(new String(readBuffer)); >> } catch (IOException e) {} >> break; >> } >> } >> } >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > cheers > YiQi Huang > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From joachim at buechse.de Wed May 24 00:10:06 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:10:06 +0200 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Hi Sean, my preferred way of dealing with RXTX on OS X is to include the RXTX classes into my application jar and to put the RXTX lib in the same directory as this jar. To make it even more comfortable, you can include the lib in the jar and have some startup code extract it and write it to a temporary file from which you load it with System.load(). Unfortunately the current version of RXTX for OS X requires tinkering with user groups as it is based on lockfiles - and hence it needs the RXTX OS X installer or you need to duplicated this functionality in your own installer. I have created my own native version which is not based on lockfiles but tty locking (the standard way to do it on OSX). I hope that these patches will be integrated soon into the distribution. Regards, Joachim On 23.05.2006, at 16:46, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Wed May 24 00:16:12 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:16:12 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <7017ECFC-B13E-4806-B321-9FFCAC5830F0@buechse.de> I assume you downloaded rxtx-217 (not 207). Instead of importing javax.comm.* you must import gnu.io.* The classes have the same name, but they are not in the same package. On 24.05.2006, at 06:50, YiQi Huang wrote: > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From yhua537 at cse.unsw.edu.au Wed May 24 00:17:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 16:17:45 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Message-ID: Thanks Tod again, i kept reading "gnu.io.*" as "gun.io.*" last few hours after i read some commons from web. Thanks very much Tod. thanks YiQi Huang On Tue, 23 May 2006, Tod E. Kurt wrote: > Yes, sorry, classpath entries are semicolon-separated on Windows and > colon-separated on everything else. > > Your example code below is importing the wrong set of classes. It > should not "import javax.comm.*", instead it should "import > gnu.io.*". When I make that change, your example program compiles. > The "javax.comm" package is the one released by Sun, the "gnu.io" > package is the RXTX one. You might've seen some discussion that the > two will be merged or become compatible, but that hasn't happened yet. > > -=tod > > > On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > >> >> Yes, Michael you are right, it should be semicolons, But it still >> can't >> find the correct library. >> >> On Wed, 24 May 2006, Michael Mester wrote: >> >>> I believe the entries in the classpath need to be seperated with >>> semicolons, not a colon as you have in your command below >>> >>> >>> -----Original Message----- >>> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >>> Sent: Wed 5/24/2006 12:50 AM >>> To: RXTX Developers and Users >>> Subject: Re: [Rxtx] install rxtx in XP >>> >>> Hi, >>> >>> Sorry guys.I follow Tod's instruction, and here is what i did: >>> >>> put >>> RXTXcomm.jar, >>> rxtxParallel.dll, >>> rxtxSerial.dll >>> in >>> C:\RXTX_files >>> >>> and I got a SimpleRead class attached below, compile it with : >>> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >>> it still saying "cannot find symbol". >>> >>> Is there anything I did wrong? Do I need the comm.jar from Sun? >>> >>> Thanks & regards >>> YiQi Huang >>> >>> >>> //////////////////////////////////////////////////////// >>> // SimpleRead.java >>> //////////////////////////////////////////////////////// >>> >>> import java.io.*; >>> import java.util.*; >>> import javax.comm.*; >>> >>> public class SimpleRead >>> implements Runnable, SerialPortEventListener { >>> static CommPortIdentifier portId; >>> static Enumeration portList; >>> InputStream inputStream; >>> SerialPort serialPort; >>> Thread readThread; >>> public static void main(String[] args) { >>> portList = CommPortIdentifier.getPortIdentifiers(); >>> while (portList.hasMoreElements()) { >>> portId = (CommPortIdentifier) portList.nextElement(); >>> if (portId.getPortType() == >>> CommPortIdentifier.PORT_SERIAL) { >>> if (portId.getName().equals("COM1")) { >>> //if (portId.getName().equals("/dev/term/a")) { >>> SimpleRead reader = new SimpleRead(); >>> } >>> } >>> } >>> } >>> public SimpleRead() { >>> try { >>> serialPort = (SerialPort) portId.open("SimpleReadApp", >>> 2000); >>> } catch (PortInUseException e) {} >>> try { >>> inputStream = serialPort.getInputStream(); >>> } catch (IOException e) {} >>> try { >>> serialPort.addEventListener(this); >>> } catch (TooManyListenersException e) {} >>> serialPort.notifyOnDataAvailable(true); >>> try { >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, >>> SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> } catch (UnsupportedCommOperationException e) {} >>> readThread = new Thread(this); >>> readThread.start(); >>> } >>> public void run() { >>> try { >>> Thread.sleep(20000); >>> } catch (InterruptedException e) {} >>> } >>> public void serialEvent(SerialPortEvent event) { >>> switch(event.getEventType()) { >>> case SerialPortEvent.BI: >>> case SerialPortEvent.OE: >>> case SerialPortEvent.FE: >>> case SerialPortEvent.PE: >>> case SerialPortEvent.CD: >>> case SerialPortEvent.CTS: >>> case SerialPortEvent.DSR: >>> case SerialPortEvent.RI: >>> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >>> break; >>> case SerialPortEvent.DATA_AVAILABLE: >>> byte[] readBuffer = new byte[20]; >>> try { >>> while (inputStream.available() > 0) { >>> int numBytes = inputStream.read(readBuffer); >>> } >>> System.out.print(new String(readBuffer)); >>> } catch (IOException e) {} >>> break; >>> } >>> } >>> } >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> >> cheers >> YiQi Huang >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From smontgomery at mediaspansoftware.com Wed May 24 10:24:13 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 12:24:13 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: Tod & Joachim, Thanks for the info, that's very helpful. I'll give that a whirl when I move to rxtx 2.1. I'm still using the older 2.0.7 version for now (don't ask), which probably requires the Sun comm.jar, javax.comm.properties and librxtxSerial.jnilib to be in very specific places in each jvm's file hierarchy. From tjarvi at qbang.org Wed May 24 11:59:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 11:59:16 -0600 (MDT) Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: On Wed, 24 May 2006, Sean Montgomery wrote: > Tod & Joachim, > > Thanks for the info, that's very helpful. I'll give that a whirl > when I move to rxtx 2.1. I'm still using the older 2.0.7 version for > now (don't ask), which probably requires the Sun comm.jar, > javax.comm.properties and librxtxSerial.jnilib to be in very specific > places in each jvm's file hierarchy. > You will need comm.jar from Sun then. It must be Sun's version 2.* or older for Linux or Solaris. I assume they have this in download archives. The default offering from Sun is version 3.0. This version currently does not support rxtx. The older version will probably be fine for your needs. -- Trent Jarvi tjarvi at qbang.org From smontgomery at mediaspansoftware.com Wed May 24 12:19:06 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 14:19:06 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: <3939EFB8-11E1-4E3E-A684-5B3C525577CD@mediaspansoftware.com> Yup, that's right, thanks Trent. I've been using these files for quite a while now. Thanks for bringing it up. I almost didn't mention using 2.0.7 because I didn't want to give any new members of the list the wrong idea! :-) On May 24, 2006, at 1:59 PM, Trent Jarvi wrote: > On Wed, 24 May 2006, Sean Montgomery wrote: > >> Tod & Joachim, >> >> Thanks for the info, that's very helpful. I'll give that a whirl >> when I move to rxtx 2.1. I'm still using the older 2.0.7 version for >> now (don't ask), which probably requires the Sun comm.jar, >> javax.comm.properties and librxtxSerial.jnilib to be in very specific >> places in each jvm's file hierarchy. >> > > You will need comm.jar from Sun then. It must be Sun's version 2.* or > older for Linux or Solaris. I assume they have this in download > archives. > > The default offering from Sun is version 3.0. This version > currently does > not support rxtx. > > The older version will probably be fine for your needs. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mark at mdsh.com Wed May 24 15:55:46 2006 From: mark at mdsh.com (Mark Himsley) Date: Wed, 24 May 2006 22:55:46 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <37B0FC4B1F3237321F093ABE@MacMini.local> On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) That's no problem. BUT, do note that the instructions I elaborated on are in the INSTALL file within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone please update the INSTALL file? > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > > , it includes DLLs for Windows and the JAR > > for Java. > > > > Follow the Windows instructions in the INSTALL. > > > > ie > > > > RXTXcomm.jar goes in \jre\lib\ext (under java) > > rxtxSerial.dll goes in \jre\bin > > > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > > C:\Program Files\Java\jre1.5.0_06\lib\ext > > and copy rxtxSerial.dll into > > C:\Program Files\Java\jre1.5.0_06\bin > > > > Yes, it really is that simple. > > > > > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > > > >> I am new to serial port programming, and have no experience on > >> programming java in xp, but my project require me to builld a > >> communication link between xp and a UART device. > >> > >> Most of the information in the web site seems for linux only. > >> including > >> the commands such as export and chmod. How do I install rxtx in xp? > >> > >> cheers > >> YiQi Huang > > > > > > > > -- > > Mark Himsley > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Mark Himsley From tjarvi at qbang.org Wed May 24 16:41:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 16:41:46 -0600 (MDT) Subject: [Rxtx] install rxtx in XP In-Reply-To: <37B0FC4B1F3237321F093ABE@MacMini.local> References: <37B0FC4B1F3237321F093ABE@MacMini.local> Message-ID: On Wed, 24 May 2006, Mark Himsley wrote: > > > On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > >> I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > That's no problem. > > BUT, do note that the instructions I elaborated on are in the INSTALL file > within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone > please update the INSTALL file? > > The INSTALL file may be updated by anyone at anytime. http://rxtx.qbang.org/wiki/index.php/Installation We are moving it to the wiki so end users may put the type of answers they would like to see in. Sometimes it's best if developers don't give what appears to be cryptic answers. You can even put in that jre/lib/ext is not the right place but you don't understand the classpath solution mentioned on the mail-list and then we know what to add. -- Trent Jarvi tjarvi at qbang.org From stramit at gmail.com Wed May 24 21:45:31 2006 From: stramit at gmail.com (Tim Cooper) Date: Thu, 25 May 2006 13:45:31 +1000 Subject: [Rxtx] Accessing Virtual Com Port Message-ID: Hi, I have to develop an application that talks to a virtual com port (in this case com3) which translates any messages sent across a USB cable to a micro. Using C++ I can talk to this com port and I know that it is configured, present, and working. For the application that I am trying to write I want to use RXTX for the communication. My problem is that the configured virtual port (in windows) is not showing up when I do an enumeration over the available ports. The output I get is (com 3 is not present) : Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 PORT FOUND: COM1 PORT FOUND: LPT1 Is there anything that I need to do to make com3 available to RXTX and my application? Timothy Cooper -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060524/c5591648/attachment-0001.html From antonio.luis at iscte.pt Thu May 25 01:39:13 2006 From: antonio.luis at iscte.pt (=?ISO-8859-1?Q?Ant=F3nio_Lopes?=) Date: Thu, 25 May 2006 08:39:13 +0100 Subject: [Rxtx] RXTX on Pocket PC Message-ID: <44755F21.8060103@iscte.pt> Hello everyone, I've been using RXTX to communicate with serial ports in Windows and it's been quite successful. However, I'm now considering porting my application from Windows to Pocket PC but I can't seem to find the RXTX binaries (*.jar and *.dll) to use in Pocket PC. I've been "digging" on the mailing list's archives and also on the web and I can't find these anywhere. Can anyone in this mailing list give me some pointers on this? Where can I find the necessary files and basic installation instructions? Thanks very much for your help. I very much appreciate any help that you can provide me. Regards, -- Ant?nio Lopes @contact: antonio.luis at iscte.pt @work: ADETTI - ISCTE @web: http://antonio.lopes.googlepages.com/home From doug at dupreeinc.com Fri May 26 15:45:50 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Fri, 26 May 2006 14:45:50 -0700 Subject: [Rxtx] rxtx slow startup Message-ID: <4477770E.9010400@dupreeinc.com> Hello, I hope there are people still reading this mailing list. The archive appeared to not have anything new after 4/2005. I was using the commapi from sun for a project where a java application reads data from test equipment connected to the serial port. I had to upgrade the ftdi vcp driver on my pc and the old sun commapi no longer works with hardware flow control. as an experiment I replaced the javax.com with gnu.io in the SerialDemo.java project that was included with the commapi. This compiled fine using JBuilder 2006 and JRE 1.5.0_05. RXTX also works with the latest ftdi drivers so life is wonderful again... almost... When using the commapi jar the SerialDemo program starts in about 1 second on my system. Using the RXTX jar it takes over 56 seconds to start. Has anyone else seen this problem? Is there a workaround to get the startup performance close to the old commapi? The last thing printed to the console before this delay is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks for your time! Doug From yhua537 at cse.unsw.edu.au Sat May 27 05:46:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 21:46:45 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <4477770E.9010400@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> Message-ID: hi Doug The archive hasn't been update for a long time, But people certainly still reading the list. I don't have enough experience to help on your problem, but without any detail about what your problem doing during that 56 seconds, it is hard to target the your question, I think. cheers YiQi On Fri, 26 May 2006, Doug Thistlethwaite wrote: > Hello, > > I hope there are people still reading this mailing list. The archive > appeared to not have anything new after 4/2005. > > I was using the commapi from sun for a project where a java application > reads data from test equipment connected to the serial port. I had to > upgrade the ftdi vcp driver on my pc and the old sun commapi no longer > works with hardware flow control. as an experiment I replaced the > javax.com with gnu.io in the SerialDemo.java project that was included > with the commapi. This compiled fine using JBuilder 2006 and JRE > 1.5.0_05. RXTX also works with the latest ftdi drivers so life is > wonderful again... almost... > > When using the commapi jar the SerialDemo program starts in about 1 > second on my system. Using the RXTX jar it takes over 56 seconds to > start. Has anyone else seen this problem? Is there a workaround to get > the startup performance close to the old commapi? > > The last thing printed to the console before this delay is: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Thanks for your time! > > Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------- Just a student, Still a student ------------------------------- From yhua537 at cse.unsw.edu.au Sat May 27 06:04:26 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 22:04:26 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: Sorry, I don't think you could understand what I mean .I mean this: Without any detail about what your program is doing during that 56 seconds, it is hard for anyone to target the problem. On Sat, 27 May 2006, YiQi Huang wrote: > hi Doug > > The archive hasn't been update for a long time, But people certainly still > reading the list. > > I don't have enough experience to help on your problem, but without any > detail about what your problem doing during that 56 seconds, it is hard to > target the your question, I think. > > cheers > YiQi > > On Fri, 26 May 2006, Doug Thistlethwaite wrote: > >> Hello, >> >> I hope there are people still reading this mailing list. The archive >> appeared to not have anything new after 4/2005. >> >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From jredman at ergotech.com Sat May 27 08:32:02 2006 From: jredman at ergotech.com (Jim Redman) Date: Sat, 27 May 2006 08:32:02 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: <447862E2.4080506@ergotech.com> Doug, Since you mentioned it, we have a system that is also seems slow. From memory (I don't have one of the slow systems around), I'm not sure that it's consistent, it seems that sometimes it may take longer than others. Since it's part of the bootup it hasn't raised a flag and I haven't researched it. The same code runs much faster on other systems, so now you've got me wondering what's different. The slow system boots DSL (http://www.damnsmalllinux.org/) from a compact flash. FC4 is on my desktop where I haven't noticed a slow down. I think that the rxtx code is the same in both cases with lock files disabled. The slow system has a bunch of serial ports defined, including 4 USB serial ports that do not exist - they are not plugged in. Any clues in there? Jim > On Fri, 26 May 2006, Doug Thistlethwaite wrote: >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Sat May 27 10:41:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 May 2006 10:41:54 -0600 (MDT) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447862E2.4080506@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: On Sat, 27 May 2006, Jim Redman wrote: > Doug, > > Since you mentioned it, we have a system that is also seems slow. From > memory (I don't have one of the slow systems around), I'm not sure that > it's consistent, it seems that sometimes it may take longer than others. > Since it's part of the bootup it hasn't raised a flag and I haven't > researched it. > > The same code runs much faster on other systems, so now you've got me > wondering what's different. > > The slow system boots DSL (http://www.damnsmalllinux.org/) from a > compact flash. FC4 is on my desktop where I haven't noticed a slow > down. I think that the rxtx code is the same in both cases with lock > files disabled. > > The slow system has a bunch of serial ports defined, including 4 USB > serial ports that do not exist - they are not plugged in. > > Any clues in there? > rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. When it does this, it will try to open each port and do a timed out read. most systems will not have entries in device if the port is not there. But some minimal systems will just put all the device files there in case hardware is added. The list of devices scanned used to be ~10-20 times longer than it is today. That was getting very slow. I suspect moving the device files not used to a backup directory would increase the enumeration. I'll look into why the mail-list archive is not updating. The last update was about when I thought I 'fixed' the cron jobs. I probably didn't actually fix it but rather moved the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon May 29 19:46:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 May 2006 19:46:47 -0600 (MDT) Subject: [Rxtx] Mail-List Archives are updating. Message-ID: It was pointed out earlier that the archive is dated. This was a missing crontab entry. The list is currently archived by the week on the web page. It is updated once a day. So every 7 days it starts a new link and updates it daily. I've been limited in what I could do while my cable modem was disconnected this last week. rxtx.org is something I do on my own time. The patches and credits will be comming next. Many of these can be seen in bugzilla right now. -- Trent Jarvi tjarvi at qbang.org From doug at dupreeinc.com Tue May 30 11:18:41 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 10:18:41 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: <447C7E71.4080204@dupreeinc.com> Trent, YiQi, and Jim: Thanks to all for the replies and information! I am just back from a long weekend and I am now trying to figure out what I was doing! :) As for more information. First off, this example is being run under windows XP. I am developing test equipment that communicates with a java application via a serial port. I have been using the commapi for several years and have not had a problem. Recently, I have started a design modification that will replace the RS232 connection with a USB port. I am using the ftdi module for prototyping and I discovered that their virtual com port driver was not compatible with the commapi that Sun released. It turns out that it has problems with hardware flow control ( it works on incoming but not outgoing communications). The way I figured this out was by experimenting with the SerialDemo that was included with the Sum commapi. One nice thing about this example is it has the ability to set incoming and outgoing flow control independently. After I installed RXTX into my JBuilder 2006 IDE, I just replaced all all instances of javax.comm with gnu.io and it compiled and runs without a hitch (except for the slow startup). I Paused the JBuilder IDE during this long pause and the last few entries in the stack trace are: testRead() : -1, gnu.io.RXTXCommDriver registerValidPorts() : 255, gnu.io.RXTXCommDriver registerScannedPorts() : 777, gnu.io.RXTXCommDriver This was all initiated by the following call in the programs init routine: Enumeration en = CommPortIdentifier.getPortIdentifiers(); After looking at this, My guess is that Trent is correct in that the delay is in scanning for ports. I guess one solution would be to not scan for ports, though it would be nice to detect what is available on the system. Is there any way to reduce the number of ports scanned by this function in windows XP? Thanks again for your time, Doug Trent Jarvi wrote: >On Sat, 27 May 2006, Jim Redman wrote: > > > >>Doug, >> >>Since you mentioned it, we have a system that is also seems slow. From >>memory (I don't have one of the slow systems around), I'm not sure that >>it's consistent, it seems that sometimes it may take longer than others. >>Since it's part of the bootup it hasn't raised a flag and I haven't >>researched it. >> >>The same code runs much faster on other systems, so now you've got me >>wondering what's different. >> >>The slow system boots DSL (http://www.damnsmalllinux.org/) from a >>compact flash. FC4 is on my desktop where I haven't noticed a slow >>down. I think that the rxtx code is the same in both cases with lock >>files disabled. >> >>The slow system has a bunch of serial ports defined, including 4 USB >>serial ports that do not exist - they are not plugged in. >> >>Any clues in there? >> >> >> > >rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. > >When it does this, it will try to open each port and do a timed out read. >most systems will not have entries in device if the port is not there. >But some minimal systems will just put all the device files there in case >hardware is added. > >The list of devices scanned used to be ~10-20 times longer than it is >today. That was getting very slow. > >I suspect moving the device files not used to a backup directory would >increase the enumeration. > >I'll look into why the mail-list archive is not updating. The last update >was about when I thought I 'fixed' the cron jobs. I probably didn't >actually fix it but rather moved the problem. > >-- >Trent Jarvi >tjarvi at qbang.org > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/86796453/attachment-0001.html From doug at dupreeinc.com Tue May 30 14:36:09 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 13:36:09 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447C7E71.4080204@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com> Message-ID: <447CACB9.1000801@dupreeinc.com> Hello all, I also notice this pause (not as long however) when I call: CommPortIdentifier.getPortIdentifier(PortName); I would think that if I supply the name of the port, it would not have to go through the same discovery process. If you have any ideas of how to get rid of this startup delay, I would really appreciate it. Thanks, Doug Doug Thistlethwaite wrote: > Trent, YiQi, and Jim: > > Thanks to all for the replies and information! I am just back from a > long weekend and I am now trying to figure out what I was doing! :) > > As for more information. First off, this example is being run under > windows XP. I am developing test equipment that communicates with a > java application via a serial port. I have been using the commapi for > several years and have not had a problem. Recently, I have started a > design modification that will replace the RS232 connection with a USB > port. I am using the ftdi module for prototyping and I discovered > that their virtual com port driver was not compatible with the commapi > that Sun released. It turns out that it has problems with hardware > flow control ( it works on incoming but not outgoing communications). > The way I figured this out was by experimenting with the SerialDemo > that was included with the Sum commapi. One nice thing about this > example is it has the ability to set incoming and outgoing flow > control independently. > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup). > > I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are: > > testRead() : -1, gnu.io.RXTXCommDriver > registerValidPorts() : 255, gnu.io.RXTXCommDriver > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > This was all initiated by the following call in the programs init routine: > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > After looking at this, My guess is that Trent is correct in that the > delay is in scanning for ports. I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system. Is there any way to reduce the number of ports scanned by > this function in windows XP? > > Thanks again for your time, > > Doug > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/edaa5c3c/attachment-0001.html From lynn at swcp.com Tue May 30 15:07:18 2006 From: lynn at swcp.com (lynn@swcp.com) Date: Tue, 30 May 2006 21:07:18 -0000 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CACB9.1000801@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: *IF* the name of the port is supplied, we might want to use the preferences mechanism (java.util.prefs) where we could have previously saved the info for the port. We could do a quick check to see that things have not changed before using it. If things have changed (or never been defined) we would do a full port scan and save detected ports in the preferences. This way if the hardware is not changed, you only pay the time penalty one time. just an idea... Lynn Doug Thistlethwaite said: > This is a multi-part message in MIME format. > --------------070808020900080005070500 > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > Content-Transfer-Encoding: 7bit > > Hello all, > > I also notice this pause (not as long however) when I call: > > CommPortIdentifier.getPortIdentifier(PortName); > > I would think that if I supply the name of the port, it would not have > to go through the same discovery process. If you have any ideas of how > to get rid of this startup delay, I would really appreciate it. > > Thanks, > > Doug > > Doug Thistlethwaite wrote: > > > Trent, YiQi, and Jim: > > > > Thanks to all for the replies and information! I am just back from a > > long weekend and I am now trying to figure out what I was doing! :) > > > > As for more information. First off, this example is being run under > > windows XP. I am developing test equipment that communicates with a > > java application via a serial port. I have been using the commapi for > > several years and have not had a problem. Recently, I have started a > > design modification that will replace the RS232 connection with a USB > > port. I am using the ftdi module for prototyping and I discovered > > that their virtual com port driver was not compatible with the commapi > > that Sun released. It turns out that it has problems with hardware > > flow control ( it works on incoming but not outgoing communications). > > The way I figured this out was by experimenting with the SerialDemo > > that was included with the Sum commapi. One nice thing about this > > example is it has the ability to set incoming and outgoing flow > > control independently. > > > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > > all instances of javax.comm with gnu.io and it compiled and runs > > without a hitch (except for the slow startup). > > > > I Paused the JBuilder IDE during this long pause and the last few > > entries in the stack trace are: > > > > testRead() : -1, gnu.io.RXTXCommDriver > > registerValidPorts() : 255, gnu.io.RXTXCommDriver > > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > > > This was all initiated by the following call in the programs init routine: > > > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > > > After looking at this, My guess is that Trent is correct in that the > > delay is in scanning for ports. I guess one solution would be to not > > scan for ports, though it would be nice to detect what is available on > > the system. Is there any way to reduce the number of ports scanned by > > this function in windows XP? > > > > Thanks again for your time, > > > > Doug > > > > --------------070808020900080005070500 > Content-Type: text/html; charset=ISO-8859-1 > Content-Transfer-Encoding: 7bit > > > > > > > > > Hello all,
>
> I also notice this pause (not as long however) when I call:
>
>          CommPortIdentifier.getPortIdentifier(PortName);
>
> I would think that if I supply the name of the port, it would not have > to go through the same discovery process.  If you have any ideas of how > to get rid of this startup delay, I would really appreciate it.
>
> Thanks,
>
> Doug
>
> Doug Thistlethwaite wrote: >
> > Trent, YiQi, and Jim:
>
> Thanks to all for the replies and information!  I am just back from a > long weekend and I am now trying to figure out what I was doing! :)
>
> As for more information.  First off, this example is being run under > windows XP.  I am developing test equipment that communicates with a > java application via a serial port.  I have been using the commapi for > several years and have not had a problem.  Recently, I have started a > design modification that will replace the RS232 connection with a USB > port.  I am using the ftdi module for prototyping and I discovered that > their virtual com port driver was not compatible with the commapi that > Sun released.  It turns out that it has problems with hardware flow > control ( it works on incoming but not outgoing communications).  The > way I figured this out was by experimenting with the SerialDemo that > was included with the Sum commapi.  One nice thing about this example > is it has the ability to set incoming and outgoing flow control > independently.
>
> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup).
>
> I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are:
>
> testRead() : -1, gnu.io.RXTXCommDriver
> registerValidPorts() : 255, gnu.io.RXTXCommDriver
> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>
> This was all initiated by the following call in the programs init > routine:
>
> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>
> After looking at this,  My guess is that Trent is correct in that the > delay is in scanning for ports.  I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system.  Is there any way to reduce the number of ports scanned by > this function in windows XP? 
>
> Thanks again for your time,
>
> Doug
>
>
> > > > --------------070808020900080005070500-- > -- From jredman at ergotech.com Tue May 30 15:42:35 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 30 May 2006 15:42:35 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: <447CBC4B.2080206@ergotech.com> Lynn, If I understand your idea correctly, I don't think that this would work well for, say, USB ports since these can be easily added/removed by the end user. Jim lynn at swcp.com wrote: > *IF* the name of the port is supplied, we might want to use the preferences > mechanism (java.util.prefs) where we could have previously saved the info for > the port. We could do a quick check to see that things have not changed > before using it. If things have changed (or never been defined) we would do a > full port scan and save detected ports in the preferences. > > This way if the hardware is not changed, you only pay the time penalty one time. > > just an idea... > Lynn > > > Doug Thistlethwaite said: > >> This is a multi-part message in MIME format. >> --------------070808020900080005070500 >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >> Content-Transfer-Encoding: 7bit >> >> Hello all, >> >> I also notice this pause (not as long however) when I call: >> >> CommPortIdentifier.getPortIdentifier(PortName); >> >> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process. If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it. >> >> Thanks, >> >> Doug >> >> Doug Thistlethwaite wrote: >> >>> Trent, YiQi, and Jim: >>> >>> Thanks to all for the replies and information! I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :) >>> >>> As for more information. First off, this example is being run under >>> windows XP. I am developing test equipment that communicates with a >>> java application via a serial port. I have been using the commapi for >>> several years and have not had a problem. Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port. I am using the ftdi module for prototyping and I discovered >>> that their virtual com port driver was not compatible with the commapi >>> that Sun released. It turns out that it has problems with hardware >>> flow control ( it works on incoming but not outgoing communications). >>> The way I figured this out was by experimenting with the SerialDemo >>> that was included with the Sum commapi. One nice thing about this >>> example is it has the ability to set incoming and outgoing flow >>> control independently. >>> >>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup). >>> >>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are: >>> >>> testRead() : -1, gnu.io.RXTXCommDriver >>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>> >>> This was all initiated by the following call in the programs init routine: >>> >>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>> >>> After looking at this, My guess is that Trent is correct in that the >>> delay is in scanning for ports. I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system. Is there any way to reduce the number of ports scanned by >>> this function in windows XP? >>> >>> Thanks again for your time, >>> >>> Doug >>> >> --------------070808020900080005070500 >> Content-Type: text/html; charset=ISO-8859-1 >> Content-Transfer-Encoding: 7bit >> >> >> >> >> >> >> >> >> Hello all,
>>
>> I also notice this pause (not as long however) when I call:
>>
>>         >  CommPortIdentifier.getPortIdentifier(PortName);
>>
>> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process.  If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it.
>>
>> Thanks,
>>
>> Doug
>>
>> Doug Thistlethwaite wrote: >>
>> >> Trent, YiQi, and Jim:
>>
>> Thanks to all for the replies and information!  I am just back from a >> long weekend and I am now trying to figure out what I was doing! :)
>>
>> As for more information.  First off, this example is being run under >> windows XP.  I am developing test equipment that communicates with a >> java application via a serial port.  I have been using the commapi for >> several years and have not had a problem.  Recently, I have started a >> design modification that will replace the RS232 connection with a USB >> port.  I am using the ftdi module for prototyping and I discovered that >> their virtual com port driver was not compatible with the commapi that >> Sun released.  It turns out that it has problems with hardware flow >> control ( it works on incoming but not outgoing communications).  The >> way I figured this out was by experimenting with the SerialDemo that >> was included with the Sum commapi.  One nice thing about this example >> is it has the ability to set incoming and outgoing flow control >> independently.
>>
>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >> all instances of javax.comm with gnu.io and it compiled and runs >> without a hitch (except for the slow startup).
>>
>> I Paused the JBuilder IDE during this long pause and the last few >> entries in the stack trace are:
>>
>> testRead() : -1, gnu.io.RXTXCommDriver
>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>
>> This was all initiated by the following call in the programs init >> routine:
>>
>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>
>> After looking at this,  My guess is that Trent is correct in that the >> delay is in scanning for ports.  I guess one solution would be to not >> scan for ports, though it would be nice to detect what is available on >> the system.  Is there any way to reduce the number of ports scanned by >> this function in windows XP? 
>>
>> Thanks again for your time,
>>
>> Doug
>>
>>
>> >> >> >> --------------070808020900080005070500-- >> > > > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From yhua537 at cse.unsw.edu.au Tue May 30 18:10:23 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 31 May 2006 10:10:23 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CBC4B.2080206@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: Doug, In the SerialDemo, it allow us to save the parameters into a file, and use it when your program start up. Would this help? YiQi On Tue, 30 May 2006, Jim Redman wrote: > Lynn, > > If I understand your idea correctly, I don't think that this would work > well for, say, USB ports since these can be easily added/removed by the > end user. > > Jim > > lynn at swcp.com wrote: >> *IF* the name of the port is supplied, we might want to use the preferences >> mechanism (java.util.prefs) where we could have previously saved the info for >> the port. We could do a quick check to see that things have not changed >> before using it. If things have changed (or never been defined) we would do a >> full port scan and save detected ports in the preferences. >> >> This way if the hardware is not changed, you only pay the time penalty one time. >> >> just an idea... >> Lynn >> >> >> Doug Thistlethwaite said: >> >>> This is a multi-part message in MIME format. >>> --------------070808020900080005070500 >>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>> Content-Transfer-Encoding: 7bit >>> >>> Hello all, >>> >>> I also notice this pause (not as long however) when I call: >>> >>> CommPortIdentifier.getPortIdentifier(PortName); >>> >>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process. If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it. >>> >>> Thanks, >>> >>> Doug >>> >>> Doug Thistlethwaite wrote: >>> >>>> Trent, YiQi, and Jim: >>>> >>>> Thanks to all for the replies and information! I am just back from a >>>> long weekend and I am now trying to figure out what I was doing! :) >>>> >>>> As for more information. First off, this example is being run under >>>> windows XP. I am developing test equipment that communicates with a >>>> java application via a serial port. I have been using the commapi for >>>> several years and have not had a problem. Recently, I have started a >>>> design modification that will replace the RS232 connection with a USB >>>> port. I am using the ftdi module for prototyping and I discovered >>>> that their virtual com port driver was not compatible with the commapi >>>> that Sun released. It turns out that it has problems with hardware >>>> flow control ( it works on incoming but not outgoing communications). >>>> The way I figured this out was by experimenting with the SerialDemo >>>> that was included with the Sum commapi. One nice thing about this >>>> example is it has the ability to set incoming and outgoing flow >>>> control independently. >>>> >>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>> all instances of javax.comm with gnu.io and it compiled and runs >>>> without a hitch (except for the slow startup). >>>> >>>> I Paused the JBuilder IDE during this long pause and the last few >>>> entries in the stack trace are: >>>> >>>> testRead() : -1, gnu.io.RXTXCommDriver >>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>> >>>> This was all initiated by the following call in the programs init routine: >>>> >>>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>> >>>> After looking at this, My guess is that Trent is correct in that the >>>> delay is in scanning for ports. I guess one solution would be to not >>>> scan for ports, though it would be nice to detect what is available on >>>> the system. Is there any way to reduce the number of ports scanned by >>>> this function in windows XP? >>>> >>>> Thanks again for your time, >>>> >>>> Doug >>>> >>> --------------070808020900080005070500 >>> Content-Type: text/html; charset=ISO-8859-1 >>> Content-Transfer-Encoding: 7bit >>> >>> >>> >>> >>> >>> >>> >>> >>> Hello all,
>>>
>>> I also notice this pause (not as long however) when I call:
>>>
>>>         >>  CommPortIdentifier.getPortIdentifier(PortName);
>>>
>>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process.  If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it.
>>>
>>> Thanks,
>>>
>>> Doug
>>>
>>> Doug Thistlethwaite wrote: >>>
>>> >>> Trent, YiQi, and Jim:
>>>
>>> Thanks to all for the replies and information!  I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :)
>>>
>>> As for more information.  First off, this example is being run under >>> windows XP.  I am developing test equipment that communicates with a >>> java application via a serial port.  I have been using the commapi for >>> several years and have not had a problem.  Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port.  I am using the ftdi module for prototyping and I discovered that >>> their virtual com port driver was not compatible with the commapi that >>> Sun released.  It turns out that it has problems with hardware flow >>> control ( it works on incoming but not outgoing communications).  The >>> way I figured this out was by experimenting with the SerialDemo that >>> was included with the Sum commapi.  One nice thing about this example >>> is it has the ability to set incoming and outgoing flow control >>> independently.
>>>
>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup).
>>>
>>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are:
>>>
>>> testRead() : -1, gnu.io.RXTXCommDriver
>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>
>>> This was all initiated by the following call in the programs init >>> routine:
>>>
>>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>
>>> After looking at this,  My guess is that Trent is correct in that the >>> delay is in scanning for ports.  I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system.  Is there any way to reduce the number of ports scanned by >>> this function in windows XP? 
>>>
>>> Thanks again for your time,
>>>
>>> Doug
>>>
>>>
>>> >>> >>> >>> --------------070808020900080005070500-- >>> >> >> >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From halbleib at rechnerbetriebsgruppe.de Wed May 31 02:06:16 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 10:06:16 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp Message-ID: <447D4E78.30302@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, I getting an error while reloading my app in tomcat. At the first start everything runs well, but if i reload mit webapp by tomcat manager i get the following error. java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader Is there a possibility to unload the native library rxtxSerial.dll? thx for all help! regards tom -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 b8FT80HQ1xlbDLnRecDANCc= =heb1 -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 02:52:17 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 10:52:17 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D4E78.30302@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> Message-ID: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Hello Tom, To the best of my knowledge it is impossible to unload native libraries once loaded into the JVM. The exception you see stems from the fact, that Tomcat creates a new classloader when you "reload" the weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar is loaded from the session class loader. Try to add RXTXComm.jar to your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. Regards, Joachim On 31.05.2006, at 10:06, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 > b8FT80HQ1xlbDLnRecDANCc= > =heb1 > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From halbleib at rechnerbetriebsgruppe.de Wed May 31 03:28:35 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 11:28:35 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Message-ID: <447D61C3.1030807@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Joachim, I'm still not getting it. How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml-file? Perhaps web.xml? Regards, Tom Joachim Buechse schrieb: > Hello Tom, > > To the best of my knowledge it is impossible to unload native > libraries once loaded into the JVM. The exception you see stems from > the fact, that Tomcat creates a new classloader when you "reload" the > weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar > is loaded from the session class loader. Try to add RXTXComm.jar to > your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. > > Regards, > Joachim > > On 31.05.2006, at 10:06, Tom Halbleib wrote: > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL tzNy+/0iIUfkYYgt1+UT1ko= =pkpY -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 04:03:42 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 12:03:42 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D61C3.1030807@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> <447D61C3.1030807@rechnerbetriebsgruppe.de> Message-ID: -Xbootclasspath/a: is a start option to the java vm. Google is your friend in finding how to modfiy it and what it means: tomcat modifying bootclasspath Regards, Joachim On 31.05.2006, at 11:28, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Joachim, > > I'm still not getting it. > How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml- > file? > Perhaps web.xml? > > Regards, > Tom > > Joachim Buechse schrieb: >> Hello Tom, >> >> To the best of my knowledge it is impossible to unload native >> libraries once loaded into the JVM. The exception you see stems from >> the fact, that Tomcat creates a new classloader when you "reload" the >> weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar >> is loaded from the session class loader. Try to add RXTXComm.jar to >> your bootlclasspath (-Xbootclasspath/a:) and the problem should go >> away. >> >> Regards, >> Joachim >> >> On 31.05.2006, at 10:06, Tom Halbleib wrote: >> >> Hi all, >> >> I getting an error while reloading my app in tomcat. At the first >> start >> everything runs well, but if i reload mit webapp by tomcat manager >> i get >> the following error. >> >> java.lang.UnsatisfiedLinkError: Native Library >> C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in >> another classloader thrown while loading gnu.io.RXTXCommDriver >> Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: >> Native >> Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already >> loaded >> in another classloader >> >> >> Is there a possibility to unload the native library rxtxSerial.dll? >> >> thx for all help! >> >> regards >> >> tom > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL > tzNy+/0iIUfkYYgt1+UT1ko= > =pkpY > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From impakt01 at optusnet.com.au Wed May 31 06:55:42 2006 From: impakt01 at optusnet.com.au (Daren) Date: Wed, 31 May 2006 22:55:42 +1000 Subject: [Rxtx] (no subject) Message-ID: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/ade7ad37/attachment-0001.html From doug at dupreeinc.com Wed May 31 10:19:19 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 31 May 2006 09:19:19 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: <447DC207.3070702@dupreeinc.com> I am not sure what you are saying. The Save parameters menu option saves the current settings (baud, data bits, etc.). The long pause (~60 seconds) is when the application first starts (before loading the saved parameters). This does bring up a question, though I hate this type of kludge approach to getting this library to work... What exactly is a PortIdentifier? Is it always the same? If I stored the results from "CommPortIdentifier.getPortIdentifier(PortName);" in a file, could I use this the next time the program is executed? In this case I am using a virtual com port driver to connect to the device through a USB port. Doug YiQi Huang wrote: >Doug, > >In the SerialDemo, it allow us to save the parameters into a file, and use >it when your program start up. Would this help? > >YiQi > >On Tue, 30 May 2006, Jim Redman wrote: > > > >>Lynn, >> >>If I understand your idea correctly, I don't think that this would work >>well for, say, USB ports since these can be easily added/removed by the >>end user. >> >>Jim >> >>lynn at swcp.com wrote: >> >> >>>*IF* the name of the port is supplied, we might want to use the preferences >>>mechanism (java.util.prefs) where we could have previously saved the info for >>>the port. We could do a quick check to see that things have not changed >>>before using it. If things have changed (or never been defined) we would do a >>>full port scan and save detected ports in the preferences. >>> >>>This way if the hardware is not changed, you only pay the time penalty one time. >>> >>>just an idea... >>>Lynn >>> >>> >>>Doug Thistlethwaite said: >>> >>> >>> >>>>This is a multi-part message in MIME format. >>>>--------------070808020900080005070500 >>>>Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>>>Content-Transfer-Encoding: 7bit >>>> >>>>Hello all, >>>> >>>>I also notice this pause (not as long however) when I call: >>>> >>>> CommPortIdentifier.getPortIdentifier(PortName); >>>> >>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process. If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it. >>>> >>>>Thanks, >>>> >>>>Doug >>>> >>>>Doug Thistlethwaite wrote: >>>> >>>> >>>> >>>>>Trent, YiQi, and Jim: >>>>> >>>>>Thanks to all for the replies and information! I am just back from a >>>>>long weekend and I am now trying to figure out what I was doing! :) >>>>> >>>>>As for more information. First off, this example is being run under >>>>>windows XP. I am developing test equipment that communicates with a >>>>>java application via a serial port. I have been using the commapi for >>>>>several years and have not had a problem. Recently, I have started a >>>>>design modification that will replace the RS232 connection with a USB >>>>>port. I am using the ftdi module for prototyping and I discovered >>>>>that their virtual com port driver was not compatible with the commapi >>>>>that Sun released. It turns out that it has problems with hardware >>>>>flow control ( it works on incoming but not outgoing communications). >>>>>The way I figured this out was by experimenting with the SerialDemo >>>>>that was included with the Sum commapi. One nice thing about this >>>>>example is it has the ability to set incoming and outgoing flow >>>>>control independently. >>>>> >>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>>without a hitch (except for the slow startup). >>>>> >>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>>entries in the stack trace are: >>>>> >>>>>testRead() : -1, gnu.io.RXTXCommDriver >>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>>> >>>>>This was all initiated by the following call in the programs init routine: >>>>> >>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>>> >>>>>After looking at this, My guess is that Trent is correct in that the >>>>>delay is in scanning for ports. I guess one solution would be to not >>>>>scan for ports, though it would be nice to detect what is available on >>>>>the system. Is there any way to reduce the number of ports scanned by >>>>>this function in windows XP? >>>>> >>>>>Thanks again for your time, >>>>> >>>>>Doug >>>>> >>>>> >>>>> >>>>--------------070808020900080005070500 >>>>Content-Type: text/html; charset=ISO-8859-1 >>>>Content-Transfer-Encoding: 7bit >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>>Hello all,
>>>>
>>>>I also notice this pause (not as long however) when I call:
>>>>
>>>>        >>>> >>>> >>> CommPortIdentifier.getPortIdentifier(PortName);
>>> >>> >>>>
>>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process.  If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it.
>>>>
>>>>Thanks,
>>>>
>>>>Doug
>>>>
>>>>Doug Thistlethwaite wrote: >>>>
>>>> >>>>Trent, YiQi, and Jim:
>>>>
>>>>Thanks to all for the replies and information!  I am just back from a >>>>long weekend and I am now trying to figure out what I was doing! :)
>>>>
>>>>As for more information.  First off, this example is being run under >>>>windows XP.  I am developing test equipment that communicates with a >>>>java application via a serial port.  I have been using the commapi for >>>>several years and have not had a problem.  Recently, I have started a >>>>design modification that will replace the RS232 connection with a USB >>>>port.  I am using the ftdi module for prototyping and I discovered that >>>>their virtual com port driver was not compatible with the commapi that >>>>Sun released.  It turns out that it has problems with hardware flow >>>>control ( it works on incoming but not outgoing communications).  The >>>>way I figured this out was by experimenting with the SerialDemo that >>>>was included with the Sum commapi.  One nice thing about this example >>>>is it has the ability to set incoming and outgoing flow control >>>>independently.
>>>>
>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>without a hitch (except for the slow startup).
>>>>
>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>entries in the stack trace are:
>>>>
>>>>testRead() : -1, gnu.io.RXTXCommDriver
>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>>
>>>>This was all initiated by the following call in the programs init >>>>routine:
>>>>
>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>>
>>>>After looking at this,  My guess is that Trent is correct in that the >>>>delay is in scanning for ports.  I guess one solution would be to not >>>>scan for ports, though it would be nice to detect what is available on >>>>the system.  Is there any way to reduce the number of ports scanned by >>>>this function in windows XP? 
>>>>
>>>>Thanks again for your time,
>>>>
>>>>Doug
>>>>
>>>>
>>>> >>>> >>>> >>>>--------------070808020900080005070500-- >>>> >>>> >>>> >>> >>> >>> >>-- >>Jim Redman >>(505) 662 5156 x85 >>http://www.ergotech.com >>_______________________________________________ >>Rxtx mailing list >>Rxtx at qbang.org >>http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > >cheers >YiQi Huang >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/61d4d4c9/attachment-0001.html From impakt01 at optusnet.com.au Wed May 31 17:02:54 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 09:02:54 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Message-ID: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Hi all, I downloaded 2.1.7-pre16 and managed to build it and get it going. I made the changes as suggested by Peter Smith in an old post, by adding his code to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. Still not working, it opens the port at 9600 according to portmon.exe . Has anyone managed to get this going at a custom rate? Here is the post I'm referring to: http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 Thanks, Daren ________________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Daren Sent: Wednesday, 31 May 2006 10:56 PM To: rxtx at qbang.org Subject: [Rxtx] (no subject) Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren From tjarvi at qbang.org Wed May 31 21:44:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 May 2006 21:44:01 -0600 (MDT) Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> References: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Message-ID: On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org From impakt01 at optusnet.com.au Wed May 31 22:06:04 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 14:06:04 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: Message-ID: <200606010406.k51464X2010447@mail03.syd.optusnet.com.au> Trent, I have managed to successfully open the port at this speed using Realterm (available on sourceforge). From memory this uses DLPortIO. Using portmon.exe with realterm, even there it says that the port has opened at 1953. I changed termios.c:560 to dcb->BaudRate = 1953 ; and it still opens the port at 9600. Daren -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Thursday, 1 June 2006 1:44 PM To: RXTX Developers and Users Subject: Re: [Rxtx] custom baud rate win32 On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From smontgomery at mediaspansoftware.com Mon May 1 09:52:28 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 11:52:28 -0400 Subject: [Rxtx] RXTX, Java COMM and Windows Server 2003 on x64 experiences? Message-ID: Just wondering if anybody here has had to deploy RXTX or the javax.comm on Windows Server 2003 machines running on x64 (i.e. Xeon EM64T) and would like to relate how things went. From Sun's site, the Supported System Configurations pages give the options for that system: Java 5.0: - 32-bit Java 5.0 running on the OS in the 32-bit mode - 64-bit Java 5.0 running on the OS in the 64-bit native mode Java 1.4.2: - no options listed for EM64T processors, but potentially the standard 32-bit Java 1.4.2 could run on the OS in 32-bit mode? I guess the two main points of failure would be 1) the JVM itself and 2) the jni components. Make that three: there's gotta be hardware vendor driver support for the OS in the various modes, too. Guess I better go look at Keyspan's website... Thanks in advance for any info anyone might be able to provide. From smontgomery at mediaspansoftware.com Mon May 1 10:18:33 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 12:18:33 -0400 Subject: [Rxtx] Mailing list archive out of date? Message-ID: The mailing list archive at: http://mailman.qbang.org/pipermail/rxtx/ only shows emails through the end of March. Is there a new archive somewhere else? Didn't see anything mentioned on the wiki. From p.cain at phasefale.com.au Mon May 1 22:33:09 2006 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 02 May 2006 14:33:09 +1000 Subject: [Rxtx] RXTX and the Linux kernel. Message-ID: <4456E105.5080106@phasefale.com.au> Hi, First off the problem I am having isn't caused by RXTX itself but I'm hoping someone out there may have some knowledge that may help me. Background: I have an application monitoring a control system through a standard PC serial port which I talk to with rxtx-2.0.5. The application runs on RedHat7.3 kernel version 2.4.18 using Java 1.4. This configuration has been in use for several years and has proved to be stable. But it has become necessary for me to upgrade the OS but I'm running into problems with the serial communications. Its not that the comms don't work on the new OS (its never that simple) the comms work for a variable period of time (sometimes several hours) and then just stop, nothing on the data lines and control lines all indicate that data could flow. The new OS is Ubuntu 5.10 running kernel version 2.6.12. I have installed the OS and software on a PC and had it perform ok, then install the new OS and same software on the very same hardware and experienced the problems of them comms stopping. In the new OS I'm using Java5 to run the app but since I have experience the problem I reverted back to Java1.4 which didn't fix the problem. I've moved the app to a different system RedHat FC3 running 2.6.14 had experienced the problem. Not wanting to go through all the thing I have tried but I have established that it seems to be the 2.6 versions of the kernel that seem to be the problem and not an individual distribution of Linux. I should point out that I am using the same jar and library files for each java and OS combination. So I'm just wondering if anyone has had or heard of problems similar to these ? Or perhaps might know of what changed in the Linux serial driver (something I'm having a hard time establishing). I'm starting to run low on ideas of what to try so any help would be much appreciated. -- Peter Cain Senior Programmer Phasefale Pty Ltd From tjarvi at qbang.org Wed May 3 07:31:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 May 2006 07:31:00 -0600 (MDT) Subject: [Rxtx] Re: Concering ircomm and RXTX In-Reply-To: References: Message-ID: On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From legolas.w at gmail.com Wed May 3 08:46:23 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 19:16:23 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <4458C23F.2000003@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From legolas.w at gmail.com Wed May 3 13:10:57 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 23:40:57 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <44590041.80706@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From Lars.Hennig at wow-portal.com Thu May 4 00:39:15 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Thu, 4 May 2006 08:39:15 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: Message-ID: Hi, I could not find any solution. I therefore decided to to my own native implementation. Allthough it only supports the functions I need, it works pretty well now for me. I think the main problem there is the use of a wrong Windows API function and not setting an timeout. Regards, Lars Hennig W?rth Online World GmbH Tel. (0049)7181-258183 Mob. (0049)160-3522889 Fax. (0049)7940-153299 Lars.Hennig at wow-portal.com Gesendet von: rxtx-bounces at qbang.org 09.04.2006 10:42 Bitte antworten zu RXTX Developers and Users An d.herwald at dsh-elektronik.de, RXTX Developers and Users Kopie Thema Re: [Rxtx] USB Serialport - disconnection problems WV Proj./Teilpr.: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/7b39f374/attachment-0002.html From Pawan.Kharbanda at dot.state.co.us Thu May 4 11:00:58 2006 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Thu, 4 May 2006 11:00:58 -0600 Subject: [Rxtx] Dangling Lock Files Message-ID: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Hi, I have been using RXTX API's for the Serial Communication for quite some time now and for some of the devices we are opening and closing the connection every 2 minutes. This works great for few days and then suddenly I start seeing some "Port in Use Exception" and I see that the Lock files are still in the /var/lock folder after manually removing the lock files it works good for few hours and I see the same problem again. Can somebody explain me the scenarios why I am seeing the dangling Lock files? I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise Servers. Thanks Pawan Kharbanda -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/ba0e9261/attachment-0002.html From tjarvi at qbang.org Thu May 4 14:10:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:10:30 -0600 (MDT) Subject: [Rxtx] Dangling Lock Files In-Reply-To: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> References: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Message-ID: On Thu, 4 May 2006, Kharbanda, Pawan wrote: > Hi, > I have been using RXTX API's for the Serial Communication for quite > some time now and for some of the devices we are opening and closing the > connection every 2 minutes. This works great for few days and then > suddenly I start seeing some "Port in Use Exception" and I see that the > Lock files are still in the /var/lock folder after manually removing the > lock files it works good for few hours and I see the same problem again. > Can somebody explain me the scenarios why I am seeing the dangling Lock > files? > > I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise > Servers. Hi Pawan The next time it happens, look in the lockfile. There will be a pid. ps aux |grep 'pid' I think you will see that the application is still running for some reason. RXTX does a kill -0 on the pid to see if its alive. If not, it will remove the lockfile. So I suspect the previous program did not exit as you expected. -- Trent Jarvi tjarvi at qbang.org From Scott.Hughes at dalsemi.com Thu May 4 14:23:11 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 4 May 2006 15:23:11 -0500 Subject: [Rxtx] Wiki instructions... Message-ID: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire demo apps, when I stumbled across this tip on the wiki to add yourself to the uucp group: It may be simpler to just run usermod -G uucp jarvi Taken from: http://rxtx.qbang.org/wiki/index.php/Installation This does not work as advertised. I should have read the man page for usermod before I tried that out. If there are any groups which are not listed after the -G switch, the user is removed from those groups. On Ubuntu, this is bad... I removed myself from the Admin group, which removed my sudo priviledges. Ubuntu has no root account, so I've disabled the only account which could fix it. Anyone know of a good workaround? Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor From tjarvi at qbang.org Thu May 4 14:32:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:32:09 -0600 (MDT) Subject: [Rxtx] Wiki instructions... In-Reply-To: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> Message-ID: On Thu, 4 May 2006, Scott Hughes wrote: > I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire > demo apps, when I stumbled across this tip on the wiki to add yourself to > the uucp group: > > It may be simpler to just run > > usermod -G uucp jarvi > > Taken from: > http://rxtx.qbang.org/wiki/index.php/Installation > > This does not work as advertised. I should have read the man page for > usermod before I tried that out. If there are any groups which are not > listed after the -G switch, the user is removed from those groups. On > Ubuntu, this is bad... I removed myself from the Admin group, which removed > my sudo priviledges. Ubuntu has no root account, so I've disabled the only > account which could fix it. > > Anyone know of a good workaround? > Yikes This will get your permissions back: in grub/lilo/.. pass the following option to the kernel init=/bin/sh You are now root. when it boots, mount -o remount,rw / add yourself to the groups, reboot to get normal init going. Thats about all I can think of without sudo/root. -- Trent Jarvi tjarvi at qbang.org From Gettings at earth.utah.edu Thu May 4 14:41:22 2006 From: Gettings at earth.utah.edu (Paul Gettings) Date: Thu, 4 May 2006 14:41:22 -0600 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <20060504204122.GA6534@earth.utah.edu> When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get messages on stdout from the JVM: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 As the only change was the version of RXTX (from 2.1.6), I am unsure why the messages suddenly appeared. Anyone know how to get rid of them? Thanks. -- 101 USES FOR A DEAD MICROPROCESSOR (23) Dead cat brush From mmester at sps.edu Mon May 1 21:22:28 2006 From: mmester at sps.edu (Michael Mester) Date: Mon, 1 May 2006 23:22:28 -0400 Subject: [Rxtx] Windows PortInUseException Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> I'm trying to get simple serial communication going with RxTx under Windows XP. I can enumerate the ports fine, but I always run into problems when I try to open one. I get a PortInUseException, but the owner application is "Unknown" and the port is never open. I've tried this on several different systems and all of them give the same behavior. The only thing I can thiunk of that might be causing the problem is that fact that I had to put the serial .dll file in system32 instead of the reccommended folder, because it didn't work in the folder the documentation gives. The library loads fine, though, so I'm not sure whether that makes sense, and I don't know how to fix it anyway. Any help is greatly appreciated. Below is the output of the program, right up to the PortInUseException and the NullPointerException it causes (because the serial port object is not instantiated). C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI Starting GPSTalkerGUI... Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 gnu.io.PortInUseException: Unknown Application Exception in thread "main" java.lang.NullPointerException at GPSTalkerGUI.(GPSTalkerGUI.java:102) at GPSTalkerGUI.main(GPSTalkerGUI.java:161) Again, thank you very much for any help you can give. From lshellman at qwest.net Wed May 3 01:38:34 2006 From: lshellman at qwest.net (Lucious Shellman) Date: Wed, 03 May 2006 01:38:34 -0600 Subject: [Rxtx] Help needed: Project using parallel port Message-ID: <1146641914.8337.14.camel@localhost.localdomain> I was looking for a way to access the parallel port on a PC using Java. Searching the Internet, I came across this site (rxtx.org). What I am trying to do is detect logic levels from a TTL logic IC on the parallel port. I am not trying to do classic parallel port communication. I just want to detect whether a line(s) is (are) high or low. I am using Windows 98. Can rxtx be used to do this? If yes, is there a tutorial for using rxtx posted on the Internet that someone can direct me to. If you need more information, feel free to e-mail me. Unfortunately for me, I need the information ASAP. Thanks. lshellman at qwest.net From webmaster at egyhelp.com Wed May 3 18:43:39 2006 From: webmaster at egyhelp.com (Mohamed Samy) Date: Thu, 4 May 2006 02:43:39 +0200 Subject: [Rxtx] RE: Concering ircomm and RXTX In-Reply-To: Message-ID: <20060503184362.SM01044@Geek> Hey, I issue the command "modprobe ircomm-tty" yet no ttyircomm appears, while the ircomm appear by "modprobe ircomm" so forgive me but I am bit lost. Even searching google for the keyword "ttyircomm" only returns 3 matches. So any way I can start the ttyircomm???? Thanks a lot. -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Wednesday, May 03, 2006 3:31 PM To: Mohamed Samy; rxtx at qbang.org Cc: taj at www.linux.org.uk Subject: Re: Concering ircomm and RXTX On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 4 15:49:49 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 15:49:49 -0600 (MDT) Subject: [Rxtx] Windows PortInUseException In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> Message-ID: On Mon, 1 May 2006, Michael Mester wrote: > > I'm trying to get simple serial communication going with RxTx under > Windows XP. I can enumerate the ports fine, but I always run into > problems when I try to open one. I get a PortInUseException, but the > owner application is "Unknown" and the port is never open. I've tried > this on several different systems and all of them give the same > behavior. The only thing I can thiunk of that might be causing the > problem is that fact that I had to put the serial .dll file in system32 > instead of the reccommended folder, because it didn't work in the folder > the documentation gives. The library loads fine, though, so I'm not sure > whether that makes sense, and I don't know how to fix it anyway. Any > help is greatly appreciated. Below is the output of the program, right > up to the PortInUseException and the NullPointerException it causes > (because the serial port object is not instantiated). > > C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI > Starting GPSTalkerGUI... > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > gnu.io.PortInUseException: Unknown Application > Exception in thread "main" java.lang.NullPointerException > at GPSTalkerGUI.(GPSTalkerGUI.java:102) > at GPSTalkerGUI.main(GPSTalkerGUI.java:161) > Perhaps you are trying to open the port twice in your code? rxtx does open the ports, do a timed out read and then close the ports during enumeration. I think the port is being opened fine. The Unknown Application is always reported. On linux, there is some code that finds the actual application but on windows, its always unknown. If the port enumeration is returning the ports you expect, rxtx has opened the port and closed it with success. The port should open. There is also example code in the contrib directory that comes with rxtx source that has examples you can modify to work. -- Trent Jarvi tjarvi at qbang.org From Christian.Klemke at t-online.de Thu May 4 23:37:23 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Fri, 5 May 2006 07:37:23 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu> Message-ID: <004f01c67005$fc72fee0$016a10ac@NB600> Hi Paul, I was wondering about the same question some days ago and took a look at the source files. Unfortunately, I found that you can only get rid of that messages by altering and recompiling the Java code. There is a final static boolean variable called "devel" in the file "RXTXCommDriver.java" which is set to "true". This constellation causes the output after the native libraries have been loaded. No mechanism exists to suppress them otherwise :-(. Trent, does that mean that 2.1.7 is still officially a "development" version ? When will this value be changed to "false" by default ? With 2.1.8 ? It would be nice to provide a means to suppress such messages besides that static flag (maybe by setting a property called "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The output can indeed by annoying, especially when used with console applications, where the message potentially appears "in the middle" of your own output. Another possibility would be not to use System.out directly, but instead some PrintStream field which is initially set to System.out but can programatically be changed. That would allow for any kind of redirection or suppression by implementing appropriate user-defined PrintStream subclasses and making RXTX use that stream. What do you think ? Best regards, Christian ----- Original Message ----- From: "Paul Gettings" To: Sent: Thursday, May 04, 2006 10:41 PM Subject: [Rxtx] RXTX causing stdout messages > When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get > messages on stdout from the JVM: > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > As the only change was the version of RXTX (from 2.1.6), I am unsure > why the messages suddenly appeared. Anyone know how to get rid of > them? > > Thanks. > > -- > 101 USES FOR A DEAD MICROPROCESSOR > (23) Dead cat brush > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri May 5 06:09:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 06:09:46 -0600 (MDT) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <004f01c67005$fc72fee0$016a10ac@NB600> References: <20060504204122.GA6534@earth.utah.edu> <004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: On Fri, 5 May 2006, Christian Klemke wrote: > Hi Paul, > > I was wondering about the same question some days ago and took a look at the > source files. Unfortunately, I found that you can only get rid of that > messages by altering and recompiling the Java code. There is a final static > boolean variable called "devel" in the file "RXTXCommDriver.java" which is > set to "true". This constellation causes the output after the native > libraries have been loaded. No mechanism exists to suppress them otherwise > :-(. > > Trent, does that mean that 2.1.7 is still officially a "development" version > ? When will this value be changed to "false" by default ? With 2.1.8 ? It > would be nice to provide a means to suppress such messages besides that > static flag (maybe by setting a property called > "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The > output can indeed by annoying, especially when used with console > applications, where the message potentially appears "in the middle" of your > own output. Another possibility would be not to use System.out directly, but > instead some PrintStream field which is initially set to System.out but can > programatically be changed. That would allow for any kind of redirection or > suppression by implementing appropriate user-defined PrintStream subclasses > and making RXTX use that stream. What do you think ? > A patch for using properties would be accepted I'm sure. The reason the default is to display the message is not related to the development state of rxtx anymore. The problem is that people first using rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. The message prevents a great deal of email thats easily explained by the message. I question if we should support rxtx 2.0 at all anymore. If you post a patch in bugzilla, we'll put it into CVS this weekend. we'll be going through and doing such things anyhow. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri May 5 13:23:56 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 13:23:56 -0600 (MDT) Subject: [Rxtx] How to read from RxTx parallel port in Win XP In-Reply-To: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> References: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> Message-ID: On Thu, 27 Apr 2006, Worsley, Bob (Development Engineer) wrote: > I'm sorry if this is a dumb question, but I didn't find the answer in > the archives. > > I'm using the RxTx binaries for Windows on a reasonably current notebook > PC running Windows XP. I can send stuff to a printer on the parallel > port (LPT1), but I can't get anything back. > > I wrote a class that has the methods listed below. I write some data to > the printer with the "write" method and then try to read a response > using the "read" method, but I never get any data. I'd greatly > appreciate any help you can give! > > Bob Worsley > bobwoyid2 at yahoo.com > > > > > private ParallelPort parallelPort = null; > private RXTXCommDriver parallelPortDriver = null; > > > public boolean initialize() throws IOException { > if (parallelPort != null) { > return false; // Already initialized > } > > // Create the parallel port; > parallelPortDriver = new RXTXCommDriver(); > parallelPort = > (ParallelPort)parallelPortDriver.getCommPort(address, > CommPortIdentifier.PORT_PARALLEL); > > // Set the parallel port parameters. > try { > parallelPort.enableReceiveTimeout(READ_TIMEOUT); > parallelPort.disableReceiveFraming(); > parallelPort.disableReceiveThreshold(); > //parallelPort.setMode(mode); !!!!errors > } catch (UnsupportedCommOperationException e) { > throw (new IOException("Parallel port with address '" + > address > + "' cannot be configured as specified")); > } > > return true; > } > > > > public void write(final byte[] bytes) throws IOException { > initialize(); > while (busyReading) { > Thread.yield(); > } > busyWriting = true; > if (bytes.length < 1) { > return; > } > OutputStream outputStream = parallelPort.getOutputStream(); > outputStream.write(bytes); > outputStream.flush(); > outputStream.close(); > Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); > busyWriting = false; > } > > > public byte[] read() throws IOException { > > // Read up to MAX_BYTES bytes. > initialize(); > while (busyWriting) { > Thread.yield(); > } > busyReading = true; > byte[] buff = new byte[MAX_BYTES_READ]; > InputStream inputStream = parallelPort.getInputStream(); > // This read blocks until input data is available > int bytesRead = inputStream.read(buff); > inputStream.close(); > // If no data read, create empty array > if (bytesRead == -1) { > bytesRead = 0; > } > byte[] deviceBytes = new byte[bytesRead]; > System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); > if (bytesRead > 0) { > Debug.p("PPIOP.read - got data: '" + new > String(deviceBytes) + "'"); > } > busyReading = false; > return deviceBytes; > } > Hi Bob I've only used rxtx to test a hello world page printing but there are others that have used it. PPIOP? hmm what is this? :) The rxtx parallel support is behind the serial support but should be OK. As you note, the setting of modes is not supported. rxtx uses what is provided when the port is open. Are your asserting the pin for the printer being online? I suspect what often happens is people try to just use the data pins but the C API rxtx uses wants the printer to be online. There should be some posts relating to this in the rxtx mail-list archive. Some APIs are probably reading and writing from the port address (also suggested in your code as something you are looking at). RXTX currently uses a higher level C/C++ API for port access. This can still work if the API thinks the 'printer' is there. -- Trent Jarvi tjarvi at qbang.org From agrodellic at gmail.com Sat May 6 08:39:40 2006 From: agrodellic at gmail.com (Leigh Stewart) Date: Sat, 6 May 2006 10:39:40 -0400 Subject: [Rxtx] sun commapi 3 Message-ID: I think I read here: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html that rxtx-2.0 is basically fracked for now? Does anyone know of a workaround? ie can i somehow get an older version of sun's comm api and use that (not easy to find)? i mean 2.0 must be working for someone...how is it being tested. 2.1 isnt working for me....im getting nasty native exceptions etc, which is why im so set on 2.0... any ideas? From tjarvi at qbang.org Sun May 7 15:40:27 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 7 May 2006 15:40:27 -0600 (MDT) Subject: [Rxtx] sun commapi 3 In-Reply-To: References: Message-ID: On Sat, 6 May 2006, Leigh Stewart wrote: > > 2.1 isnt working for me....im getting nasty native exceptions etc, > which is why im so set on 2.0... any ideas? > Hi Leigh What native exceptions are you seeing? Which OS? The native code is almost identical between rxtx 2.0 and 2.1. Only the names have been changed to protect the inocent. :) ie: javax_comm_... vs gnu_io_... So the odds are very likely that even if you do find commapi 2.0 and get it installed, you will run into the same error. It would be better to just find and fix the problem. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Mon May 8 10:47:20 2006 From: mail at willicon.de (WILLICon) Date: Mon, 08 May 2006 18:47:20 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 Message-ID: <445F7618.3070303@willicon.de> Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/ef37e8ec/attachment-0002.html From tjarvi at qbang.org Mon May 8 16:14:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 May 2006 16:14:51 -0600 (MDT) Subject: [Rxtx] Screenshot of Application using RXTX (fwd) Message-ID: Just though someone may end up searching for 0x0D and 0x0A. Here are the details from his system. SuSE Linux 10.0 (x86_64) Kernel 2.6.13-15.8 j2se 1.4.2_11 (i586) Sun: comm3.0_u1 rxtx: rxtx-2.1-7 ---------- Forwarded message ---------- Date: Sat, 6 May 2006 20:01:46 +0200 From: Michael Poppitz To: taj at www.linux.org.uk Subject: Screenshot of Application using RXTX Hi Trent, the rxtx package works like a charm. Sun's package seemed to replace all 0x0D with 0x0A in received data on my Linux box, which is really annoying when transfering binary data. But rxtx came and saved the day - and turned out to be a lot more convenient as it does not require a configuration file. I use it for connecting to a home made logic analyzer. (http://www.sump.org/projects/analyzer/) Thanks for your great job, Michael -------------- next part -------------- A non-text attachment was scrubbed... Name: la_client.png Type: image/png Size: 16592 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/45494fbb/la_client-0002.png From tjarvi at qbang.org Tue May 9 14:56:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 May 2006 14:56:05 -0600 (MDT) Subject: [Rxtx] RXTX javax.comm: which one to install? In-Reply-To: <20060509161742.43547.qmail@web53814.mail.yahoo.com> References: <20060509161742.43547.qmail@web53814.mail.yahoo.com> Message-ID: On Tue, 9 May 2006, Adenilson Cavalcanti wrote: > Dear Trent Jarvi > > I'm trying to write a small Java app running in linux that interfaces with a device connected to serial port. > > I do have some questions about RXTX and javax.comm state of affairs, since I'm new to Java programming (used to program in plain old C writting to devices using termios and open/write/read syscalls, but this is another story). > > I ask you the favor to clarify this issues (if possible...): > > a) Sun offers to download a file (comm3.0_u1_PUTAUNIXVERSION.zip) which does contain .so files. Does it work out of box? > > b) Case negative, its there that we should use 'librxtx*.so' provided by your site? > > c) Sun's comm3 API version does work with which version of rxtx? > > I already searched google and read documentation available in rxtx site ("Java Comm Serial API How-to") but still have this issues unsolved. Any help will be appreciated. > > Best regards > > Adenilson Hi Adenilson, RXTX does not currently support javax.comm in Sun's CommAPI 3.0. I would recommend using package gnu.io provided by rxtx 2.1. -- Trent Jarvi tjarvi at qbang.org From chris.develder at intec.ugent.be Wed May 10 08:45:40 2006 From: chris.develder at intec.ugent.be (Chris Develder) Date: Wed, 10 May 2006 16:45:40 +0200 Subject: [Rxtx] rxtx troubles on ARM Message-ID: <4461FC94.6040909@intec.ugent.be> Hi all, Sorry to bother you, but I don't seem to get RXTX working on an ARM processor (xscale ixp 425, big endian). I managed to crosscompile the rxtx libs and moved it over to the ARM. Using jamvm (which is the only open source java VM we got working on the ARM), I get the following error result when running SimpleRead from Sun's javax.comm examples (commapi\examples\Simple\SimpleRead) -- see bottom of mail for complete output: "java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver" However, output shows that the RXTXCommDriver code is accessible (cf. debug and devel output of lib versions). So it doesn't seem to be a missing lib/jar issue. The error happens before RXTXCommDriver.initialize() is called, since the first line there is System.out.println("RXTXCommDriver:initialize()"); Any ideas? Cheers, Chris ---------------------------- [root at xxx(ttyp1) /work/cdvelder/xscale/test]# jamvm -Djava.library.path=/work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/jre/lib/arm -classpath /work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/lib/ext/RXTXcomm.jar:./comm.jar:. SimpleRead RXTXCommDriver {} Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTXCommDriver: Jar version = RXTX-2.1-7 native lib Version = RXTX-2.1-7 java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver gnu/io/RXTXCommDriver at javax.comm.CommPortIdentifier.loadDriver (CommPortIdentifier.java:239) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:109) at SimpleRead.main (Unknown Source) java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive (Native Method) at com.sun.comm.Portmapping.registerCommPorts (Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase (Portmapping.java:100) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:138) at SimpleRead.main (Unknown Source) From joachim at buechse.de Fri May 12 00:44:48 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 08:44:48 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) Message-ID: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Good day, I guess that only a selected few (hi Trent) will be able to answer this question, but the answer might be interesting for anyone trying to debug or understand the code. Apparently the MonitorThread is started and stopped in RXTXPort.addEventListener and RXTXPort.removeEventListener. This would indicate that (originally?) the MonitorThread is only required when there is an EventListener. However the MonitorThread is also started in the RXTXPort constructor, which could mean that RXTX won't work at all if it isn't there. It seems to me, that if anyone would add an event listener and later on remove it, he could potentially wreak the port. Because the second action would kill the MonitorThread. For the moment I am only trying to understand the role of and idea behind the MonitorThread. But of course there is a deeper reason thor my question: If the MonitorThread needs to exist anyway, it could be the thread that cleans up the port (ie calls nativeClose) - this would eliminate (a further) problem I am seeing with some USB drivers on Mac OSX. (Close blocks (after releasing the tty, but still) in the USB driver if the device is "not responding"). Greetings, Joachim From tjarvi at qbang.org Fri May 12 07:10:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 12 May 2006 07:10:59 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Fri, 12 May 2006, Joachim Buechse wrote: > Good day, > > I guess that only a selected few (hi Trent) will be able to answer > this question, but the answer might be interesting for anyone trying > to debug or understand the code. > > Apparently the MonitorThread is started and stopped in > RXTXPort.addEventListener and RXTXPort.removeEventListener. This > would indicate that (originally?) the MonitorThread is only required > when there is an EventListener. However the MonitorThread is also > started in the RXTXPort constructor, which could mean that RXTX won't > work at all if it isn't there. > > It seems to me, that if anyone would add an event listener and later > on remove it, he could potentially wreak the port. Because the second > action would kill the MonitorThread. > > > For the moment I am only trying to understand the role of and idea > behind the MonitorThread. But of course there is a deeper reason thor > my question: > > If the MonitorThread needs to exist anyway, it could be the thread > that cleans up the port (ie calls nativeClose) - this would eliminate > (a further) problem I am seeing with some USB drivers on Mac OSX. > (Close blocks (after releasing the tty, but still) in the USB driver > if the device is "not responding"). > Hi Jaochim Before commapi, rxtx did not support events. You could read, write and change port settings. The MonitorThread was added as an afterthought to support commapi events. So the way things are now his historical spaghetti not a well devised plan. It is my opinion that the MonitorThread should exist as long as the port is open. The odd starting of the thread in the constructor and addEventListener was just to get past the obvious problem of people using the port without adding listeners. -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Fri May 12 07:59:50 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 15:59:50 +0200 Subject: [Rxtx] MonitorThread -> ChangeRequest In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: <2B1E508C-8CEE-4AB7-914D-E7BA25C871A2@buechse.de> In this case I suggest removing the starting/stopping of MonitorThread in addEventListener / removeEventListener. This should not affect existing projects. On 12.05.2006, at 15:10, Trent Jarvi wrote: > It is my opinion that the MonitorThread should exist as long as the > port > is open. The odd starting of the thread in the constructor and > addEventListener was just to get past the obvious problem of people > using > the port without adding listeners. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Fri May 12 11:43:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 19:43:21 +0200 Subject: [Rxtx] Spring Cleaning - some suggestions Message-ID: The current implementation of RXTX contains quite a lot of code that will break if it is used from several threads (especially on a multi processor machine). I think it would be nice to clean this up. I suggest the following changes (which keep the current semantics and should not influence existing projects in a negative way): - InterruptedException will never be ignored or reset - read methods will be protected with a Monitor - write methods will be protected with a (separate) Monitor - close() sets the read and write monitors into a "closed" state which will lead to IOExceptions for any following call to RXTXPort.read/write. - close() will wait a finite amount of time (maybe 500ms) for the release of the read and write monitors after that, it will trigger the closing of the file descriptor to abort any pending read or write. - close() will not call close(file_desc). Instead it will "interrupt" (ie set a flag and then, pthread_kill(ABRT)) the MonitorThread, the MonitorThread will call close(file_desc). - the monitors are properly released in a finally block the try of which starts directly after obtaining the monitor. - finally will not call close(file_desc) it will only "interrupt" the MonitorThread (see above) - the native-code (esp read) does not use SA_RESTART but checks Thread.interrupted() when it receives a SIGNAL (ie system call returns with EINTR or other signalling method). The read/write monitors will be allocated from a factory whose mode can be set to fast/normal/advanced. In fast-mode it will create "non thread safe, non synchronized" pseudo-monitors. In default mode, the monitors will store the owning thread. In "advanced" mode setting the monitors into closed state will "interrupt()" threads which are blocked in a native read/write. {Reasoning close behaviour: Calling close on a file descriptor in Windows unblocks any read() or write() on the same file descriptor with an error. On Solaris < 2.7 and MacOS X however the close() will/ can block - until the read or write have finished:-(( Even the JDK people have trouble with this. I dont know how Linux reacts in this case. The best practice for BSD/Solaris is to send a signal to the thread which will usually unblock the read/write with an EINTR - this however is not guarenteed as it also depends on the device driver. So the only resolution that will certainly not block the thread calling RXTXPort.close() (which will often enough be the AWT event dispatcher or the VM finalizer thread) is to call close(fd) from another thread.} {Reasoning read behaviour: It is rather uncommon to receive a signal while reading or writing - it will happen, but checking Thread.interrupted() when it happens will not degrade performance. The checking of Thread.interrupted() can be handled by returning to Java and potententially reentering into the native code if the thread was not interrupted or by calling back into the VM from the native code. On top of this, many functions like read(byte[]) or read(byte [], int, int) are allowed to return less than the requested amount of data. Only int read() is a bit more tricky. } [Trent: From the code I can tell, that you experimented quite a bit with signals. Do you know if the Java Thread.interrupt() triggers a unix signal on Linux/Solaris? If so, which one?? References: - http://java.sun.com/docs/hotspot/VMOptions.html - http://www.hp.com/products1/unix/java/infolibrary/prog_guide/ signals.html ] On OS X (hotspot client jdk-1.4.2) I did not see any signal propagated to the SELECT of the event_loop/MonitorThread (ie no EINTR) when I call monThread.interrupt(). This is a pitty, but thats the way it is. I simply assume this is true for most system calls. How to handle this? Of course it would be possible to install/ deinstall a specific signal handler before/after every native read and to natively send an ABRT signal if RXTXPort.close is called. A more elegant solution might be to have an additional "signaling" socket which is always included in the SELECT. Or the simplest solution: cap the timeout of the select to 500 ms (the loop around it exists already) after every timeout check the Thread.interrupted() flag. From a performance perspective this should be completely invisible... On the other hand, all write() calls need to be preceeded by a SELECT as well, to avoid running into a blocking write. Best regards, Joachim From lyon at docjava.com Sat May 13 05:54:52 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 13 May 2006 07:54:52 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Dmitry suggests that we acquire an implementation of a serial port reference, use it, then release it (i.e., check it back in). Joachim says that making serial ports thread friendly might be a good idea. This is a good idea. The design pattern that is close to this idea is the "Object Pool Design Pattern". # Object Pool Manage the reuse of objects for a type of object that is expensive to create or only a limited number of a kind of object can be created. It has been described at: http://www.developer.com/java/ent/article.php/626171 and in Marks' book, Patterns in Java, Volume 1. However, the Object Pool is intended to pool objects so that each object is just like every other object. The intent of the Parametric Singleton is to enable others to access the same resource at the same time (as long as the same parameters were used in construction). It sounds like we need a NEW Design Pattern (Oh no, Doug is doing it again!). Yes friends, you got me on a role (roll) :) If you like design patterns, you can thank me later. If you don't like design patterns, blame Dmitry, it was his idea ;) And Dave, thanks for the feedback on Singleton abuse. It has led me to change the way I think about application contexts, which we will see, below. We need (drum roll please): The Parametric Object Pool Design Pattern (POP) By Douglas A. Lyon ABSTRACT The goal of the Parametric Singleton design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values, in a given context. In comparison, the goal of the POP design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values and that only one reference to the class is checked out at a time, in a given context. A context is a namespace for holding identifiers during execution. In Java, A context can be changed in any of several ways. For example, creation of a new class loader, the deserialization of an old POP or the creation of a new process all create a new namespace. The POP Design Pattern combines the Parametric Singleton Design Pattern with the check out mechanism of the Object Pool Design Pattern. This enables unique creation of instances of a class. These instances are cached in a table. When a clients asks for an instance with these parameters, the cache is checked. If the instance is not in the cache it is created. If the instance is available, the clients checks out the instance. A reference is left to the clients that checked out the instance. The POP has the role of creating objects uniquely, from parameters. It also has the role of keeping track of which clients has checked out a given object. This is just like a library keeping track of who borrowed a book. If a resource is left unavailable in a system, a deadlock can occur. Deadlock debugging is facilitated by mapping a resource to the clients that have checked it out. We apply our POP Design Pattern to the retrieval of serial ports. The goal of our system is to make sure that serial ports are checked out to only one client at a time, and that they be checked back in when the client is done. The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. Users are discouraged from calling this the Parametric Object Oriented Pool (POOP). Introduction The intent of the POP Design Pattern is to ensure that a class has only one instance for a given set of parameter values. It also provides a point of access that is global to a given context. The POP uses the Singleton Design Pattern to ensure that there is only one POP, in the given context. The POP DP is responsible for checking out a reference to a given instance, and keeping track of that instance. The instance is responsible for sharing that instance. POP requires that users of the DP implement an interface that enables a recall facility. Thus, if there is a contention for a consumed resource, the deadlock can be resolved in an orderly fashion. Motivation A system cannot tolerate multiple instances of some classes with identical parameters used by different instances at the same time. For example, you cannot have two instances use the same serial port, at the same time. You cannot have two instances that are trying to listen to the same socket connection. You cannot have two instances writing to the same file structure at the same time. Further, once a serial port is checked out by a client, it is assigned to the client. This is like the spin-lock service provided by the operating system, only in the application layer. Naturally, deadlock will occur if a resource is not released, therefore the client of the resource is tracked. Recalling a resource is required for the POP DP by virtue of the implementation of an interface. The policy on how to break a deadlock (by honoring the recall) is application specific. As the operating system is often thought of as the arbiter of consumed resources (i.e., tape drives, serial ports, etc.) we frequently leave it to an operating system implementation to resolve these contention issues. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on naming conventions (which are not well standardized). The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. The POP Design Pattern can take on the role of the peer method mapper that homogenizes the API for different operating environments. That is, it can wrapper the different locking mechanisms used in different operating systems. POP that is responsible for keeping track of the instances created and the client that has checked them out. The POP Design Pattern is implemented using the Singleton Design Pattern. In Java, the POP implementation is declared final, so that it cannot be subclassed. The class also has a private constructor, so that other classes cannot instance it. The new design pattern is called the POP design pattern and it provides a way to check out and create instances with given parameters. Applicability Use the POP Design Pattern when: 1. There must be exactly one instance of a class with the given parameters in a given context. 2. The instances must be accessible to clients from a well-known access point. 3. The instances are reusable. 4. Only one client can check out an instance at a time. Structure Insert UML diagram here. Participants The POP Clients that need instances 1. The POP defines an instance upon request from a client, if, and only if, the instance does not already exist. 2. The POP returns the instance to the client. 3. The POP is responsible for creating unique instances from given parameters. 4. The POP is responsible to recalling instances from clients. Collaborations Clients obtain a reference to a POP instance only through the singleton design pattern. If the POP instance is left in an improper state (e.g., the serial port was left open) it is NOT the role of the POP to close the IO port. However, the POP can be requested to get the instance released. Nor is it the role of the POP Design Pattern to open the port. That role is delegate to some other part of the system. Further, it is the role of the POP Design Pattern to check out resources. However, it is still possible to have, multiple threads that have multiple references to the same resource at the same time. Checkout and resource requests are MUTEX locked (i.e., synchronized). Consequences The POP Design Pattern has several benefits: 1. Controlled access to parametrically defined instances. Since the POP encapsulates its instances, there is some limited control over how and when clients access it. 2. Reduced name space. The POP pattern avoids global variables that store instances created from the same parameter. Implementation Here are implementation issues to consider when using the POP pattern: 1. Unique mapping of parameters. The POP pattern requires that there be a mean to isomorphically map the parameter space into the instance space and back again. 2. Ensure unique instances. The POP pattern makes unique instances from parameters, and it does so only once. 3. Cache instances for fast retrieval. The POP must be able to look up instances, given some set of parameters, and do so from some data structure. That is, there must be enough space to hold references to all the instances the program will need. Also, a mechanism is needed to look up and retrieve the instances quickly enough to satisfy the clients. Sample Code To be written....any volunteers? Thanks! - Doug >I don't think I get it > >On Mar 22, 2006, at 9:36 AM, David Garnier wrote: >>Using the singleton pattern in this case is >>just convenient for the programmer. Problems >>arises >>pretty quickly, especially if you attempt to unit-test your classes. > > >so you're saying that something isn't so good >because you can not test it in the convenient >way? >if that's true, I'm totally disagree >change your test, debug whatever, but if >software is efficient at runtime, works fine and >only problem is some unit test >(which is some kind of framework for testing) >then dump that unit test , dump that unit >framework and make something appropriate to the >software >you're testing > >so if Douglas want to use singletons, what's the problem? >and what do you mean by abusing of singleton usage? > >of course singleton doesn't prevent concurrent >access to the resource across the processes >unless >you're using some OS facility to prevent it, besides >singleton as it was introduced is relevant only >and only inside of the same process >otherwise it's not singleton it's something else >(let's say network singleton: so you have remote >invocation facility >and some factory method that return object created by that facility) > >I don't have any problem with using any kind of singletons. > Parametric Singleton idea (if I understand it >right) could be easily implemented in the >following way: >use a map >populate map with instances of some class and key is your parameter >(you can use lazy population too) > >if somebody ask the key check the value if it's null so resource is taken >if somebody returns the resource put it back to the map > >public synchronized static Object getSomeResource(Object parameter); >public synchronized static void returnResource(Object parameter); > >getSomeResource (inside of the same process) could return null in 2 cases >1. if somebody (from other thread for example) already took that resource >2. if OS API said that resource corresponded to >that parameter (serial port with parameter = 1 >(port #)) >is locked and unavailable; >I'm not sure that in case of serial ports we >even need those Parametric Singletons >(unless lock checking is a very expensive operation) >just ask the OS about availability of that >resource and if it's available give it away >and then OS will lock it and therefore in next >time somebody ask it just answer that resource >is locked >and return null > >for example system has 2 serial ports available >so I ask getResource("tty"); >or I ask getResource("Bluetooth-Modem"); > >and if OS is ok you can give tty or Bluetooth-Modem or both > >no need for any additional pattern I think > >back to the problem >mac os x doesn't recognize locking via files, so >it handles locking via some API >an instance of the singleton in each process >should recognize that resource is locked >(by using that API) that's all >we don't have to make things more complicate >then they are just because there is some nice >design pattern or nice unit test framework or whatever >keep things simple, make them work fast, don't introduce middle layers >unless you have really good reason to do so > >of course I could be entirely wrong, so sorry about that in advance > >thanks > > >Dmitry Markman > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx >Good day, > >I guess that only a selected few (hi Trent) will be able to answer? >this question, but the answer might be interesting for anyone trying? >to debug or understand the code. > >Apparently the MonitorThread is started and stopped in? >RXTXPort.addEventListener and RXTXPort.removeEventListener. This? >would indicate that (originally?) the MonitorThread is only required? >when there is an EventListener. However the MonitorThread is also? >started in the RXTXPort constructor, which could mean that RXTX won't? >work at all if it isn't there. > >It seems to me, that if anyone would add an event listener and later? >on remove it, he could potentially wreak the port. Because the second? >action would kill the MonitorThread. > > >For the moment I am only trying to understand the role of and idea? >behind the MonitorThread. But of course there is a deeper reason thor? >my question: > >If the MonitorThread needs to exist anyway, it could be the thread? >that cleans up the port (ie calls nativeClose) - this would eliminate? >(a further) problem I am seeing with some USB drivers on Mac OSX.? >(Close blocks (after releasing the tty, but still) in the USB driver? >if the device is "not responding"). > >Greetings, >Joachim > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Sat May 13 10:07:37 2006 From: joachim at buechse.de (Joachim Buechse) Date: Sat, 13 May 2006 18:07:37 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Douglas, Looking at the current code, leaves me with the feeling, that there is a lot to do. Defining an API that wraps javax.comm to provide what you describe is certainly possible, but I wonder how much benefit it will actually provide. Personally I think the API defined by javax.comm "request/lock" a port with: cp= new CommunicationPort(identifier) "release" a port with: cp.close(); works quite nice for 99% of the applications. In my experience, the most efficient and elegant implementation is to wrap a port/socket/.. into a business object which declares the remote operations that are possible. Ie "uploadFile", "waitForPrompt", "getSerialNumber", "sendContact", "executeCommand", etc Those methods are then either synchronized or guarded by a monitor. I do not see how your design pattern applied to the port resource would help implementing this. [details start, skip if you agree to the above] When I talked about "thread-safe" I didn't mean several independent "sessions" accessing the port concurrently. I think this is a very rare usage. I believe the most common use case for serial ports today is the control of an external device from a PC running a GUI based application. To implement a clean Swing/AWT-GUI one needs to pass any action that can block to a "worker" thread (else the GUI blocks, the application appears dead). While it is possible to use own prespawned thread that will accept Runnables which operate on the port, this is not very elegant. It is more common to spawn a new thread for every action triggered by the user. Additionally the ABORT of a running operation is often implemented via a port.close() delegated to a different thread. - During the lifetime of a port, it will usually be accessed from several different threads. Instance variables need to be set/read in synchronized regions to guarantee a correct operation based on the Java memory model. - Synchronizing the access is usually handled on the application level (synchronizing the reads/writes is usually useless from the applications view because it is not a transaction mechanism). [details end] I am very open to learn about other scenarios where your proposed design pattern applied to the port resource is beneficial to the application implementor. Best regards, Joachim On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > Dmitry suggests that we acquire an implementation of > a serial port reference, use it, then release it (i.e., check it > back in). > > Joachim says that making serial ports thread friendly might be a > good idea. > > This is a good idea. The design pattern that is close to this idea > is the "Object Pool Design Pattern". > # Object Pool From jredman at ergotech.com Sun May 14 14:28:24 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 14:28:24 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers Message-ID: <446792E8.4000506@ergotech.com> Does anyone know of any work to make RXTX work with Ethernet (telent) Terminal Servers? If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? We've used RXTX with upwards of 100 virtual COM ports on Windows and it works well. Linux is more problematic. It would be good to have an OS independent solution to accesses remote Ethernet serial ports. Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From legolas.w at gmail.com Sun May 14 14:26:34 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:56:34 +0430 Subject: [Rxtx] does any one have a working sample of RXTX and LPT port Message-ID: <4467927A.4000008@gmail.com> Hi Thank you for reading my post does any one has a working sample for RXTX and LPT port ? Thanks From legolas.w at gmail.com Sun May 14 14:27:29 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:57:29 +0430 Subject: [Rxtx] does RXTX support Trigerr on parallel port? Message-ID: <446792B1.4040905@gmail.com> Hi does RXTX support trigger on LPT port ? if so , how i can use it ? Thanks From tjarvi at qbang.org Sun May 14 17:40:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 17:40:59 -0600 (MDT) Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: <446792E8.4000506@ergotech.com> References: <446792E8.4000506@ergotech.com> Message-ID: On Sun, 14 May 2006, Jim Redman wrote: > Does anyone know of any work to make RXTX work with Ethernet (telent) > Terminal Servers? > > If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 > Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? > Hi Jim It appears the author of NVTCom has decided to release the library into the public domain. Integration with rxtx is possible but it would be best to contact the author and find out what his intent is. I would suggest contacting the author with a proposal of what you would like to do and take it from there. We could 'take' public domain software but its better to show respect to the authors and respect their wishes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:10:23 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:10:23 -0600 (MDT) Subject: [Rxtx] does any one have a working sample of RXTX and LPT port In-Reply-To: <4467927A.4000008@gmail.com> References: <4467927A.4000008@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > Thank you for reading my post > does any one has a working sample for RXTX and LPT port ? > Thanks Hi Legolas LPT port support in rxtx is spotty. That means some people have sent in patches for what they do and it works well for them. The original code was not very good. It may have been 3 hours work :/ To get started, Sun has some demo programs with their commapi. With rxtx 2.1 you can change their code from using javax.com to gnu.io and it -should- work. But if it does not you can post here and on bugzilla. There has been more interest lately off the list and maybe there will be enough community resources to get what you need going. If you do get a sample program together, we would gladly put it in the contrib directory so the next person can get things going faster. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:12:12 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:12:12 -0600 (MDT) Subject: [Rxtx] does RXTX support Trigerr on parallel port? In-Reply-To: <446792B1.4040905@gmail.com> References: <446792B1.4040905@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > does RXTX support trigger on LPT port ? > if so , how i can use it ? > Hi Legolas As mentioned in the previous post, rxtx parallel support is not very mature. But if you can point to something that describes the trigger feature, we can probably make sure its there and give a quick code example. -- Trent Jarvi tjarvi at qbang.org From jredman at ergotech.com Sun May 14 22:22:48 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 22:22:48 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: References: <446792E8.4000506@ergotech.com> Message-ID: <44680218.4080008@ergotech.com> Trent, Trent Jarvi wrote: > On Sun, 14 May 2006, Jim Redman wrote: > >> Does anyone know of any work to make RXTX work with Ethernet (telent) >> Terminal Servers? >> >> If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 >> Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? >> > > Hi Jim > > It appears the author of NVTCom has decided to release the library into > the public domain. Integration with rxtx is possible but it would be best > to contact the author and find out what his intent is. > > I would suggest contacting the author with a proposal of what you would > like to do and take it from there. We could 'take' public domain software > but its better to show respect to the authors and respect their wishes. > I sent Marco(?), the author of the library, a note before asking the list - I'll let you know the response. If anyone is already working on it, or has an interest and more time and energy than me, I'd hate to duplicate the efforts. If no one is, and no one objects, maybe I'll see what I can do. Jim > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From Christian.Klemke at t-online.de Mon May 15 02:23:06 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Mon, 15 May 2006 10:23:06 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu><004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: <008a01c677f8$cae18590$02fea8c0@NB600> Hi Trent, Hi Paul, I finally found some time to create a simple patch to enable the optional suppression of version output to the console. It is based on a new system property called "gnu.io.rxtx.NoVersionOutput" which can by set to "true" if necessary. I had some problems accessing CVS, therefore I downloaded the rxtx-2.1-7r2 source archive from ftp.qbang.org (which is linked on the rxtx.org download page) and worked with that release. Please find my proposed patch in the attachment ! Regards, Christian ----- Original Message ----- From: "Trent Jarvi" To: "RXTX Developers and Users" Cc: ""Paul Gettings"" Sent: Friday, May 05, 2006 2:09 PM Subject: Re: [Rxtx] RXTX causing stdout messages > On Fri, 5 May 2006, Christian Klemke wrote: > >> Hi Paul, >> >> I was wondering about the same question some days ago and took a look at >> the >> source files. Unfortunately, I found that you can only get rid of that >> messages by altering and recompiling the Java code. There is a final >> static >> boolean variable called "devel" in the file "RXTXCommDriver.java" which >> is >> set to "true". This constellation causes the output after the native >> libraries have been loaded. No mechanism exists to suppress them >> otherwise >> :-(. >> >> Trent, does that mean that 2.1.7 is still officially a "development" >> version >> ? When will this value be changed to "false" by default ? With 2.1.8 ? It >> would be nice to provide a means to suppress such messages besides that >> static flag (maybe by setting a property called >> "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The >> output can indeed by annoying, especially when used with console >> applications, where the message potentially appears "in the middle" of >> your >> own output. Another possibility would be not to use System.out directly, >> but >> instead some PrintStream field which is initially set to System.out but >> can >> programatically be changed. That would allow for any kind of redirection >> or >> suppression by implementing appropriate user-defined PrintStream >> subclasses >> and making RXTX use that stream. What do you think ? >> > > A patch for using properties would be accepted I'm sure. > > The reason the default is to display the message is not related to the > development state of rxtx anymore. The problem is that people first using > rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. > The message prevents a great deal of email thats easily explained by the > message. > > I question if we should support rxtx 2.0 at all anymore. > > If you post a patch in bugzilla, we'll put it into CVS this weekend. > we'll be going through and doing such things anyhow. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_version_output_patch.diff Type: application/octet-stream Size: 991 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060515/3173c2b6/rxtx_version_output_patch-0002.obj From lyon at docjava.com Mon May 15 06:06:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 May 2006 08:06:21 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Joachim makes several good points. Let me see if I can address some of them below: >Hello Douglas, > >Looking at the current code, leaves me with the feeling, that there? >is a lot to do. Yes! >Defining an API that wraps javax.comm to provide what? >you describe is certainly possible, but I wonder how much benefit it? >will actually provide. > >Personally I think the API defined by javax.comm > >"request/lock" a port with: > cp= new CommunicationPort(identifier) >"release" a port with: > cp.close(); > >works quite nice for 99% of the applications. I don't know what percentage of applications turn off locking, the way that I do in my version of the RXTX lib. I do know that this is not safe practice. I also know that it was motivated by the multi-platform nature of my code and that this was the only way I could make things work, at the time. Java does not appear to have a cross-platform standard for locking resources on various platforms. Each OS appears to have its own standard. The question of who breaks deadlocks and how this is done remains open, as this is not an easy question to resolve. Let me continue, below: > >In my experience, the most efficient and elegant implementation is to? >wrap a port/socket/.. into a business object which declares the? >remote operations that are possible. Ie "uploadFile",? >"waitForPrompt", "getSerialNumber", "sendContact", "executeCommand",? >etc Those methods are then either synchronized or guarded by a? >monitor. I do not see how your design pattern applied to the port? >resource would help implementing this. I have no problem with high-level wrappers that are application specific. That is a very good idea, but orthogonal with respect to the issue of deadlocks. More below: > >[details start, skip if you agree to the above] >When I talked about "thread-safe" I didn't mean several independent? >"sessions" accessing the port concurrently. I think this is a very? >rare usage. That is probably why turning locking off works so well! On the other hand, it is not safe and I shouldn't do it. >I believe the most common use case for serial ports today? >is the control of an external device from a PC running a GUI based? >application. To implement a clean Swing/AWT-GUI one needs to pass any? >action that can block to a "worker" thread (else the GUI blocks, the? >application appears dead). While it is possible to use own prespawned? >thread that will accept Runnables which operate on the port, this is? >not very elegant. It is more common to spawn a new thread for every? >action triggered by the user. Additionally the ABORT of a running? >operation is often implemented via a port.close() delegated to a? >different thread. Here lies the heart of serial port concern. An application opens a serial port and then dies. The application is restarted and finds the port locked. How do we clear the lock? Must the application's user reside in the UUCP group? Must installers of the serial port add users to the UUCP group? Should locking be handled at a high-level of abstraction in an operating system independent way? Should the implementation of the locking mechanism be translated into an API that is dependent on the OS convention? Suppose that we restrict the discussion to serial ports. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on inconsistent naming conventions. Hence my feeling that we need to mirror what is done in other API's; we need a locking toolkit that references peer methods, IMHO. >From the Java programming point of view, the locking API is portable across different platforms, but has, as its implementation, a native peer method that uses the conventions of the underlying OS. This enables portable resource locking (in theory!). Consider, for example: org.apache.commons.transaction.locking with: Interface LockManager at: http://jakarta.apache.org/commons/transaction/apidocs/org/apache/commons/transaction/locking/LockManager.html Or, more recently: java.util.concurrent.locks Interface Lock based on Doug Lea's code: http://kickjava.com/src/EDU/oswego/cs/dl/util/concurrent/ReadWriteLock.java.htm Should we incorporate a clean, portable design into serial port use, one that is consistent with current locking APIs? Basically, a comm port is a resource and resources are typically controlled by managers. Thus, I suggest that we make use of a CommPortManager to help control and centralize serial port usage. The question of how this is done remains open, IMHO, but using core API's like: java.util.concurrent.locks might not be amiss. High-level methods (getAllPorts, getAllSerialPorts, getAllParallelPorts, etc...) might be welcome additions. Basic questions like, "what if a port is in use?" remain open, hence my proposal for the new design pattern. Isn't it the CommPortManager's role to break the deadlock? Cheers! - Doug > >- During the lifetime of a port, it will usually be accessed from? >several different threads. Instance variables need to be set/read in? >synchronized regions to guarantee a correct operation based on the? >Java memory model. >- Synchronizing the access is usually handled on the application? >level (synchronizing the reads/writes is usually useless from the? >applications view because it is not a transaction mechanism). >[details end] > >I am very open to learn about other scenarios where your proposed? >design pattern applied to the port resource is beneficial to the? >application implementor. > >Best regards, >Joachim > >On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > >> Dmitry suggests that we acquire an implementation of >> a serial port reference, use it, then release it (i.e., check it? >> back in). >> > > Joachim says that making serial ports thread friendly might be a? >> good idea. >> >> This is a good idea. The design pattern that is close to this idea >> is the "Object Pool Design Pattern". >> # Object Pool > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Mon May 15 06:58:19 2006 From: joachim at buechse.de (Joachim Buechse) Date: Mon, 15 May 2006 14:58:19 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Doug, I agree fully, that locking of the system resource should be abstracted from the user (programmer). Currently this is already the case, but I agree it might be nice to extract the code into a separate class, which uses platform dependent providers to do its job. What I described in my email was not targeted at allocating the system resource, but at handling an already allocated system resource inside the framework. I agree that it may be possible to combine the two - however, I would suggest to do this in phase2. I can contribute a work over of RXTXPort.java which implements clean internal locking and proper close behavior (which I would call phase 1). I could do this this week. However I strongly believe that there is little sense in trying to do this as a series of patches. It will be closer to a rewrite than to a patch. I have already provided a number of suggested patches via Bugzilla, but this is quite inconvenient (for me). My working copy diverges more and more from the master and hence it gets more and more annoying to provide self contained patches. Best regards, Joachim From tjarvi at qbang.org Mon May 15 08:27:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 May 2006 08:27:51 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Mon, 15 May 2006, Joachim Buechse wrote: > Hello Doug, > > I agree fully, that locking of the system resource should be > abstracted from the user (programmer). Currently this is already the > case, but I agree it might be nice to extract the code into a > separate class, which uses platform dependent providers to do its job. > > What I described in my email was not targeted at allocating the > system resource, but at handling an already allocated system resource > inside the framework. I agree that it may be possible to combine the > two - however, I would suggest to do this in phase2. > > I can contribute a work over of RXTXPort.java which implements clean > internal locking and proper close behavior (which I would call phase > 1). I could do this this week. > > However I strongly believe that there is little sense in trying to do > this as a series of patches. It will be closer to a rewrite than to a > patch. I have already provided a number of suggested patches via > Bugzilla, but this is quite inconvenient (for me). My working copy > diverges more and more from the master and hence it gets more and > more annoying to provide self contained patches. > For methodical testing purposes (which does go on) the incremental patches are better. I'm lagging behind in bugzilla but thats soon to change (this week). It has just been rather chaotic up until now. I moved, purchased a house, and jumped into the fire of a feature freeze timeframe at a new job. btw, we see the Solaris close issues on 2.8 also. 9 and 10 are fine. I'll work towards making those test results public and allow others to run new rxtx code through them. We had the OK at one point but setting up the environment is involved. It isn't just a collection of java classes. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Tue May 16 02:01:47 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:01:47 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] Message-ID: <446986EB.209@willicon.de> Hi, any ideas for my problem? Hans -------- Original-Nachricht -------- Betreff: [Rxtx] Problem under Mac OSX 10.3.9 Datum: Mon, 08 May 2006 18:47:20 +0200 Von: WILLICon Antwort an: RXTX Developers and Users An: RXTX Developers and Users Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/b0741c2b/attachment-0002.html From joachim at buechse.de Tue May 16 02:15:08 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 10:15:08 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: Hello Hans, I am using RXTX on OS X for my own project. I do not see the problem you describe. I had some troubles installing it because the current version uses lock files which is non-standard on OS X. I have created a patched version which I currently use. This version does not need to modify user groups and hence does not need an installer. I just pop it in the application directory. If you send me a link where I can download your OSX installer, I will have a quick look. Regards, Joachim On 16.05.2006, at 10:01, WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we > have some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + > spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + > spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always > the value "false". > I can only get the status, while I open the port and catch the > exception. > > Any ideas? > > Hans > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail at willicon.de Tue May 16 02:26:53 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:26:53 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: References: <446986EB.209@willicon.de> Message-ID: <44698CCD.7050709@willicon.de> Joachim, tanks for the answer. I'll send You a mail. Hans Joachim Buechse schrieb: > Hello Hans, > > I am using RXTX on OS X for my own project. I do not see the problem > you describe. > > I had some troubles installing it because the current version uses > lock files which is non-standard on OS X. I have created a patched > version which I currently use. This version does not need to modify > user groups and hence does not need an installer. I just pop it in > the application directory. If you send me a link where I can download > your OSX installer, I will have a quick look. > > Regards, > Joachim > > On 16.05.2006, at 10:01, WILLICon wrote: > > >> Hi, >> >> any ideas for my problem? >> >> Hans >> >> -------- Original-Nachricht -------- >> Betreff: [Rxtx] Problem under Mac OSX 10.3.9 >> Datum: Mon, 08 May 2006 18:47:20 +0200 >> Von: WILLICon >> Antwort an: RXTX Developers and Users >> An: RXTX Developers and Users >> >> >> Hi, >> >> I use for RXTX for communicate with CyclingComputers. >> >> It works good under Win32, Sloaris and Linux but with Mac OSX we >> have some problems. >> >> My users install the Mac OSX serial lib from the actual binary. >> >> After starting the program, they get this error message: >> >> java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while >> loading gnu.io.RXTXCommDriver >> >> Remember, this error comes only under Mac OSX. >> >> That is the code for the error: >> >> Enumeration portList = CommPortIdentifier.getPortIdentifiers(); >> spInUse = getBundleStr("serialPortInUse"); >> spFree = getBundleStr("serialPortFree"); >> while (portList.hasMoreElements()) { >> CommPortIdentifier portId = (CommPortIdentifier) >> portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (osName != null && osName.startsWith("mac")) { >> if (!portId.getName().startsWith("dev/cu.")) { >> continue; >> } >> } >> if (portId.isCurrentlyOwned()) { >> serialPortNames.add(portId.getName() + " - " + >> spInUse); >> } >> else { >> serialPortNames.add(portId.getName() + " - " + >> spFree); >> } >> } >> } >> if (serialPortNames.size() == 0) { >> serialPortNames.add(getBundleStr("serialPortNotFound")); >> } >> >> BTW: The methode isCurrentlyOwned() is not working. I get always >> the value "false". >> I can only get the status, while I open the port and catch the >> exception. >> >> Any ideas? >> >> Hans >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/948333be/attachment-0002.html From jredman at ergotech.com Tue May 16 07:35:52 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 16 May 2006 07:35:52 -0600 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: <4469D538.6070408@ergotech.com> Hans, I have no direct insight, but would note that what you have is a "NoClassDefFoundError" not a "ClassNotFoundException". So the class javax/comm/CommDriver is found, but one of its dependencies is missing. NoClassDefFoundError are a bigger problem to resolve because you get no indication of the real problem. Jim WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we have > some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > * spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always the > value "false". > I can only get the status, while I open the port and catch the exception. > > Any ideas? > > Hans > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.de Tue May 16 08:01:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 16:01:21 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 In-Reply-To: <4469AFC3.6000002@willicon.de> References: <44698EBC.8000008@willicon.de> <8C5680C4-E2BA-42FF-B221-36E1124FA6A4@buechse.de> <4469AFC3.6000002@willicon.de> Message-ID: <9825A602-D6ED-4C28-BF33-9A7C984FACD5@buechse.de> Hallo Hans, you include RXTX 2.17 in your "bikeXexperience.jar" (2.17 uses Interfaces from gnu.io.* not javax.comm.*). Now inspect your error log closely: The class gnu.io.RXTXCommDriver tries to load javax.comm.CommDriver: this is only the case for RXTX 2.07. I assume, that the user has installed Version 2.07 into one of the java.ext.dirs . The VM always tries to load classes from the "system" path first. The current Mac installer distributed with RXTX in fact installs RXTXcomm.jar and librxtxSerial.jnilib into /Library/Java/Extensions. (I wrote some time ago that I consider this as a bad idea because of potential version conflicts-> thanks for delivering the example). For 2.07 it does so without installing the javax.comm classes it seems. I would recommend that you instruct your users to install version 2.17 only. Until RXTX is changed to use TIOCEXCL instead of lock files, you can hardly avoid the installer, as the user needs to be added to a special group and a lockfile directory needs be created. More precisely you are waiting for: http://bugzilla.qbang.org/show_bug.cgi?id=50 [RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL)] Regards, Joachim -------------- next part -------------- A non-text attachment was scrubbed... Name: log.tiff Type: image/tiff Size: 38394 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/e3e52128/log-0002.tiff -------------- next part -------------- > > Ich verwende RXTX 2.17. Das orginal RXTXcomm.jar ist in > CyclingDataManager.jar enthalten. > From tjarvi at qbang.org Wed May 17 23:18:15 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 May 2006 23:18:15 -0600 (MDT) Subject: [Rxtx] update Message-ID: So we have several patches and these have stacked up. I'd like to thank everyone for being patient. Tests for the most intrusive patches look good so far. I still have to get some bits together on my end but it looks like we can catch everything up in CVS this week. I'll try to post a normal list of what went in by whom with links Saturday. But I'm not seeing anything that raises flags yet. I also think I'll be able to submit a patch for nonstandard baud rates. I have to confirm w32 but I think its going to be a one line fix. I don't know if its bugzilla or people tinkering with patch files before submitting but patches are not applying cleanly. So the patches have to be done by hand. This may make things difficult for people hoping to add other patches on top. I'm trying to make that go well but ... -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Thu May 18 02:23:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 May 2006 10:23:47 +0200 Subject: [Rxtx] update In-Reply-To: References: Message-ID: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Hello Trent, in fact I tinkered with the patches (never used this mechanism before, usually I "communicate" via cvs) ... so sorry for any trouble you had applying them. Basicly I edited the patches to make them self contained. Having the tests run with different speeds on different platforms, may well be an effect of caching. I have seen quite interesting propagation delays for the closing flag on my PowerPC system, which makes me doubt, that the propagation of output_buffer_empty_flag works as it should. Maybe the communication mechanism between the two threads should be replaced by something like pthread_cond_*. Could you describe which problems you see on Solaris/SPARC? I'd be interested to see if they exist on OS X (PowerPC) as well... As you seem to work on the stuff at the moment I would like to suggest the following additions (it looks more than it is, I posted some context to make clear where to apply the change). See the comments in braces for what was changed Greetings, Joachim (1) The end of the drain loop could be: --- report("drain_loop: received EINTR in tcdrain\n"); --- (added "in tcdrain" to make debug output clearer) (2) The start of the drain loop should be: --- for(i=0;;i++) { report_verbose("drain_loop: looping\n"); #if defined(__sun__) /* FIXME: No time to test on all OS's for production */ if( eis->eventloop_interrupted ) { goto end; } if (usleep(5000)) { report("drain_loop: received EINTR"); } #else if (usleep(1000000)) { report("drain_loop: received EINTR"); } #endif /* __sun__ */ --- (added a check for "eis->eventloop_interrupted" before the sleep) (3) The end of interrupt_event_loop could (and maybe should) be: --- #if !defined(TIOCSERGETLSR) && !defined(WIN32) /* make sure that the drainloop unblocks from tcdrain */ pthread_kill(index->drain_tid, SIGABRT); /* TODO use wait/join/SIGCHLD/?? instead of sleep? */ usleep(50 * 1000); /* Under normal conditions, SIGABRT will unblock tcdrain. However a non-responding USB device combined with an unclean driver may still block. This is very ugly because it may block the call to close indefinetly. */ if (index->closing != 1) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); index->closing = 1; } #endif report("interruptEventLoop: interrupted\n"); --- (added some comments and pthread_cancel for resisting drain thread) On 18.05.2006, at 07:18, Trent Jarvi wrote: > > So we have several patches and these have stacked up. I'd like to > thank > everyone for being patient. > > Tests for the most intrusive patches look good so far. I still > have to > get some bits together on my end but it looks like we can catch > everything > up in CVS this week. > > I'll try to post a normal list of what went in by whom with links > Saturday. But I'm not seeing anything that raises flags yet. I also > think I'll be able to submit a patch for nonstandard baud rates. > I have > to confirm w32 but I think its going to be a one line fix. > > I don't know if its bugzilla or people tinkering with patch files > before > submitting but patches are not applying cleanly. So the patches > have to > be done by hand. This may make things difficult for people hoping > to add > other patches on top. I'm trying to make that go well but ... > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu May 18 22:28:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 18 May 2006 22:28:00 -0600 (MDT) Subject: [Rxtx] update In-Reply-To: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> References: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Message-ID: On Thu, 18 May 2006, Joachim Buechse wrote: > Hello Trent, > > in fact I tinkered with the patches (never used this mechanism > before, usually I "communicate" via cvs) ... so sorry for any trouble > you had applying them. Basicly I edited the patches to make them self > contained. I think we are close to moving towards that. > > Having the tests run with different speeds on different platforms, > may well be an effect of caching. I have seen quite interesting > propagation delays for the closing flag on my PowerPC system, which > makes me doubt, that the propagation of output_buffer_empty_flag > works as it should. Maybe the communication mechanism between the two > threads should be replaced by something like pthread_cond_*. Could > you describe which problems you see on Solaris/SPARC? I'd be > interested to see if they exist on OS X (PowerPC) as well... This is interesting. I have seen problems with output buffer empty in applications that require it. I'm trying to get a bug list and or test results open for everyone to see but that may take time. But missed output buffer events ... yep. With Sparc, we have seen a few things. One was a kernel race condition that went away when we reimaged and updated 2.8. RXTX was hanging on close, top showed no cpu use but there was 2 second delays just typing on console. The other is our tests now take ~4 times longer on Solaris. Someone is looking at timing just open, close, read, write, ... to see if they can find where the slowdown is. This happened after solaris 2.8. I'll try to share more when/if there is something interesting. This may well not be solvable in userland. > > As you seem to work on the stuff at the moment I would like to > suggest the following additions (it looks more than it is, I posted > some context to make clear where to apply the change). See the > comments in braces for what was changed I'll take a look. This could all come together Saturday but I also have an event to attend that day. I may not wrap this up until Sunday. -- Trent Jarvi tjarvi at qbang.org From andrewlord at internode.on.net Sun May 21 20:10:02 2006 From: andrewlord at internode.on.net (Andrew Lord) Date: Mon, 22 May 2006 11:40:02 +0930 Subject: [Rxtx] Kernel include files do not match kernel Message-ID: <200605221140.03271.andrewlord@internode.on.net> Hi, I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel 2.6.12-18 with the command: ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include However I get the message: ## checking java.version 1.5.0_06 ## checking os.version 2.6.12-18mdk ## ## WARNING: Kernel include files do not match the current kernel ## ## configure: creating ./config.status etc. Is there a problem with the way I'm specifying the 'include' directory ? If not, how else can I specify the correct directory for the include files please ? Cheers, Andrew From tjarvi at qbang.org Sun May 21 20:31:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 May 2006 20:31:31 -0600 (MDT) Subject: [Rxtx] Kernel include files do not match kernel In-Reply-To: <200605221140.03271.andrewlord@internode.on.net> References: <200605221140.03271.andrewlord@internode.on.net> Message-ID: On Mon, 22 May 2006, Andrew Lord wrote: > Hi, > > I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel > 2.6.12-18 with the command: > > ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk > CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include > > However I get the message: > > ## checking java.version 1.5.0_06 > ## checking os.version 2.6.12-18mdk > ## > ## WARNING: Kernel include files do not match the current kernel > ## > ## configure: creating ./config.status > etc. > > Is there a problem with the way I'm specifying the 'include' directory ? If > not, how else can I specify the correct directory for the include files > please ? > Hi Andrew I'm fairly sure your --with-kernel option does nothing. The CPPFLAGS should do what you want. Maybe put an #error message in /usr/src/linux.../incude/linux/version.h But I don't recall a recent problem with version missmatches. It should work. Distros will even ship include files that don't match versions exactly. In theory it should never matter for users. I used to compile new kernels by hand and really didnt have a distro. I didnt have a seperate package of kernel headers for users (myself). When changing a gateway from linux 1.2.12 to 2.1.77, I would worry about such messages. So if you are doing something that weird, the message may be of use to you. If you just see the message on a distro you installed, it is more than likely harmless. -- Trent Jarvi tjarvi at qbang.org From mrogers at spro.net Mon May 22 14:45:39 2006 From: mrogers at spro.net (Mike Rogers) Date: Mon, 22 May 2006 14:45:39 -0600 Subject: [Rxtx] Sun's CommAPI -- think May? Message-ID: <447222F3.9040302@spro.net> Hi, Any word from Sun about progress towards fixing the Java CommAPI v3 "incompatibilities" so RXTX 2.0 can operate within the framework's namespace (javax.comm)? I recall mention of a May time frame. Thanks, Mike From paul.klissner at sun.com Mon May 22 15:09:27 2006 From: paul.klissner at sun.com (Paul Klissner) Date: Mon, 22 May 2006 14:09:27 -0700 Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <447222F3.9040302@spro.net> References: <447222F3.9040302@spro.net> Message-ID: <44722887.8080308@sun.com> Mike Rogers wrote: > Hi, > > Any word from Sun about progress towards fixing the Java CommAPI v3 > "incompatibilities" so RXTX 2.0 can operate within the framework's > namespace (javax.comm)? I recall mention of a May time frame. > > Thanks, > > Mike > We've had a lot of work come in. This hasn't been the only priority. I'm running behind the plan in addressing this, but will be looking at it again soon. Rather than state a new, I'll just say it is in progress, and not off the table. I'll get this fixed as soon as I can. Good timing for asking as we just started discussing javax.comm plans today, and I'll have some cycles to work on it soon. Paul From yhua537 at cse.unsw.edu.au Mon May 22 16:03:05 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Tue, 23 May 2006 08:03:05 +1000 (EST) Subject: [Rxtx] install rxtx in XP Message-ID: Hi Guys, I am new to serial port programming, and have no experience on programming java in xp, but my project require me to builld a communication link between xp and a UART device. Most of the information in the web site seems for linux only. including the commands such as export and chmod. How do I install rxtx in xp? cheers YiQi Huang From mark at mdsh.com Tue May 23 01:24:20 2006 From: mark at mdsh.com (Mark Himsley) Date: Tue, 23 May 2006 08:24:20 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off , it includes DLLs for Windows and the JAR for Java. Follow the Windows instructions in the INSTALL. ie RXTXcomm.jar goes in \jre\lib\ext (under java) rxtxSerial.dll goes in \jre\bin So, assuming a fairly standard Java install, copy RXTXcomm.jar into C:\Program Files\Java\jre1.5.0_06\lib\ext and copy rxtxSerial.dll into C:\Program Files\Java\jre1.5.0_06\bin Yes, it really is that simple. On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > I am new to serial port programming, and have no experience on > programming java in xp, but my project require me to builld a > communication link between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang -- Mark Himsley From joachim at buechse.de Tue May 23 02:51:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 23 May 2006 10:51:47 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) Unless it is absolutely required you should NOT install RXTX in your global Java Runtime Environment. This will for sure create versioning conflicts - if not now, than in the future, if not on your system than at your clients. Instead put the dll in your application directory and include the RXTXcomm.jar in your classpath. This is much safer and not a bit more complicated. Regards, Joachim On 23.05.2006, at 09:24, Mark Himsley wrote: > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR > for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > >> I am new to serial port programming, and have no experience on >> programming java in xp, but my project require me to builld a >> communication link between xp and a UART device. >> >> Most of the information in the web site seems for linux only. >> including >> the commands such as export and chmod. How do I install rxtx in xp? >> >> cheers >> YiQi Huang > > > > -- > Mark Himsley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tod at todbot.com Tue May 23 03:12:22 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 02:12:22 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I totally agree: do not contaminate the Java installation. I put all the RXTX files in a directory and then change my java invocation to be: % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* Alternatively, use Launch4J to create a double-clickable application and keep the RXTX libraries in the directory of the application. -=tod On May 23, 2006, at 1:51 AM, Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > >> Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off >> , it includes DLLs for Windows and the JAR >> for Java. >> >> Follow the Windows instructions in the INSTALL. >> >> ie >> >> RXTXcomm.jar goes in \jre\lib\ext (under java) >> rxtxSerial.dll goes in \jre\bin >> >> So, assuming a fairly standard Java install, copy RXTXcomm.jar into >> C:\Program Files\Java\jre1.5.0_06\lib\ext >> and copy rxtxSerial.dll into >> C:\Program Files\Java\jre1.5.0_06\bin >> >> Yes, it really is that simple. >> >> >> >> On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: >> >>> I am new to serial port programming, and have no experience on >>> programming java in xp, but my project require me to builld a >>> communication link between xp and a UART device. >>> >>> Most of the information in the web site seems for linux only. >>> including >>> the commands such as export and chmod. How do I install rxtx in xp? >>> >>> cheers >>> YiQi Huang >> >> >> >> -- >> Mark Himsley >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From smontgomery at mediaspansoftware.com Tue May 23 08:46:53 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Tue, 23 May 2006 10:46:53 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: Message-ID: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Joachim and Tod mentioned how to keep the files RXTX requires on Windows XP out of the Java installations - thanks gentlemen! Are there similar suggestions for an RXTX install on OS X? The current "canonical" OS X installation instructions "contaminate the Java installation", to use Tod's words. Our app will run fine under 1.4.2 and 5.0 on OS X, and a lot of users will have both. We've already been burned by the recent switch from 1.4.2 to 5.0 as the platform default. Any suggestions welcomed. From tod at todbot.com Tue May 23 13:27:55 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 12:27:55 -0700 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <9BA0F670-A862-42E7-BB2C-130D775ABDF9@todbot.com> Hi Sean, It depends on how you build and deploy your code. If you're using shell scripts, you can do something like this: #!/bin/sh # pick one JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/ Commands/java #JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/ Commands/java $JAVA -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* That both picks which VM to use and uses the RXTX in the directory called 'rxtxlib'. If you want your shell script to be clever, you could test for the existence of the different 'java' executables and go from there (maybe even use different jar files). I am almost positive all OS X systems with Java 1.5 are guaranteed to also have Java 1.4.2. If you're using Jar Builder or XCode, you can specify which JVM to use and add the extra args in the Info.plist file. The paths specified in the 'java' invocation then are based off of the $JAVAROOT variable that the JavaApplicationStub sets for you. For my app, I've have been compiling two sets of jars, one compiled with 1.4.2 and one with 1.5, but they both run under 1.5. So I have a similar shell script that chooses a different 'javac' depending on the need. -=tod On May 23, 2006, at 7:46 AM, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From yhua537 at cse.unsw.edu.au Tue May 23 11:09:37 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 03:09:37 +1000 (EST) Subject: [Rxtx] install rxtx in XP (Mark Himsley, Joachim Buechse, Tod E. Kurt> In-Reply-To: References: Message-ID: > Message: 8 > Date: Tue, 23 May 2006 08:03:05 +1000 (EST) > From: YiQi Huang > Subject: [Rxtx] install rxtx in XP > To: rxtx at qbang.org > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > Hi Guys, > > I am new to serial port programming, and have no experience on programming > java in xp, but my project require me to builld a communication link > between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang > > > ------------------------------ > > Message: 9 > Date: Tue, 23 May 2006 08:24:20 +0100 > From: Mark Himsley > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=us-ascii; format=flowed > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > ------------------------------ > > Message: 10 > Date: Tue, 23 May 2006 10:51:47 +0200 > From: Joachim Buechse > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > > ------------------------------ > > Message: 11 > Date: Tue, 23 May 2006 02:12:22 -0700 > From: "Tod E. Kurt" > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I totally agree: do not contaminate the Java installation. > > I put all the RXTX files in a directory and then change my java > invocation to be: > > % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* > > Alternatively, use Launch4J to create a double-clickable application > and keep the RXTX libraries in the directory of the application. > > -=tod > > Hi, Thanks guys, I don't know if this is the correct way to reply your mecessage, if wrong, please point out. Thank you for Mark to give the detail instructions and Joachim to point out the cons ot installing in the java directory, and specially thanks for Tod to give the instrection in detail. Sorry to ask another stupid question: I have followed Tod's instruction. Now I think i am ready to start hacking. But where is the RXTX API documentation? Is it the same as using normal java comm API? btw, where could i find some examples to start with? Thanks very much cheers YiQi Huang From tjarvi at qbang.org Tue May 23 16:09:32 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 May 2006 16:09:32 -0600 (MDT) Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <44722887.8080308@sun.com> References: <447222F3.9040302@spro.net> <44722887.8080308@sun.com> Message-ID: > Good timing for asking as we just started discussing javax.comm plans > today, and I'll have some cycles to work on it soon. Hi Paul I assume you mean Sun is discussing plans concerning its own internal actions and there is no community involvment at this point. -- Trent Jarvi tjarvi at qbang.org From yhua537 at cse.unsw.edu.au Tue May 23 22:50:01 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 14:50:01 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } From mmester at sps.edu Tue May 23 22:58:21 2006 From: mmester at sps.edu (Michael Mester) Date: Wed, 24 May 2006 00:58:21 -0400 Subject: [Rxtx] install rxtx in XP References: Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below -----Original Message----- From: rxtx-bounces at qbang.org on behalf of YiQi Huang Sent: Wed 5/24/2006 12:50 AM To: RXTX Developers and Users Subject: Re: [Rxtx] install rxtx in XP Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3950 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060523/b36d0c63/attachment-0002.bin From yhua537 at cse.unsw.edu.au Tue May 23 23:05:50 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 15:05:50 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: Yes, Michael you are right, it should be semicolons, But it still can't find the correct library. On Wed, 24 May 2006, Michael Mester wrote: > I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below > > > -----Original Message----- > From: rxtx-bounces at qbang.org on behalf of YiQi Huang > Sent: Wed 5/24/2006 12:50 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] install rxtx in XP > > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > cheers YiQi Huang From tod at todbot.com Wed May 24 00:01:57 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 23:01:57 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Yes, sorry, classpath entries are semicolon-separated on Windows and colon-separated on everything else. Your example code below is importing the wrong set of classes. It should not "import javax.comm.*", instead it should "import gnu.io.*". When I make that change, your example program compiles. The "javax.comm" package is the one released by Sun, the "gnu.io" package is the RXTX one. You might've seen some discussion that the two will be merged or become compatible, but that hasn't happened yet. -=tod On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > > Yes, Michael you are right, it should be semicolons, But it still > can't > find the correct library. > > On Wed, 24 May 2006, Michael Mester wrote: > >> I believe the entries in the classpath need to be seperated with >> semicolons, not a colon as you have in your command below >> >> >> -----Original Message----- >> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >> Sent: Wed 5/24/2006 12:50 AM >> To: RXTX Developers and Users >> Subject: Re: [Rxtx] install rxtx in XP >> >> Hi, >> >> Sorry guys.I follow Tod's instruction, and here is what i did: >> >> put >> RXTXcomm.jar, >> rxtxParallel.dll, >> rxtxSerial.dll >> in >> C:\RXTX_files >> >> and I got a SimpleRead class attached below, compile it with : >> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >> it still saying "cannot find symbol". >> >> Is there anything I did wrong? Do I need the comm.jar from Sun? >> >> Thanks & regards >> YiQi Huang >> >> >> //////////////////////////////////////////////////////// >> // SimpleRead.java >> //////////////////////////////////////////////////////// >> >> import java.io.*; >> import java.util.*; >> import javax.comm.*; >> >> public class SimpleRead >> implements Runnable, SerialPortEventListener { >> static CommPortIdentifier portId; >> static Enumeration portList; >> InputStream inputStream; >> SerialPort serialPort; >> Thread readThread; >> public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == >> CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals("COM1")) { >> //if (portId.getName().equals("/dev/term/a")) { >> SimpleRead reader = new SimpleRead(); >> } >> } >> } >> } >> public SimpleRead() { >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", >> 2000); >> } catch (PortInUseException e) {} >> try { >> inputStream = serialPort.getInputStream(); >> } catch (IOException e) {} >> try { >> serialPort.addEventListener(this); >> } catch (TooManyListenersException e) {} >> serialPort.notifyOnDataAvailable(true); >> try { >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } catch (UnsupportedCommOperationException e) {} >> readThread = new Thread(this); >> readThread.start(); >> } >> public void run() { >> try { >> Thread.sleep(20000); >> } catch (InterruptedException e) {} >> } >> public void serialEvent(SerialPortEvent event) { >> switch(event.getEventType()) { >> case SerialPortEvent.BI: >> case SerialPortEvent.OE: >> case SerialPortEvent.FE: >> case SerialPortEvent.PE: >> case SerialPortEvent.CD: >> case SerialPortEvent.CTS: >> case SerialPortEvent.DSR: >> case SerialPortEvent.RI: >> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >> break; >> case SerialPortEvent.DATA_AVAILABLE: >> byte[] readBuffer = new byte[20]; >> try { >> while (inputStream.available() > 0) { >> int numBytes = inputStream.read(readBuffer); >> } >> System.out.print(new String(readBuffer)); >> } catch (IOException e) {} >> break; >> } >> } >> } >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > cheers > YiQi Huang > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From joachim at buechse.de Wed May 24 00:10:06 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:10:06 +0200 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Hi Sean, my preferred way of dealing with RXTX on OS X is to include the RXTX classes into my application jar and to put the RXTX lib in the same directory as this jar. To make it even more comfortable, you can include the lib in the jar and have some startup code extract it and write it to a temporary file from which you load it with System.load(). Unfortunately the current version of RXTX for OS X requires tinkering with user groups as it is based on lockfiles - and hence it needs the RXTX OS X installer or you need to duplicated this functionality in your own installer. I have created my own native version which is not based on lockfiles but tty locking (the standard way to do it on OSX). I hope that these patches will be integrated soon into the distribution. Regards, Joachim On 23.05.2006, at 16:46, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Wed May 24 00:16:12 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:16:12 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <7017ECFC-B13E-4806-B321-9FFCAC5830F0@buechse.de> I assume you downloaded rxtx-217 (not 207). Instead of importing javax.comm.* you must import gnu.io.* The classes have the same name, but they are not in the same package. On 24.05.2006, at 06:50, YiQi Huang wrote: > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From yhua537 at cse.unsw.edu.au Wed May 24 00:17:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 16:17:45 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Message-ID: Thanks Tod again, i kept reading "gnu.io.*" as "gun.io.*" last few hours after i read some commons from web. Thanks very much Tod. thanks YiQi Huang On Tue, 23 May 2006, Tod E. Kurt wrote: > Yes, sorry, classpath entries are semicolon-separated on Windows and > colon-separated on everything else. > > Your example code below is importing the wrong set of classes. It > should not "import javax.comm.*", instead it should "import > gnu.io.*". When I make that change, your example program compiles. > The "javax.comm" package is the one released by Sun, the "gnu.io" > package is the RXTX one. You might've seen some discussion that the > two will be merged or become compatible, but that hasn't happened yet. > > -=tod > > > On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > >> >> Yes, Michael you are right, it should be semicolons, But it still >> can't >> find the correct library. >> >> On Wed, 24 May 2006, Michael Mester wrote: >> >>> I believe the entries in the classpath need to be seperated with >>> semicolons, not a colon as you have in your command below >>> >>> >>> -----Original Message----- >>> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >>> Sent: Wed 5/24/2006 12:50 AM >>> To: RXTX Developers and Users >>> Subject: Re: [Rxtx] install rxtx in XP >>> >>> Hi, >>> >>> Sorry guys.I follow Tod's instruction, and here is what i did: >>> >>> put >>> RXTXcomm.jar, >>> rxtxParallel.dll, >>> rxtxSerial.dll >>> in >>> C:\RXTX_files >>> >>> and I got a SimpleRead class attached below, compile it with : >>> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >>> it still saying "cannot find symbol". >>> >>> Is there anything I did wrong? Do I need the comm.jar from Sun? >>> >>> Thanks & regards >>> YiQi Huang >>> >>> >>> //////////////////////////////////////////////////////// >>> // SimpleRead.java >>> //////////////////////////////////////////////////////// >>> >>> import java.io.*; >>> import java.util.*; >>> import javax.comm.*; >>> >>> public class SimpleRead >>> implements Runnable, SerialPortEventListener { >>> static CommPortIdentifier portId; >>> static Enumeration portList; >>> InputStream inputStream; >>> SerialPort serialPort; >>> Thread readThread; >>> public static void main(String[] args) { >>> portList = CommPortIdentifier.getPortIdentifiers(); >>> while (portList.hasMoreElements()) { >>> portId = (CommPortIdentifier) portList.nextElement(); >>> if (portId.getPortType() == >>> CommPortIdentifier.PORT_SERIAL) { >>> if (portId.getName().equals("COM1")) { >>> //if (portId.getName().equals("/dev/term/a")) { >>> SimpleRead reader = new SimpleRead(); >>> } >>> } >>> } >>> } >>> public SimpleRead() { >>> try { >>> serialPort = (SerialPort) portId.open("SimpleReadApp", >>> 2000); >>> } catch (PortInUseException e) {} >>> try { >>> inputStream = serialPort.getInputStream(); >>> } catch (IOException e) {} >>> try { >>> serialPort.addEventListener(this); >>> } catch (TooManyListenersException e) {} >>> serialPort.notifyOnDataAvailable(true); >>> try { >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, >>> SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> } catch (UnsupportedCommOperationException e) {} >>> readThread = new Thread(this); >>> readThread.start(); >>> } >>> public void run() { >>> try { >>> Thread.sleep(20000); >>> } catch (InterruptedException e) {} >>> } >>> public void serialEvent(SerialPortEvent event) { >>> switch(event.getEventType()) { >>> case SerialPortEvent.BI: >>> case SerialPortEvent.OE: >>> case SerialPortEvent.FE: >>> case SerialPortEvent.PE: >>> case SerialPortEvent.CD: >>> case SerialPortEvent.CTS: >>> case SerialPortEvent.DSR: >>> case SerialPortEvent.RI: >>> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >>> break; >>> case SerialPortEvent.DATA_AVAILABLE: >>> byte[] readBuffer = new byte[20]; >>> try { >>> while (inputStream.available() > 0) { >>> int numBytes = inputStream.read(readBuffer); >>> } >>> System.out.print(new String(readBuffer)); >>> } catch (IOException e) {} >>> break; >>> } >>> } >>> } >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> >> cheers >> YiQi Huang >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From smontgomery at mediaspansoftware.com Wed May 24 10:24:13 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 12:24:13 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: Tod & Joachim, Thanks for the info, that's very helpful. I'll give that a whirl when I move to rxtx 2.1. I'm still using the older 2.0.7 version for now (don't ask), which probably requires the Sun comm.jar, javax.comm.properties and librxtxSerial.jnilib to be in very specific places in each jvm's file hierarchy. From tjarvi at qbang.org Wed May 24 11:59:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 11:59:16 -0600 (MDT) Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: On Wed, 24 May 2006, Sean Montgomery wrote: > Tod & Joachim, > > Thanks for the info, that's very helpful. I'll give that a whirl > when I move to rxtx 2.1. I'm still using the older 2.0.7 version for > now (don't ask), which probably requires the Sun comm.jar, > javax.comm.properties and librxtxSerial.jnilib to be in very specific > places in each jvm's file hierarchy. > You will need comm.jar from Sun then. It must be Sun's version 2.* or older for Linux or Solaris. I assume they have this in download archives. The default offering from Sun is version 3.0. This version currently does not support rxtx. The older version will probably be fine for your needs. -- Trent Jarvi tjarvi at qbang.org From smontgomery at mediaspansoftware.com Wed May 24 12:19:06 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 14:19:06 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: <3939EFB8-11E1-4E3E-A684-5B3C525577CD@mediaspansoftware.com> Yup, that's right, thanks Trent. I've been using these files for quite a while now. Thanks for bringing it up. I almost didn't mention using 2.0.7 because I didn't want to give any new members of the list the wrong idea! :-) On May 24, 2006, at 1:59 PM, Trent Jarvi wrote: > On Wed, 24 May 2006, Sean Montgomery wrote: > >> Tod & Joachim, >> >> Thanks for the info, that's very helpful. I'll give that a whirl >> when I move to rxtx 2.1. I'm still using the older 2.0.7 version for >> now (don't ask), which probably requires the Sun comm.jar, >> javax.comm.properties and librxtxSerial.jnilib to be in very specific >> places in each jvm's file hierarchy. >> > > You will need comm.jar from Sun then. It must be Sun's version 2.* or > older for Linux or Solaris. I assume they have this in download > archives. > > The default offering from Sun is version 3.0. This version > currently does > not support rxtx. > > The older version will probably be fine for your needs. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mark at mdsh.com Wed May 24 15:55:46 2006 From: mark at mdsh.com (Mark Himsley) Date: Wed, 24 May 2006 22:55:46 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <37B0FC4B1F3237321F093ABE@MacMini.local> On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) That's no problem. BUT, do note that the instructions I elaborated on are in the INSTALL file within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone please update the INSTALL file? > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > > , it includes DLLs for Windows and the JAR > > for Java. > > > > Follow the Windows instructions in the INSTALL. > > > > ie > > > > RXTXcomm.jar goes in \jre\lib\ext (under java) > > rxtxSerial.dll goes in \jre\bin > > > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > > C:\Program Files\Java\jre1.5.0_06\lib\ext > > and copy rxtxSerial.dll into > > C:\Program Files\Java\jre1.5.0_06\bin > > > > Yes, it really is that simple. > > > > > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > > > >> I am new to serial port programming, and have no experience on > >> programming java in xp, but my project require me to builld a > >> communication link between xp and a UART device. > >> > >> Most of the information in the web site seems for linux only. > >> including > >> the commands such as export and chmod. How do I install rxtx in xp? > >> > >> cheers > >> YiQi Huang > > > > > > > > -- > > Mark Himsley > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Mark Himsley From tjarvi at qbang.org Wed May 24 16:41:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 16:41:46 -0600 (MDT) Subject: [Rxtx] install rxtx in XP In-Reply-To: <37B0FC4B1F3237321F093ABE@MacMini.local> References: <37B0FC4B1F3237321F093ABE@MacMini.local> Message-ID: On Wed, 24 May 2006, Mark Himsley wrote: > > > On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > >> I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > That's no problem. > > BUT, do note that the instructions I elaborated on are in the INSTALL file > within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone > please update the INSTALL file? > > The INSTALL file may be updated by anyone at anytime. http://rxtx.qbang.org/wiki/index.php/Installation We are moving it to the wiki so end users may put the type of answers they would like to see in. Sometimes it's best if developers don't give what appears to be cryptic answers. You can even put in that jre/lib/ext is not the right place but you don't understand the classpath solution mentioned on the mail-list and then we know what to add. -- Trent Jarvi tjarvi at qbang.org From stramit at gmail.com Wed May 24 21:45:31 2006 From: stramit at gmail.com (Tim Cooper) Date: Thu, 25 May 2006 13:45:31 +1000 Subject: [Rxtx] Accessing Virtual Com Port Message-ID: Hi, I have to develop an application that talks to a virtual com port (in this case com3) which translates any messages sent across a USB cable to a micro. Using C++ I can talk to this com port and I know that it is configured, present, and working. For the application that I am trying to write I want to use RXTX for the communication. My problem is that the configured virtual port (in windows) is not showing up when I do an enumeration over the available ports. The output I get is (com 3 is not present) : Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 PORT FOUND: COM1 PORT FOUND: LPT1 Is there anything that I need to do to make com3 available to RXTX and my application? Timothy Cooper -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060524/c5591648/attachment-0002.html From antonio.luis at iscte.pt Thu May 25 01:39:13 2006 From: antonio.luis at iscte.pt (=?ISO-8859-1?Q?Ant=F3nio_Lopes?=) Date: Thu, 25 May 2006 08:39:13 +0100 Subject: [Rxtx] RXTX on Pocket PC Message-ID: <44755F21.8060103@iscte.pt> Hello everyone, I've been using RXTX to communicate with serial ports in Windows and it's been quite successful. However, I'm now considering porting my application from Windows to Pocket PC but I can't seem to find the RXTX binaries (*.jar and *.dll) to use in Pocket PC. I've been "digging" on the mailing list's archives and also on the web and I can't find these anywhere. Can anyone in this mailing list give me some pointers on this? Where can I find the necessary files and basic installation instructions? Thanks very much for your help. I very much appreciate any help that you can provide me. Regards, -- Ant?nio Lopes @contact: antonio.luis at iscte.pt @work: ADETTI - ISCTE @web: http://antonio.lopes.googlepages.com/home From doug at dupreeinc.com Fri May 26 15:45:50 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Fri, 26 May 2006 14:45:50 -0700 Subject: [Rxtx] rxtx slow startup Message-ID: <4477770E.9010400@dupreeinc.com> Hello, I hope there are people still reading this mailing list. The archive appeared to not have anything new after 4/2005. I was using the commapi from sun for a project where a java application reads data from test equipment connected to the serial port. I had to upgrade the ftdi vcp driver on my pc and the old sun commapi no longer works with hardware flow control. as an experiment I replaced the javax.com with gnu.io in the SerialDemo.java project that was included with the commapi. This compiled fine using JBuilder 2006 and JRE 1.5.0_05. RXTX also works with the latest ftdi drivers so life is wonderful again... almost... When using the commapi jar the SerialDemo program starts in about 1 second on my system. Using the RXTX jar it takes over 56 seconds to start. Has anyone else seen this problem? Is there a workaround to get the startup performance close to the old commapi? The last thing printed to the console before this delay is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks for your time! Doug From yhua537 at cse.unsw.edu.au Sat May 27 05:46:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 21:46:45 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <4477770E.9010400@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> Message-ID: hi Doug The archive hasn't been update for a long time, But people certainly still reading the list. I don't have enough experience to help on your problem, but without any detail about what your problem doing during that 56 seconds, it is hard to target the your question, I think. cheers YiQi On Fri, 26 May 2006, Doug Thistlethwaite wrote: > Hello, > > I hope there are people still reading this mailing list. The archive > appeared to not have anything new after 4/2005. > > I was using the commapi from sun for a project where a java application > reads data from test equipment connected to the serial port. I had to > upgrade the ftdi vcp driver on my pc and the old sun commapi no longer > works with hardware flow control. as an experiment I replaced the > javax.com with gnu.io in the SerialDemo.java project that was included > with the commapi. This compiled fine using JBuilder 2006 and JRE > 1.5.0_05. RXTX also works with the latest ftdi drivers so life is > wonderful again... almost... > > When using the commapi jar the SerialDemo program starts in about 1 > second on my system. Using the RXTX jar it takes over 56 seconds to > start. Has anyone else seen this problem? Is there a workaround to get > the startup performance close to the old commapi? > > The last thing printed to the console before this delay is: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Thanks for your time! > > Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------- Just a student, Still a student ------------------------------- From yhua537 at cse.unsw.edu.au Sat May 27 06:04:26 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 22:04:26 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: Sorry, I don't think you could understand what I mean .I mean this: Without any detail about what your program is doing during that 56 seconds, it is hard for anyone to target the problem. On Sat, 27 May 2006, YiQi Huang wrote: > hi Doug > > The archive hasn't been update for a long time, But people certainly still > reading the list. > > I don't have enough experience to help on your problem, but without any > detail about what your problem doing during that 56 seconds, it is hard to > target the your question, I think. > > cheers > YiQi > > On Fri, 26 May 2006, Doug Thistlethwaite wrote: > >> Hello, >> >> I hope there are people still reading this mailing list. The archive >> appeared to not have anything new after 4/2005. >> >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From jredman at ergotech.com Sat May 27 08:32:02 2006 From: jredman at ergotech.com (Jim Redman) Date: Sat, 27 May 2006 08:32:02 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: <447862E2.4080506@ergotech.com> Doug, Since you mentioned it, we have a system that is also seems slow. From memory (I don't have one of the slow systems around), I'm not sure that it's consistent, it seems that sometimes it may take longer than others. Since it's part of the bootup it hasn't raised a flag and I haven't researched it. The same code runs much faster on other systems, so now you've got me wondering what's different. The slow system boots DSL (http://www.damnsmalllinux.org/) from a compact flash. FC4 is on my desktop where I haven't noticed a slow down. I think that the rxtx code is the same in both cases with lock files disabled. The slow system has a bunch of serial ports defined, including 4 USB serial ports that do not exist - they are not plugged in. Any clues in there? Jim > On Fri, 26 May 2006, Doug Thistlethwaite wrote: >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Sat May 27 10:41:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 May 2006 10:41:54 -0600 (MDT) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447862E2.4080506@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: On Sat, 27 May 2006, Jim Redman wrote: > Doug, > > Since you mentioned it, we have a system that is also seems slow. From > memory (I don't have one of the slow systems around), I'm not sure that > it's consistent, it seems that sometimes it may take longer than others. > Since it's part of the bootup it hasn't raised a flag and I haven't > researched it. > > The same code runs much faster on other systems, so now you've got me > wondering what's different. > > The slow system boots DSL (http://www.damnsmalllinux.org/) from a > compact flash. FC4 is on my desktop where I haven't noticed a slow > down. I think that the rxtx code is the same in both cases with lock > files disabled. > > The slow system has a bunch of serial ports defined, including 4 USB > serial ports that do not exist - they are not plugged in. > > Any clues in there? > rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. When it does this, it will try to open each port and do a timed out read. most systems will not have entries in device if the port is not there. But some minimal systems will just put all the device files there in case hardware is added. The list of devices scanned used to be ~10-20 times longer than it is today. That was getting very slow. I suspect moving the device files not used to a backup directory would increase the enumeration. I'll look into why the mail-list archive is not updating. The last update was about when I thought I 'fixed' the cron jobs. I probably didn't actually fix it but rather moved the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon May 29 19:46:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 May 2006 19:46:47 -0600 (MDT) Subject: [Rxtx] Mail-List Archives are updating. Message-ID: It was pointed out earlier that the archive is dated. This was a missing crontab entry. The list is currently archived by the week on the web page. It is updated once a day. So every 7 days it starts a new link and updates it daily. I've been limited in what I could do while my cable modem was disconnected this last week. rxtx.org is something I do on my own time. The patches and credits will be comming next. Many of these can be seen in bugzilla right now. -- Trent Jarvi tjarvi at qbang.org From doug at dupreeinc.com Tue May 30 11:18:41 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 10:18:41 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: <447C7E71.4080204@dupreeinc.com> Trent, YiQi, and Jim: Thanks to all for the replies and information! I am just back from a long weekend and I am now trying to figure out what I was doing! :) As for more information. First off, this example is being run under windows XP. I am developing test equipment that communicates with a java application via a serial port. I have been using the commapi for several years and have not had a problem. Recently, I have started a design modification that will replace the RS232 connection with a USB port. I am using the ftdi module for prototyping and I discovered that their virtual com port driver was not compatible with the commapi that Sun released. It turns out that it has problems with hardware flow control ( it works on incoming but not outgoing communications). The way I figured this out was by experimenting with the SerialDemo that was included with the Sum commapi. One nice thing about this example is it has the ability to set incoming and outgoing flow control independently. After I installed RXTX into my JBuilder 2006 IDE, I just replaced all all instances of javax.comm with gnu.io and it compiled and runs without a hitch (except for the slow startup). I Paused the JBuilder IDE during this long pause and the last few entries in the stack trace are: testRead() : -1, gnu.io.RXTXCommDriver registerValidPorts() : 255, gnu.io.RXTXCommDriver registerScannedPorts() : 777, gnu.io.RXTXCommDriver This was all initiated by the following call in the programs init routine: Enumeration en = CommPortIdentifier.getPortIdentifiers(); After looking at this, My guess is that Trent is correct in that the delay is in scanning for ports. I guess one solution would be to not scan for ports, though it would be nice to detect what is available on the system. Is there any way to reduce the number of ports scanned by this function in windows XP? Thanks again for your time, Doug Trent Jarvi wrote: >On Sat, 27 May 2006, Jim Redman wrote: > > > >>Doug, >> >>Since you mentioned it, we have a system that is also seems slow. From >>memory (I don't have one of the slow systems around), I'm not sure that >>it's consistent, it seems that sometimes it may take longer than others. >>Since it's part of the bootup it hasn't raised a flag and I haven't >>researched it. >> >>The same code runs much faster on other systems, so now you've got me >>wondering what's different. >> >>The slow system boots DSL (http://www.damnsmalllinux.org/) from a >>compact flash. FC4 is on my desktop where I haven't noticed a slow >>down. I think that the rxtx code is the same in both cases with lock >>files disabled. >> >>The slow system has a bunch of serial ports defined, including 4 USB >>serial ports that do not exist - they are not plugged in. >> >>Any clues in there? >> >> >> > >rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. > >When it does this, it will try to open each port and do a timed out read. >most systems will not have entries in device if the port is not there. >But some minimal systems will just put all the device files there in case >hardware is added. > >The list of devices scanned used to be ~10-20 times longer than it is >today. That was getting very slow. > >I suspect moving the device files not used to a backup directory would >increase the enumeration. > >I'll look into why the mail-list archive is not updating. The last update >was about when I thought I 'fixed' the cron jobs. I probably didn't >actually fix it but rather moved the problem. > >-- >Trent Jarvi >tjarvi at qbang.org > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/86796453/attachment-0002.html From doug at dupreeinc.com Tue May 30 14:36:09 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 13:36:09 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447C7E71.4080204@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com> Message-ID: <447CACB9.1000801@dupreeinc.com> Hello all, I also notice this pause (not as long however) when I call: CommPortIdentifier.getPortIdentifier(PortName); I would think that if I supply the name of the port, it would not have to go through the same discovery process. If you have any ideas of how to get rid of this startup delay, I would really appreciate it. Thanks, Doug Doug Thistlethwaite wrote: > Trent, YiQi, and Jim: > > Thanks to all for the replies and information! I am just back from a > long weekend and I am now trying to figure out what I was doing! :) > > As for more information. First off, this example is being run under > windows XP. I am developing test equipment that communicates with a > java application via a serial port. I have been using the commapi for > several years and have not had a problem. Recently, I have started a > design modification that will replace the RS232 connection with a USB > port. I am using the ftdi module for prototyping and I discovered > that their virtual com port driver was not compatible with the commapi > that Sun released. It turns out that it has problems with hardware > flow control ( it works on incoming but not outgoing communications). > The way I figured this out was by experimenting with the SerialDemo > that was included with the Sum commapi. One nice thing about this > example is it has the ability to set incoming and outgoing flow > control independently. > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup). > > I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are: > > testRead() : -1, gnu.io.RXTXCommDriver > registerValidPorts() : 255, gnu.io.RXTXCommDriver > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > This was all initiated by the following call in the programs init routine: > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > After looking at this, My guess is that Trent is correct in that the > delay is in scanning for ports. I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system. Is there any way to reduce the number of ports scanned by > this function in windows XP? > > Thanks again for your time, > > Doug > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/edaa5c3c/attachment-0002.html From lynn at swcp.com Tue May 30 15:07:18 2006 From: lynn at swcp.com (lynn@swcp.com) Date: Tue, 30 May 2006 21:07:18 -0000 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CACB9.1000801@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: *IF* the name of the port is supplied, we might want to use the preferences mechanism (java.util.prefs) where we could have previously saved the info for the port. We could do a quick check to see that things have not changed before using it. If things have changed (or never been defined) we would do a full port scan and save detected ports in the preferences. This way if the hardware is not changed, you only pay the time penalty one time. just an idea... Lynn Doug Thistlethwaite said: > This is a multi-part message in MIME format. > --------------070808020900080005070500 > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > Content-Transfer-Encoding: 7bit > > Hello all, > > I also notice this pause (not as long however) when I call: > > CommPortIdentifier.getPortIdentifier(PortName); > > I would think that if I supply the name of the port, it would not have > to go through the same discovery process. If you have any ideas of how > to get rid of this startup delay, I would really appreciate it. > > Thanks, > > Doug > > Doug Thistlethwaite wrote: > > > Trent, YiQi, and Jim: > > > > Thanks to all for the replies and information! I am just back from a > > long weekend and I am now trying to figure out what I was doing! :) > > > > As for more information. First off, this example is being run under > > windows XP. I am developing test equipment that communicates with a > > java application via a serial port. I have been using the commapi for > > several years and have not had a problem. Recently, I have started a > > design modification that will replace the RS232 connection with a USB > > port. I am using the ftdi module for prototyping and I discovered > > that their virtual com port driver was not compatible with the commapi > > that Sun released. It turns out that it has problems with hardware > > flow control ( it works on incoming but not outgoing communications). > > The way I figured this out was by experimenting with the SerialDemo > > that was included with the Sum commapi. One nice thing about this > > example is it has the ability to set incoming and outgoing flow > > control independently. > > > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > > all instances of javax.comm with gnu.io and it compiled and runs > > without a hitch (except for the slow startup). > > > > I Paused the JBuilder IDE during this long pause and the last few > > entries in the stack trace are: > > > > testRead() : -1, gnu.io.RXTXCommDriver > > registerValidPorts() : 255, gnu.io.RXTXCommDriver > > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > > > This was all initiated by the following call in the programs init routine: > > > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > > > After looking at this, My guess is that Trent is correct in that the > > delay is in scanning for ports. I guess one solution would be to not > > scan for ports, though it would be nice to detect what is available on > > the system. Is there any way to reduce the number of ports scanned by > > this function in windows XP? > > > > Thanks again for your time, > > > > Doug > > > > --------------070808020900080005070500 > Content-Type: text/html; charset=ISO-8859-1 > Content-Transfer-Encoding: 7bit > > > > > > > > > Hello all,
>
> I also notice this pause (not as long however) when I call:
>
>          CommPortIdentifier.getPortIdentifier(PortName);
>
> I would think that if I supply the name of the port, it would not have > to go through the same discovery process.  If you have any ideas of how > to get rid of this startup delay, I would really appreciate it.
>
> Thanks,
>
> Doug
>
> Doug Thistlethwaite wrote: >
> > Trent, YiQi, and Jim:
>
> Thanks to all for the replies and information!  I am just back from a > long weekend and I am now trying to figure out what I was doing! :)
>
> As for more information.  First off, this example is being run under > windows XP.  I am developing test equipment that communicates with a > java application via a serial port.  I have been using the commapi for > several years and have not had a problem.  Recently, I have started a > design modification that will replace the RS232 connection with a USB > port.  I am using the ftdi module for prototyping and I discovered that > their virtual com port driver was not compatible with the commapi that > Sun released.  It turns out that it has problems with hardware flow > control ( it works on incoming but not outgoing communications).  The > way I figured this out was by experimenting with the SerialDemo that > was included with the Sum commapi.  One nice thing about this example > is it has the ability to set incoming and outgoing flow control > independently.
>
> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup).
>
> I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are:
>
> testRead() : -1, gnu.io.RXTXCommDriver
> registerValidPorts() : 255, gnu.io.RXTXCommDriver
> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>
> This was all initiated by the following call in the programs init > routine:
>
> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>
> After looking at this,  My guess is that Trent is correct in that the > delay is in scanning for ports.  I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system.  Is there any way to reduce the number of ports scanned by > this function in windows XP? 
>
> Thanks again for your time,
>
> Doug
>
>
> > > > --------------070808020900080005070500-- > -- From jredman at ergotech.com Tue May 30 15:42:35 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 30 May 2006 15:42:35 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: <447CBC4B.2080206@ergotech.com> Lynn, If I understand your idea correctly, I don't think that this would work well for, say, USB ports since these can be easily added/removed by the end user. Jim lynn at swcp.com wrote: > *IF* the name of the port is supplied, we might want to use the preferences > mechanism (java.util.prefs) where we could have previously saved the info for > the port. We could do a quick check to see that things have not changed > before using it. If things have changed (or never been defined) we would do a > full port scan and save detected ports in the preferences. > > This way if the hardware is not changed, you only pay the time penalty one time. > > just an idea... > Lynn > > > Doug Thistlethwaite said: > >> This is a multi-part message in MIME format. >> --------------070808020900080005070500 >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >> Content-Transfer-Encoding: 7bit >> >> Hello all, >> >> I also notice this pause (not as long however) when I call: >> >> CommPortIdentifier.getPortIdentifier(PortName); >> >> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process. If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it. >> >> Thanks, >> >> Doug >> >> Doug Thistlethwaite wrote: >> >>> Trent, YiQi, and Jim: >>> >>> Thanks to all for the replies and information! I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :) >>> >>> As for more information. First off, this example is being run under >>> windows XP. I am developing test equipment that communicates with a >>> java application via a serial port. I have been using the commapi for >>> several years and have not had a problem. Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port. I am using the ftdi module for prototyping and I discovered >>> that their virtual com port driver was not compatible with the commapi >>> that Sun released. It turns out that it has problems with hardware >>> flow control ( it works on incoming but not outgoing communications). >>> The way I figured this out was by experimenting with the SerialDemo >>> that was included with the Sum commapi. One nice thing about this >>> example is it has the ability to set incoming and outgoing flow >>> control independently. >>> >>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup). >>> >>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are: >>> >>> testRead() : -1, gnu.io.RXTXCommDriver >>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>> >>> This was all initiated by the following call in the programs init routine: >>> >>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>> >>> After looking at this, My guess is that Trent is correct in that the >>> delay is in scanning for ports. I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system. Is there any way to reduce the number of ports scanned by >>> this function in windows XP? >>> >>> Thanks again for your time, >>> >>> Doug >>> >> --------------070808020900080005070500 >> Content-Type: text/html; charset=ISO-8859-1 >> Content-Transfer-Encoding: 7bit >> >> >> >> >> >> >> >> >> Hello all,
>>
>> I also notice this pause (not as long however) when I call:
>>
>>         >  CommPortIdentifier.getPortIdentifier(PortName);
>>
>> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process.  If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it.
>>
>> Thanks,
>>
>> Doug
>>
>> Doug Thistlethwaite wrote: >>
>> >> Trent, YiQi, and Jim:
>>
>> Thanks to all for the replies and information!  I am just back from a >> long weekend and I am now trying to figure out what I was doing! :)
>>
>> As for more information.  First off, this example is being run under >> windows XP.  I am developing test equipment that communicates with a >> java application via a serial port.  I have been using the commapi for >> several years and have not had a problem.  Recently, I have started a >> design modification that will replace the RS232 connection with a USB >> port.  I am using the ftdi module for prototyping and I discovered that >> their virtual com port driver was not compatible with the commapi that >> Sun released.  It turns out that it has problems with hardware flow >> control ( it works on incoming but not outgoing communications).  The >> way I figured this out was by experimenting with the SerialDemo that >> was included with the Sum commapi.  One nice thing about this example >> is it has the ability to set incoming and outgoing flow control >> independently.
>>
>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >> all instances of javax.comm with gnu.io and it compiled and runs >> without a hitch (except for the slow startup).
>>
>> I Paused the JBuilder IDE during this long pause and the last few >> entries in the stack trace are:
>>
>> testRead() : -1, gnu.io.RXTXCommDriver
>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>
>> This was all initiated by the following call in the programs init >> routine:
>>
>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>
>> After looking at this,  My guess is that Trent is correct in that the >> delay is in scanning for ports.  I guess one solution would be to not >> scan for ports, though it would be nice to detect what is available on >> the system.  Is there any way to reduce the number of ports scanned by >> this function in windows XP? 
>>
>> Thanks again for your time,
>>
>> Doug
>>
>>
>> >> >> >> --------------070808020900080005070500-- >> > > > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From yhua537 at cse.unsw.edu.au Tue May 30 18:10:23 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 31 May 2006 10:10:23 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CBC4B.2080206@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: Doug, In the SerialDemo, it allow us to save the parameters into a file, and use it when your program start up. Would this help? YiQi On Tue, 30 May 2006, Jim Redman wrote: > Lynn, > > If I understand your idea correctly, I don't think that this would work > well for, say, USB ports since these can be easily added/removed by the > end user. > > Jim > > lynn at swcp.com wrote: >> *IF* the name of the port is supplied, we might want to use the preferences >> mechanism (java.util.prefs) where we could have previously saved the info for >> the port. We could do a quick check to see that things have not changed >> before using it. If things have changed (or never been defined) we would do a >> full port scan and save detected ports in the preferences. >> >> This way if the hardware is not changed, you only pay the time penalty one time. >> >> just an idea... >> Lynn >> >> >> Doug Thistlethwaite said: >> >>> This is a multi-part message in MIME format. >>> --------------070808020900080005070500 >>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>> Content-Transfer-Encoding: 7bit >>> >>> Hello all, >>> >>> I also notice this pause (not as long however) when I call: >>> >>> CommPortIdentifier.getPortIdentifier(PortName); >>> >>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process. If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it. >>> >>> Thanks, >>> >>> Doug >>> >>> Doug Thistlethwaite wrote: >>> >>>> Trent, YiQi, and Jim: >>>> >>>> Thanks to all for the replies and information! I am just back from a >>>> long weekend and I am now trying to figure out what I was doing! :) >>>> >>>> As for more information. First off, this example is being run under >>>> windows XP. I am developing test equipment that communicates with a >>>> java application via a serial port. I have been using the commapi for >>>> several years and have not had a problem. Recently, I have started a >>>> design modification that will replace the RS232 connection with a USB >>>> port. I am using the ftdi module for prototyping and I discovered >>>> that their virtual com port driver was not compatible with the commapi >>>> that Sun released. It turns out that it has problems with hardware >>>> flow control ( it works on incoming but not outgoing communications). >>>> The way I figured this out was by experimenting with the SerialDemo >>>> that was included with the Sum commapi. One nice thing about this >>>> example is it has the ability to set incoming and outgoing flow >>>> control independently. >>>> >>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>> all instances of javax.comm with gnu.io and it compiled and runs >>>> without a hitch (except for the slow startup). >>>> >>>> I Paused the JBuilder IDE during this long pause and the last few >>>> entries in the stack trace are: >>>> >>>> testRead() : -1, gnu.io.RXTXCommDriver >>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>> >>>> This was all initiated by the following call in the programs init routine: >>>> >>>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>> >>>> After looking at this, My guess is that Trent is correct in that the >>>> delay is in scanning for ports. I guess one solution would be to not >>>> scan for ports, though it would be nice to detect what is available on >>>> the system. Is there any way to reduce the number of ports scanned by >>>> this function in windows XP? >>>> >>>> Thanks again for your time, >>>> >>>> Doug >>>> >>> --------------070808020900080005070500 >>> Content-Type: text/html; charset=ISO-8859-1 >>> Content-Transfer-Encoding: 7bit >>> >>> >>> >>> >>> >>> >>> >>> >>> Hello all,
>>>
>>> I also notice this pause (not as long however) when I call:
>>>
>>>         >>  CommPortIdentifier.getPortIdentifier(PortName);
>>>
>>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process.  If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it.
>>>
>>> Thanks,
>>>
>>> Doug
>>>
>>> Doug Thistlethwaite wrote: >>>
>>> >>> Trent, YiQi, and Jim:
>>>
>>> Thanks to all for the replies and information!  I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :)
>>>
>>> As for more information.  First off, this example is being run under >>> windows XP.  I am developing test equipment that communicates with a >>> java application via a serial port.  I have been using the commapi for >>> several years and have not had a problem.  Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port.  I am using the ftdi module for prototyping and I discovered that >>> their virtual com port driver was not compatible with the commapi that >>> Sun released.  It turns out that it has problems with hardware flow >>> control ( it works on incoming but not outgoing communications).  The >>> way I figured this out was by experimenting with the SerialDemo that >>> was included with the Sum commapi.  One nice thing about this example >>> is it has the ability to set incoming and outgoing flow control >>> independently.
>>>
>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup).
>>>
>>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are:
>>>
>>> testRead() : -1, gnu.io.RXTXCommDriver
>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>
>>> This was all initiated by the following call in the programs init >>> routine:
>>>
>>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>
>>> After looking at this,  My guess is that Trent is correct in that the >>> delay is in scanning for ports.  I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system.  Is there any way to reduce the number of ports scanned by >>> this function in windows XP? 
>>>
>>> Thanks again for your time,
>>>
>>> Doug
>>>
>>>
>>> >>> >>> >>> --------------070808020900080005070500-- >>> >> >> >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From halbleib at rechnerbetriebsgruppe.de Wed May 31 02:06:16 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 10:06:16 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp Message-ID: <447D4E78.30302@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, I getting an error while reloading my app in tomcat. At the first start everything runs well, but if i reload mit webapp by tomcat manager i get the following error. java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader Is there a possibility to unload the native library rxtxSerial.dll? thx for all help! regards tom -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 b8FT80HQ1xlbDLnRecDANCc= =heb1 -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 02:52:17 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 10:52:17 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D4E78.30302@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> Message-ID: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Hello Tom, To the best of my knowledge it is impossible to unload native libraries once loaded into the JVM. The exception you see stems from the fact, that Tomcat creates a new classloader when you "reload" the weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar is loaded from the session class loader. Try to add RXTXComm.jar to your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. Regards, Joachim On 31.05.2006, at 10:06, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 > b8FT80HQ1xlbDLnRecDANCc= > =heb1 > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From halbleib at rechnerbetriebsgruppe.de Wed May 31 03:28:35 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 11:28:35 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Message-ID: <447D61C3.1030807@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Joachim, I'm still not getting it. How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml-file? Perhaps web.xml? Regards, Tom Joachim Buechse schrieb: > Hello Tom, > > To the best of my knowledge it is impossible to unload native > libraries once loaded into the JVM. The exception you see stems from > the fact, that Tomcat creates a new classloader when you "reload" the > weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar > is loaded from the session class loader. Try to add RXTXComm.jar to > your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. > > Regards, > Joachim > > On 31.05.2006, at 10:06, Tom Halbleib wrote: > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL tzNy+/0iIUfkYYgt1+UT1ko= =pkpY -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 04:03:42 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 12:03:42 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D61C3.1030807@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> <447D61C3.1030807@rechnerbetriebsgruppe.de> Message-ID: -Xbootclasspath/a: is a start option to the java vm. Google is your friend in finding how to modfiy it and what it means: tomcat modifying bootclasspath Regards, Joachim On 31.05.2006, at 11:28, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Joachim, > > I'm still not getting it. > How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml- > file? > Perhaps web.xml? > > Regards, > Tom > > Joachim Buechse schrieb: >> Hello Tom, >> >> To the best of my knowledge it is impossible to unload native >> libraries once loaded into the JVM. The exception you see stems from >> the fact, that Tomcat creates a new classloader when you "reload" the >> weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar >> is loaded from the session class loader. Try to add RXTXComm.jar to >> your bootlclasspath (-Xbootclasspath/a:) and the problem should go >> away. >> >> Regards, >> Joachim >> >> On 31.05.2006, at 10:06, Tom Halbleib wrote: >> >> Hi all, >> >> I getting an error while reloading my app in tomcat. At the first >> start >> everything runs well, but if i reload mit webapp by tomcat manager >> i get >> the following error. >> >> java.lang.UnsatisfiedLinkError: Native Library >> C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in >> another classloader thrown while loading gnu.io.RXTXCommDriver >> Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: >> Native >> Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already >> loaded >> in another classloader >> >> >> Is there a possibility to unload the native library rxtxSerial.dll? >> >> thx for all help! >> >> regards >> >> tom > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL > tzNy+/0iIUfkYYgt1+UT1ko= > =pkpY > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From impakt01 at optusnet.com.au Wed May 31 06:55:42 2006 From: impakt01 at optusnet.com.au (Daren) Date: Wed, 31 May 2006 22:55:42 +1000 Subject: [Rxtx] (no subject) Message-ID: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/ade7ad37/attachment-0002.html From doug at dupreeinc.com Wed May 31 10:19:19 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 31 May 2006 09:19:19 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: <447DC207.3070702@dupreeinc.com> I am not sure what you are saying. The Save parameters menu option saves the current settings (baud, data bits, etc.). The long pause (~60 seconds) is when the application first starts (before loading the saved parameters). This does bring up a question, though I hate this type of kludge approach to getting this library to work... What exactly is a PortIdentifier? Is it always the same? If I stored the results from "CommPortIdentifier.getPortIdentifier(PortName);" in a file, could I use this the next time the program is executed? In this case I am using a virtual com port driver to connect to the device through a USB port. Doug YiQi Huang wrote: >Doug, > >In the SerialDemo, it allow us to save the parameters into a file, and use >it when your program start up. Would this help? > >YiQi > >On Tue, 30 May 2006, Jim Redman wrote: > > > >>Lynn, >> >>If I understand your idea correctly, I don't think that this would work >>well for, say, USB ports since these can be easily added/removed by the >>end user. >> >>Jim >> >>lynn at swcp.com wrote: >> >> >>>*IF* the name of the port is supplied, we might want to use the preferences >>>mechanism (java.util.prefs) where we could have previously saved the info for >>>the port. We could do a quick check to see that things have not changed >>>before using it. If things have changed (or never been defined) we would do a >>>full port scan and save detected ports in the preferences. >>> >>>This way if the hardware is not changed, you only pay the time penalty one time. >>> >>>just an idea... >>>Lynn >>> >>> >>>Doug Thistlethwaite said: >>> >>> >>> >>>>This is a multi-part message in MIME format. >>>>--------------070808020900080005070500 >>>>Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>>>Content-Transfer-Encoding: 7bit >>>> >>>>Hello all, >>>> >>>>I also notice this pause (not as long however) when I call: >>>> >>>> CommPortIdentifier.getPortIdentifier(PortName); >>>> >>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process. If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it. >>>> >>>>Thanks, >>>> >>>>Doug >>>> >>>>Doug Thistlethwaite wrote: >>>> >>>> >>>> >>>>>Trent, YiQi, and Jim: >>>>> >>>>>Thanks to all for the replies and information! I am just back from a >>>>>long weekend and I am now trying to figure out what I was doing! :) >>>>> >>>>>As for more information. First off, this example is being run under >>>>>windows XP. I am developing test equipment that communicates with a >>>>>java application via a serial port. I have been using the commapi for >>>>>several years and have not had a problem. Recently, I have started a >>>>>design modification that will replace the RS232 connection with a USB >>>>>port. I am using the ftdi module for prototyping and I discovered >>>>>that their virtual com port driver was not compatible with the commapi >>>>>that Sun released. It turns out that it has problems with hardware >>>>>flow control ( it works on incoming but not outgoing communications). >>>>>The way I figured this out was by experimenting with the SerialDemo >>>>>that was included with the Sum commapi. One nice thing about this >>>>>example is it has the ability to set incoming and outgoing flow >>>>>control independently. >>>>> >>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>>without a hitch (except for the slow startup). >>>>> >>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>>entries in the stack trace are: >>>>> >>>>>testRead() : -1, gnu.io.RXTXCommDriver >>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>>> >>>>>This was all initiated by the following call in the programs init routine: >>>>> >>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>>> >>>>>After looking at this, My guess is that Trent is correct in that the >>>>>delay is in scanning for ports. I guess one solution would be to not >>>>>scan for ports, though it would be nice to detect what is available on >>>>>the system. Is there any way to reduce the number of ports scanned by >>>>>this function in windows XP? >>>>> >>>>>Thanks again for your time, >>>>> >>>>>Doug >>>>> >>>>> >>>>> >>>>--------------070808020900080005070500 >>>>Content-Type: text/html; charset=ISO-8859-1 >>>>Content-Transfer-Encoding: 7bit >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>>Hello all,
>>>>
>>>>I also notice this pause (not as long however) when I call:
>>>>
>>>>        >>>> >>>> >>> CommPortIdentifier.getPortIdentifier(PortName);
>>> >>> >>>>
>>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process.  If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it.
>>>>
>>>>Thanks,
>>>>
>>>>Doug
>>>>
>>>>Doug Thistlethwaite wrote: >>>>
>>>> >>>>Trent, YiQi, and Jim:
>>>>
>>>>Thanks to all for the replies and information!  I am just back from a >>>>long weekend and I am now trying to figure out what I was doing! :)
>>>>
>>>>As for more information.  First off, this example is being run under >>>>windows XP.  I am developing test equipment that communicates with a >>>>java application via a serial port.  I have been using the commapi for >>>>several years and have not had a problem.  Recently, I have started a >>>>design modification that will replace the RS232 connection with a USB >>>>port.  I am using the ftdi module for prototyping and I discovered that >>>>their virtual com port driver was not compatible with the commapi that >>>>Sun released.  It turns out that it has problems with hardware flow >>>>control ( it works on incoming but not outgoing communications).  The >>>>way I figured this out was by experimenting with the SerialDemo that >>>>was included with the Sum commapi.  One nice thing about this example >>>>is it has the ability to set incoming and outgoing flow control >>>>independently.
>>>>
>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>without a hitch (except for the slow startup).
>>>>
>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>entries in the stack trace are:
>>>>
>>>>testRead() : -1, gnu.io.RXTXCommDriver
>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>>
>>>>This was all initiated by the following call in the programs init >>>>routine:
>>>>
>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>>
>>>>After looking at this,  My guess is that Trent is correct in that the >>>>delay is in scanning for ports.  I guess one solution would be to not >>>>scan for ports, though it would be nice to detect what is available on >>>>the system.  Is there any way to reduce the number of ports scanned by >>>>this function in windows XP? 
>>>>
>>>>Thanks again for your time,
>>>>
>>>>Doug
>>>>
>>>>
>>>> >>>> >>>> >>>>--------------070808020900080005070500-- >>>> >>>> >>>> >>> >>> >>> >>-- >>Jim Redman >>(505) 662 5156 x85 >>http://www.ergotech.com >>_______________________________________________ >>Rxtx mailing list >>Rxtx at qbang.org >>http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > >cheers >YiQi Huang >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/61d4d4c9/attachment-0002.html From impakt01 at optusnet.com.au Wed May 31 17:02:54 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 09:02:54 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Message-ID: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Hi all, I downloaded 2.1.7-pre16 and managed to build it and get it going. I made the changes as suggested by Peter Smith in an old post, by adding his code to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. Still not working, it opens the port at 9600 according to portmon.exe . Has anyone managed to get this going at a custom rate? Here is the post I'm referring to: http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 Thanks, Daren ________________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Daren Sent: Wednesday, 31 May 2006 10:56 PM To: rxtx at qbang.org Subject: [Rxtx] (no subject) Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren From tjarvi at qbang.org Wed May 31 21:44:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 May 2006 21:44:01 -0600 (MDT) Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> References: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Message-ID: On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org From impakt01 at optusnet.com.au Wed May 31 22:06:04 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 14:06:04 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: Message-ID: <200606010406.k51464X2010447@mail03.syd.optusnet.com.au> Trent, I have managed to successfully open the port at this speed using Realterm (available on sourceforge). From memory this uses DLPortIO. Using portmon.exe with realterm, even there it says that the port has opened at 1953. I changed termios.c:560 to dcb->BaudRate = 1953 ; and it still opens the port at 9600. Daren -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Thursday, 1 June 2006 1:44 PM To: RXTX Developers and Users Subject: Re: [Rxtx] custom baud rate win32 On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From smontgomery at mediaspansoftware.com Mon May 1 09:52:28 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 11:52:28 -0400 Subject: [Rxtx] RXTX, Java COMM and Windows Server 2003 on x64 experiences? Message-ID: Just wondering if anybody here has had to deploy RXTX or the javax.comm on Windows Server 2003 machines running on x64 (i.e. Xeon EM64T) and would like to relate how things went. From Sun's site, the Supported System Configurations pages give the options for that system: Java 5.0: - 32-bit Java 5.0 running on the OS in the 32-bit mode - 64-bit Java 5.0 running on the OS in the 64-bit native mode Java 1.4.2: - no options listed for EM64T processors, but potentially the standard 32-bit Java 1.4.2 could run on the OS in 32-bit mode? I guess the two main points of failure would be 1) the JVM itself and 2) the jni components. Make that three: there's gotta be hardware vendor driver support for the OS in the various modes, too. Guess I better go look at Keyspan's website... Thanks in advance for any info anyone might be able to provide. From smontgomery at mediaspansoftware.com Mon May 1 10:18:33 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 12:18:33 -0400 Subject: [Rxtx] Mailing list archive out of date? Message-ID: The mailing list archive at: http://mailman.qbang.org/pipermail/rxtx/ only shows emails through the end of March. Is there a new archive somewhere else? Didn't see anything mentioned on the wiki. From p.cain at phasefale.com.au Mon May 1 22:33:09 2006 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 02 May 2006 14:33:09 +1000 Subject: [Rxtx] RXTX and the Linux kernel. Message-ID: <4456E105.5080106@phasefale.com.au> Hi, First off the problem I am having isn't caused by RXTX itself but I'm hoping someone out there may have some knowledge that may help me. Background: I have an application monitoring a control system through a standard PC serial port which I talk to with rxtx-2.0.5. The application runs on RedHat7.3 kernel version 2.4.18 using Java 1.4. This configuration has been in use for several years and has proved to be stable. But it has become necessary for me to upgrade the OS but I'm running into problems with the serial communications. Its not that the comms don't work on the new OS (its never that simple) the comms work for a variable period of time (sometimes several hours) and then just stop, nothing on the data lines and control lines all indicate that data could flow. The new OS is Ubuntu 5.10 running kernel version 2.6.12. I have installed the OS and software on a PC and had it perform ok, then install the new OS and same software on the very same hardware and experienced the problems of them comms stopping. In the new OS I'm using Java5 to run the app but since I have experience the problem I reverted back to Java1.4 which didn't fix the problem. I've moved the app to a different system RedHat FC3 running 2.6.14 had experienced the problem. Not wanting to go through all the thing I have tried but I have established that it seems to be the 2.6 versions of the kernel that seem to be the problem and not an individual distribution of Linux. I should point out that I am using the same jar and library files for each java and OS combination. So I'm just wondering if anyone has had or heard of problems similar to these ? Or perhaps might know of what changed in the Linux serial driver (something I'm having a hard time establishing). I'm starting to run low on ideas of what to try so any help would be much appreciated. -- Peter Cain Senior Programmer Phasefale Pty Ltd From tjarvi at qbang.org Wed May 3 07:31:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 May 2006 07:31:00 -0600 (MDT) Subject: [Rxtx] Re: Concering ircomm and RXTX In-Reply-To: References: Message-ID: On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From legolas.w at gmail.com Wed May 3 08:46:23 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 19:16:23 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <4458C23F.2000003@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From legolas.w at gmail.com Wed May 3 13:10:57 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 23:40:57 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <44590041.80706@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From Lars.Hennig at wow-portal.com Thu May 4 00:39:15 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Thu, 4 May 2006 08:39:15 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: Message-ID: Hi, I could not find any solution. I therefore decided to to my own native implementation. Allthough it only supports the functions I need, it works pretty well now for me. I think the main problem there is the use of a wrong Windows API function and not setting an timeout. Regards, Lars Hennig W?rth Online World GmbH Tel. (0049)7181-258183 Mob. (0049)160-3522889 Fax. (0049)7940-153299 Lars.Hennig at wow-portal.com Gesendet von: rxtx-bounces at qbang.org 09.04.2006 10:42 Bitte antworten zu RXTX Developers and Users An d.herwald at dsh-elektronik.de, RXTX Developers and Users Kopie Thema Re: [Rxtx] USB Serialport - disconnection problems WV Proj./Teilpr.: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/7b39f374/attachment-0003.html From Pawan.Kharbanda at dot.state.co.us Thu May 4 11:00:58 2006 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Thu, 4 May 2006 11:00:58 -0600 Subject: [Rxtx] Dangling Lock Files Message-ID: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Hi, I have been using RXTX API's for the Serial Communication for quite some time now and for some of the devices we are opening and closing the connection every 2 minutes. This works great for few days and then suddenly I start seeing some "Port in Use Exception" and I see that the Lock files are still in the /var/lock folder after manually removing the lock files it works good for few hours and I see the same problem again. Can somebody explain me the scenarios why I am seeing the dangling Lock files? I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise Servers. Thanks Pawan Kharbanda -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/ba0e9261/attachment-0003.html From tjarvi at qbang.org Thu May 4 14:10:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:10:30 -0600 (MDT) Subject: [Rxtx] Dangling Lock Files In-Reply-To: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> References: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Message-ID: On Thu, 4 May 2006, Kharbanda, Pawan wrote: > Hi, > I have been using RXTX API's for the Serial Communication for quite > some time now and for some of the devices we are opening and closing the > connection every 2 minutes. This works great for few days and then > suddenly I start seeing some "Port in Use Exception" and I see that the > Lock files are still in the /var/lock folder after manually removing the > lock files it works good for few hours and I see the same problem again. > Can somebody explain me the scenarios why I am seeing the dangling Lock > files? > > I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise > Servers. Hi Pawan The next time it happens, look in the lockfile. There will be a pid. ps aux |grep 'pid' I think you will see that the application is still running for some reason. RXTX does a kill -0 on the pid to see if its alive. If not, it will remove the lockfile. So I suspect the previous program did not exit as you expected. -- Trent Jarvi tjarvi at qbang.org From Scott.Hughes at dalsemi.com Thu May 4 14:23:11 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 4 May 2006 15:23:11 -0500 Subject: [Rxtx] Wiki instructions... Message-ID: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire demo apps, when I stumbled across this tip on the wiki to add yourself to the uucp group: It may be simpler to just run usermod -G uucp jarvi Taken from: http://rxtx.qbang.org/wiki/index.php/Installation This does not work as advertised. I should have read the man page for usermod before I tried that out. If there are any groups which are not listed after the -G switch, the user is removed from those groups. On Ubuntu, this is bad... I removed myself from the Admin group, which removed my sudo priviledges. Ubuntu has no root account, so I've disabled the only account which could fix it. Anyone know of a good workaround? Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor From tjarvi at qbang.org Thu May 4 14:32:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:32:09 -0600 (MDT) Subject: [Rxtx] Wiki instructions... In-Reply-To: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> Message-ID: On Thu, 4 May 2006, Scott Hughes wrote: > I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire > demo apps, when I stumbled across this tip on the wiki to add yourself to > the uucp group: > > It may be simpler to just run > > usermod -G uucp jarvi > > Taken from: > http://rxtx.qbang.org/wiki/index.php/Installation > > This does not work as advertised. I should have read the man page for > usermod before I tried that out. If there are any groups which are not > listed after the -G switch, the user is removed from those groups. On > Ubuntu, this is bad... I removed myself from the Admin group, which removed > my sudo priviledges. Ubuntu has no root account, so I've disabled the only > account which could fix it. > > Anyone know of a good workaround? > Yikes This will get your permissions back: in grub/lilo/.. pass the following option to the kernel init=/bin/sh You are now root. when it boots, mount -o remount,rw / add yourself to the groups, reboot to get normal init going. Thats about all I can think of without sudo/root. -- Trent Jarvi tjarvi at qbang.org From Gettings at earth.utah.edu Thu May 4 14:41:22 2006 From: Gettings at earth.utah.edu (Paul Gettings) Date: Thu, 4 May 2006 14:41:22 -0600 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <20060504204122.GA6534@earth.utah.edu> When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get messages on stdout from the JVM: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 As the only change was the version of RXTX (from 2.1.6), I am unsure why the messages suddenly appeared. Anyone know how to get rid of them? Thanks. -- 101 USES FOR A DEAD MICROPROCESSOR (23) Dead cat brush From mmester at sps.edu Mon May 1 21:22:28 2006 From: mmester at sps.edu (Michael Mester) Date: Mon, 1 May 2006 23:22:28 -0400 Subject: [Rxtx] Windows PortInUseException Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> I'm trying to get simple serial communication going with RxTx under Windows XP. I can enumerate the ports fine, but I always run into problems when I try to open one. I get a PortInUseException, but the owner application is "Unknown" and the port is never open. I've tried this on several different systems and all of them give the same behavior. The only thing I can thiunk of that might be causing the problem is that fact that I had to put the serial .dll file in system32 instead of the reccommended folder, because it didn't work in the folder the documentation gives. The library loads fine, though, so I'm not sure whether that makes sense, and I don't know how to fix it anyway. Any help is greatly appreciated. Below is the output of the program, right up to the PortInUseException and the NullPointerException it causes (because the serial port object is not instantiated). C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI Starting GPSTalkerGUI... Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 gnu.io.PortInUseException: Unknown Application Exception in thread "main" java.lang.NullPointerException at GPSTalkerGUI.(GPSTalkerGUI.java:102) at GPSTalkerGUI.main(GPSTalkerGUI.java:161) Again, thank you very much for any help you can give. From lshellman at qwest.net Wed May 3 01:38:34 2006 From: lshellman at qwest.net (Lucious Shellman) Date: Wed, 03 May 2006 01:38:34 -0600 Subject: [Rxtx] Help needed: Project using parallel port Message-ID: <1146641914.8337.14.camel@localhost.localdomain> I was looking for a way to access the parallel port on a PC using Java. Searching the Internet, I came across this site (rxtx.org). What I am trying to do is detect logic levels from a TTL logic IC on the parallel port. I am not trying to do classic parallel port communication. I just want to detect whether a line(s) is (are) high or low. I am using Windows 98. Can rxtx be used to do this? If yes, is there a tutorial for using rxtx posted on the Internet that someone can direct me to. If you need more information, feel free to e-mail me. Unfortunately for me, I need the information ASAP. Thanks. lshellman at qwest.net From webmaster at egyhelp.com Wed May 3 18:43:39 2006 From: webmaster at egyhelp.com (Mohamed Samy) Date: Thu, 4 May 2006 02:43:39 +0200 Subject: [Rxtx] RE: Concering ircomm and RXTX In-Reply-To: Message-ID: <20060503184362.SM01044@Geek> Hey, I issue the command "modprobe ircomm-tty" yet no ttyircomm appears, while the ircomm appear by "modprobe ircomm" so forgive me but I am bit lost. Even searching google for the keyword "ttyircomm" only returns 3 matches. So any way I can start the ttyircomm???? Thanks a lot. -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Wednesday, May 03, 2006 3:31 PM To: Mohamed Samy; rxtx at qbang.org Cc: taj at www.linux.org.uk Subject: Re: Concering ircomm and RXTX On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 4 15:49:49 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 15:49:49 -0600 (MDT) Subject: [Rxtx] Windows PortInUseException In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> Message-ID: On Mon, 1 May 2006, Michael Mester wrote: > > I'm trying to get simple serial communication going with RxTx under > Windows XP. I can enumerate the ports fine, but I always run into > problems when I try to open one. I get a PortInUseException, but the > owner application is "Unknown" and the port is never open. I've tried > this on several different systems and all of them give the same > behavior. The only thing I can thiunk of that might be causing the > problem is that fact that I had to put the serial .dll file in system32 > instead of the reccommended folder, because it didn't work in the folder > the documentation gives. The library loads fine, though, so I'm not sure > whether that makes sense, and I don't know how to fix it anyway. Any > help is greatly appreciated. Below is the output of the program, right > up to the PortInUseException and the NullPointerException it causes > (because the serial port object is not instantiated). > > C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI > Starting GPSTalkerGUI... > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > gnu.io.PortInUseException: Unknown Application > Exception in thread "main" java.lang.NullPointerException > at GPSTalkerGUI.(GPSTalkerGUI.java:102) > at GPSTalkerGUI.main(GPSTalkerGUI.java:161) > Perhaps you are trying to open the port twice in your code? rxtx does open the ports, do a timed out read and then close the ports during enumeration. I think the port is being opened fine. The Unknown Application is always reported. On linux, there is some code that finds the actual application but on windows, its always unknown. If the port enumeration is returning the ports you expect, rxtx has opened the port and closed it with success. The port should open. There is also example code in the contrib directory that comes with rxtx source that has examples you can modify to work. -- Trent Jarvi tjarvi at qbang.org From Christian.Klemke at t-online.de Thu May 4 23:37:23 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Fri, 5 May 2006 07:37:23 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu> Message-ID: <004f01c67005$fc72fee0$016a10ac@NB600> Hi Paul, I was wondering about the same question some days ago and took a look at the source files. Unfortunately, I found that you can only get rid of that messages by altering and recompiling the Java code. There is a final static boolean variable called "devel" in the file "RXTXCommDriver.java" which is set to "true". This constellation causes the output after the native libraries have been loaded. No mechanism exists to suppress them otherwise :-(. Trent, does that mean that 2.1.7 is still officially a "development" version ? When will this value be changed to "false" by default ? With 2.1.8 ? It would be nice to provide a means to suppress such messages besides that static flag (maybe by setting a property called "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The output can indeed by annoying, especially when used with console applications, where the message potentially appears "in the middle" of your own output. Another possibility would be not to use System.out directly, but instead some PrintStream field which is initially set to System.out but can programatically be changed. That would allow for any kind of redirection or suppression by implementing appropriate user-defined PrintStream subclasses and making RXTX use that stream. What do you think ? Best regards, Christian ----- Original Message ----- From: "Paul Gettings" To: Sent: Thursday, May 04, 2006 10:41 PM Subject: [Rxtx] RXTX causing stdout messages > When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get > messages on stdout from the JVM: > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > As the only change was the version of RXTX (from 2.1.6), I am unsure > why the messages suddenly appeared. Anyone know how to get rid of > them? > > Thanks. > > -- > 101 USES FOR A DEAD MICROPROCESSOR > (23) Dead cat brush > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri May 5 06:09:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 06:09:46 -0600 (MDT) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <004f01c67005$fc72fee0$016a10ac@NB600> References: <20060504204122.GA6534@earth.utah.edu> <004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: On Fri, 5 May 2006, Christian Klemke wrote: > Hi Paul, > > I was wondering about the same question some days ago and took a look at the > source files. Unfortunately, I found that you can only get rid of that > messages by altering and recompiling the Java code. There is a final static > boolean variable called "devel" in the file "RXTXCommDriver.java" which is > set to "true". This constellation causes the output after the native > libraries have been loaded. No mechanism exists to suppress them otherwise > :-(. > > Trent, does that mean that 2.1.7 is still officially a "development" version > ? When will this value be changed to "false" by default ? With 2.1.8 ? It > would be nice to provide a means to suppress such messages besides that > static flag (maybe by setting a property called > "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The > output can indeed by annoying, especially when used with console > applications, where the message potentially appears "in the middle" of your > own output. Another possibility would be not to use System.out directly, but > instead some PrintStream field which is initially set to System.out but can > programatically be changed. That would allow for any kind of redirection or > suppression by implementing appropriate user-defined PrintStream subclasses > and making RXTX use that stream. What do you think ? > A patch for using properties would be accepted I'm sure. The reason the default is to display the message is not related to the development state of rxtx anymore. The problem is that people first using rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. The message prevents a great deal of email thats easily explained by the message. I question if we should support rxtx 2.0 at all anymore. If you post a patch in bugzilla, we'll put it into CVS this weekend. we'll be going through and doing such things anyhow. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri May 5 13:23:56 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 13:23:56 -0600 (MDT) Subject: [Rxtx] How to read from RxTx parallel port in Win XP In-Reply-To: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> References: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> Message-ID: On Thu, 27 Apr 2006, Worsley, Bob (Development Engineer) wrote: > I'm sorry if this is a dumb question, but I didn't find the answer in > the archives. > > I'm using the RxTx binaries for Windows on a reasonably current notebook > PC running Windows XP. I can send stuff to a printer on the parallel > port (LPT1), but I can't get anything back. > > I wrote a class that has the methods listed below. I write some data to > the printer with the "write" method and then try to read a response > using the "read" method, but I never get any data. I'd greatly > appreciate any help you can give! > > Bob Worsley > bobwoyid2 at yahoo.com > > > > > private ParallelPort parallelPort = null; > private RXTXCommDriver parallelPortDriver = null; > > > public boolean initialize() throws IOException { > if (parallelPort != null) { > return false; // Already initialized > } > > // Create the parallel port; > parallelPortDriver = new RXTXCommDriver(); > parallelPort = > (ParallelPort)parallelPortDriver.getCommPort(address, > CommPortIdentifier.PORT_PARALLEL); > > // Set the parallel port parameters. > try { > parallelPort.enableReceiveTimeout(READ_TIMEOUT); > parallelPort.disableReceiveFraming(); > parallelPort.disableReceiveThreshold(); > //parallelPort.setMode(mode); !!!!errors > } catch (UnsupportedCommOperationException e) { > throw (new IOException("Parallel port with address '" + > address > + "' cannot be configured as specified")); > } > > return true; > } > > > > public void write(final byte[] bytes) throws IOException { > initialize(); > while (busyReading) { > Thread.yield(); > } > busyWriting = true; > if (bytes.length < 1) { > return; > } > OutputStream outputStream = parallelPort.getOutputStream(); > outputStream.write(bytes); > outputStream.flush(); > outputStream.close(); > Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); > busyWriting = false; > } > > > public byte[] read() throws IOException { > > // Read up to MAX_BYTES bytes. > initialize(); > while (busyWriting) { > Thread.yield(); > } > busyReading = true; > byte[] buff = new byte[MAX_BYTES_READ]; > InputStream inputStream = parallelPort.getInputStream(); > // This read blocks until input data is available > int bytesRead = inputStream.read(buff); > inputStream.close(); > // If no data read, create empty array > if (bytesRead == -1) { > bytesRead = 0; > } > byte[] deviceBytes = new byte[bytesRead]; > System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); > if (bytesRead > 0) { > Debug.p("PPIOP.read - got data: '" + new > String(deviceBytes) + "'"); > } > busyReading = false; > return deviceBytes; > } > Hi Bob I've only used rxtx to test a hello world page printing but there are others that have used it. PPIOP? hmm what is this? :) The rxtx parallel support is behind the serial support but should be OK. As you note, the setting of modes is not supported. rxtx uses what is provided when the port is open. Are your asserting the pin for the printer being online? I suspect what often happens is people try to just use the data pins but the C API rxtx uses wants the printer to be online. There should be some posts relating to this in the rxtx mail-list archive. Some APIs are probably reading and writing from the port address (also suggested in your code as something you are looking at). RXTX currently uses a higher level C/C++ API for port access. This can still work if the API thinks the 'printer' is there. -- Trent Jarvi tjarvi at qbang.org From agrodellic at gmail.com Sat May 6 08:39:40 2006 From: agrodellic at gmail.com (Leigh Stewart) Date: Sat, 6 May 2006 10:39:40 -0400 Subject: [Rxtx] sun commapi 3 Message-ID: I think I read here: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html that rxtx-2.0 is basically fracked for now? Does anyone know of a workaround? ie can i somehow get an older version of sun's comm api and use that (not easy to find)? i mean 2.0 must be working for someone...how is it being tested. 2.1 isnt working for me....im getting nasty native exceptions etc, which is why im so set on 2.0... any ideas? From tjarvi at qbang.org Sun May 7 15:40:27 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 7 May 2006 15:40:27 -0600 (MDT) Subject: [Rxtx] sun commapi 3 In-Reply-To: References: Message-ID: On Sat, 6 May 2006, Leigh Stewart wrote: > > 2.1 isnt working for me....im getting nasty native exceptions etc, > which is why im so set on 2.0... any ideas? > Hi Leigh What native exceptions are you seeing? Which OS? The native code is almost identical between rxtx 2.0 and 2.1. Only the names have been changed to protect the inocent. :) ie: javax_comm_... vs gnu_io_... So the odds are very likely that even if you do find commapi 2.0 and get it installed, you will run into the same error. It would be better to just find and fix the problem. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Mon May 8 10:47:20 2006 From: mail at willicon.de (WILLICon) Date: Mon, 08 May 2006 18:47:20 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 Message-ID: <445F7618.3070303@willicon.de> Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/ef37e8ec/attachment-0003.html From tjarvi at qbang.org Mon May 8 16:14:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 May 2006 16:14:51 -0600 (MDT) Subject: [Rxtx] Screenshot of Application using RXTX (fwd) Message-ID: Just though someone may end up searching for 0x0D and 0x0A. Here are the details from his system. SuSE Linux 10.0 (x86_64) Kernel 2.6.13-15.8 j2se 1.4.2_11 (i586) Sun: comm3.0_u1 rxtx: rxtx-2.1-7 ---------- Forwarded message ---------- Date: Sat, 6 May 2006 20:01:46 +0200 From: Michael Poppitz To: taj at www.linux.org.uk Subject: Screenshot of Application using RXTX Hi Trent, the rxtx package works like a charm. Sun's package seemed to replace all 0x0D with 0x0A in received data on my Linux box, which is really annoying when transfering binary data. But rxtx came and saved the day - and turned out to be a lot more convenient as it does not require a configuration file. I use it for connecting to a home made logic analyzer. (http://www.sump.org/projects/analyzer/) Thanks for your great job, Michael -------------- next part -------------- A non-text attachment was scrubbed... Name: la_client.png Type: image/png Size: 16592 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/45494fbb/la_client-0003.png From tjarvi at qbang.org Tue May 9 14:56:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 May 2006 14:56:05 -0600 (MDT) Subject: [Rxtx] RXTX javax.comm: which one to install? In-Reply-To: <20060509161742.43547.qmail@web53814.mail.yahoo.com> References: <20060509161742.43547.qmail@web53814.mail.yahoo.com> Message-ID: On Tue, 9 May 2006, Adenilson Cavalcanti wrote: > Dear Trent Jarvi > > I'm trying to write a small Java app running in linux that interfaces with a device connected to serial port. > > I do have some questions about RXTX and javax.comm state of affairs, since I'm new to Java programming (used to program in plain old C writting to devices using termios and open/write/read syscalls, but this is another story). > > I ask you the favor to clarify this issues (if possible...): > > a) Sun offers to download a file (comm3.0_u1_PUTAUNIXVERSION.zip) which does contain .so files. Does it work out of box? > > b) Case negative, its there that we should use 'librxtx*.so' provided by your site? > > c) Sun's comm3 API version does work with which version of rxtx? > > I already searched google and read documentation available in rxtx site ("Java Comm Serial API How-to") but still have this issues unsolved. Any help will be appreciated. > > Best regards > > Adenilson Hi Adenilson, RXTX does not currently support javax.comm in Sun's CommAPI 3.0. I would recommend using package gnu.io provided by rxtx 2.1. -- Trent Jarvi tjarvi at qbang.org From chris.develder at intec.ugent.be Wed May 10 08:45:40 2006 From: chris.develder at intec.ugent.be (Chris Develder) Date: Wed, 10 May 2006 16:45:40 +0200 Subject: [Rxtx] rxtx troubles on ARM Message-ID: <4461FC94.6040909@intec.ugent.be> Hi all, Sorry to bother you, but I don't seem to get RXTX working on an ARM processor (xscale ixp 425, big endian). I managed to crosscompile the rxtx libs and moved it over to the ARM. Using jamvm (which is the only open source java VM we got working on the ARM), I get the following error result when running SimpleRead from Sun's javax.comm examples (commapi\examples\Simple\SimpleRead) -- see bottom of mail for complete output: "java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver" However, output shows that the RXTXCommDriver code is accessible (cf. debug and devel output of lib versions). So it doesn't seem to be a missing lib/jar issue. The error happens before RXTXCommDriver.initialize() is called, since the first line there is System.out.println("RXTXCommDriver:initialize()"); Any ideas? Cheers, Chris ---------------------------- [root at xxx(ttyp1) /work/cdvelder/xscale/test]# jamvm -Djava.library.path=/work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/jre/lib/arm -classpath /work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/lib/ext/RXTXcomm.jar:./comm.jar:. SimpleRead RXTXCommDriver {} Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTXCommDriver: Jar version = RXTX-2.1-7 native lib Version = RXTX-2.1-7 java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver gnu/io/RXTXCommDriver at javax.comm.CommPortIdentifier.loadDriver (CommPortIdentifier.java:239) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:109) at SimpleRead.main (Unknown Source) java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive (Native Method) at com.sun.comm.Portmapping.registerCommPorts (Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase (Portmapping.java:100) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:138) at SimpleRead.main (Unknown Source) From joachim at buechse.de Fri May 12 00:44:48 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 08:44:48 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) Message-ID: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Good day, I guess that only a selected few (hi Trent) will be able to answer this question, but the answer might be interesting for anyone trying to debug or understand the code. Apparently the MonitorThread is started and stopped in RXTXPort.addEventListener and RXTXPort.removeEventListener. This would indicate that (originally?) the MonitorThread is only required when there is an EventListener. However the MonitorThread is also started in the RXTXPort constructor, which could mean that RXTX won't work at all if it isn't there. It seems to me, that if anyone would add an event listener and later on remove it, he could potentially wreak the port. Because the second action would kill the MonitorThread. For the moment I am only trying to understand the role of and idea behind the MonitorThread. But of course there is a deeper reason thor my question: If the MonitorThread needs to exist anyway, it could be the thread that cleans up the port (ie calls nativeClose) - this would eliminate (a further) problem I am seeing with some USB drivers on Mac OSX. (Close blocks (after releasing the tty, but still) in the USB driver if the device is "not responding"). Greetings, Joachim From tjarvi at qbang.org Fri May 12 07:10:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 12 May 2006 07:10:59 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Fri, 12 May 2006, Joachim Buechse wrote: > Good day, > > I guess that only a selected few (hi Trent) will be able to answer > this question, but the answer might be interesting for anyone trying > to debug or understand the code. > > Apparently the MonitorThread is started and stopped in > RXTXPort.addEventListener and RXTXPort.removeEventListener. This > would indicate that (originally?) the MonitorThread is only required > when there is an EventListener. However the MonitorThread is also > started in the RXTXPort constructor, which could mean that RXTX won't > work at all if it isn't there. > > It seems to me, that if anyone would add an event listener and later > on remove it, he could potentially wreak the port. Because the second > action would kill the MonitorThread. > > > For the moment I am only trying to understand the role of and idea > behind the MonitorThread. But of course there is a deeper reason thor > my question: > > If the MonitorThread needs to exist anyway, it could be the thread > that cleans up the port (ie calls nativeClose) - this would eliminate > (a further) problem I am seeing with some USB drivers on Mac OSX. > (Close blocks (after releasing the tty, but still) in the USB driver > if the device is "not responding"). > Hi Jaochim Before commapi, rxtx did not support events. You could read, write and change port settings. The MonitorThread was added as an afterthought to support commapi events. So the way things are now his historical spaghetti not a well devised plan. It is my opinion that the MonitorThread should exist as long as the port is open. The odd starting of the thread in the constructor and addEventListener was just to get past the obvious problem of people using the port without adding listeners. -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Fri May 12 07:59:50 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 15:59:50 +0200 Subject: [Rxtx] MonitorThread -> ChangeRequest In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: <2B1E508C-8CEE-4AB7-914D-E7BA25C871A2@buechse.de> In this case I suggest removing the starting/stopping of MonitorThread in addEventListener / removeEventListener. This should not affect existing projects. On 12.05.2006, at 15:10, Trent Jarvi wrote: > It is my opinion that the MonitorThread should exist as long as the > port > is open. The odd starting of the thread in the constructor and > addEventListener was just to get past the obvious problem of people > using > the port without adding listeners. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Fri May 12 11:43:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 19:43:21 +0200 Subject: [Rxtx] Spring Cleaning - some suggestions Message-ID: The current implementation of RXTX contains quite a lot of code that will break if it is used from several threads (especially on a multi processor machine). I think it would be nice to clean this up. I suggest the following changes (which keep the current semantics and should not influence existing projects in a negative way): - InterruptedException will never be ignored or reset - read methods will be protected with a Monitor - write methods will be protected with a (separate) Monitor - close() sets the read and write monitors into a "closed" state which will lead to IOExceptions for any following call to RXTXPort.read/write. - close() will wait a finite amount of time (maybe 500ms) for the release of the read and write monitors after that, it will trigger the closing of the file descriptor to abort any pending read or write. - close() will not call close(file_desc). Instead it will "interrupt" (ie set a flag and then, pthread_kill(ABRT)) the MonitorThread, the MonitorThread will call close(file_desc). - the monitors are properly released in a finally block the try of which starts directly after obtaining the monitor. - finally will not call close(file_desc) it will only "interrupt" the MonitorThread (see above) - the native-code (esp read) does not use SA_RESTART but checks Thread.interrupted() when it receives a SIGNAL (ie system call returns with EINTR or other signalling method). The read/write monitors will be allocated from a factory whose mode can be set to fast/normal/advanced. In fast-mode it will create "non thread safe, non synchronized" pseudo-monitors. In default mode, the monitors will store the owning thread. In "advanced" mode setting the monitors into closed state will "interrupt()" threads which are blocked in a native read/write. {Reasoning close behaviour: Calling close on a file descriptor in Windows unblocks any read() or write() on the same file descriptor with an error. On Solaris < 2.7 and MacOS X however the close() will/ can block - until the read or write have finished:-(( Even the JDK people have trouble with this. I dont know how Linux reacts in this case. The best practice for BSD/Solaris is to send a signal to the thread which will usually unblock the read/write with an EINTR - this however is not guarenteed as it also depends on the device driver. So the only resolution that will certainly not block the thread calling RXTXPort.close() (which will often enough be the AWT event dispatcher or the VM finalizer thread) is to call close(fd) from another thread.} {Reasoning read behaviour: It is rather uncommon to receive a signal while reading or writing - it will happen, but checking Thread.interrupted() when it happens will not degrade performance. The checking of Thread.interrupted() can be handled by returning to Java and potententially reentering into the native code if the thread was not interrupted or by calling back into the VM from the native code. On top of this, many functions like read(byte[]) or read(byte [], int, int) are allowed to return less than the requested amount of data. Only int read() is a bit more tricky. } [Trent: From the code I can tell, that you experimented quite a bit with signals. Do you know if the Java Thread.interrupt() triggers a unix signal on Linux/Solaris? If so, which one?? References: - http://java.sun.com/docs/hotspot/VMOptions.html - http://www.hp.com/products1/unix/java/infolibrary/prog_guide/ signals.html ] On OS X (hotspot client jdk-1.4.2) I did not see any signal propagated to the SELECT of the event_loop/MonitorThread (ie no EINTR) when I call monThread.interrupt(). This is a pitty, but thats the way it is. I simply assume this is true for most system calls. How to handle this? Of course it would be possible to install/ deinstall a specific signal handler before/after every native read and to natively send an ABRT signal if RXTXPort.close is called. A more elegant solution might be to have an additional "signaling" socket which is always included in the SELECT. Or the simplest solution: cap the timeout of the select to 500 ms (the loop around it exists already) after every timeout check the Thread.interrupted() flag. From a performance perspective this should be completely invisible... On the other hand, all write() calls need to be preceeded by a SELECT as well, to avoid running into a blocking write. Best regards, Joachim From lyon at docjava.com Sat May 13 05:54:52 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 13 May 2006 07:54:52 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Dmitry suggests that we acquire an implementation of a serial port reference, use it, then release it (i.e., check it back in). Joachim says that making serial ports thread friendly might be a good idea. This is a good idea. The design pattern that is close to this idea is the "Object Pool Design Pattern". # Object Pool Manage the reuse of objects for a type of object that is expensive to create or only a limited number of a kind of object can be created. It has been described at: http://www.developer.com/java/ent/article.php/626171 and in Marks' book, Patterns in Java, Volume 1. However, the Object Pool is intended to pool objects so that each object is just like every other object. The intent of the Parametric Singleton is to enable others to access the same resource at the same time (as long as the same parameters were used in construction). It sounds like we need a NEW Design Pattern (Oh no, Doug is doing it again!). Yes friends, you got me on a role (roll) :) If you like design patterns, you can thank me later. If you don't like design patterns, blame Dmitry, it was his idea ;) And Dave, thanks for the feedback on Singleton abuse. It has led me to change the way I think about application contexts, which we will see, below. We need (drum roll please): The Parametric Object Pool Design Pattern (POP) By Douglas A. Lyon ABSTRACT The goal of the Parametric Singleton design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values, in a given context. In comparison, the goal of the POP design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values and that only one reference to the class is checked out at a time, in a given context. A context is a namespace for holding identifiers during execution. In Java, A context can be changed in any of several ways. For example, creation of a new class loader, the deserialization of an old POP or the creation of a new process all create a new namespace. The POP Design Pattern combines the Parametric Singleton Design Pattern with the check out mechanism of the Object Pool Design Pattern. This enables unique creation of instances of a class. These instances are cached in a table. When a clients asks for an instance with these parameters, the cache is checked. If the instance is not in the cache it is created. If the instance is available, the clients checks out the instance. A reference is left to the clients that checked out the instance. The POP has the role of creating objects uniquely, from parameters. It also has the role of keeping track of which clients has checked out a given object. This is just like a library keeping track of who borrowed a book. If a resource is left unavailable in a system, a deadlock can occur. Deadlock debugging is facilitated by mapping a resource to the clients that have checked it out. We apply our POP Design Pattern to the retrieval of serial ports. The goal of our system is to make sure that serial ports are checked out to only one client at a time, and that they be checked back in when the client is done. The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. Users are discouraged from calling this the Parametric Object Oriented Pool (POOP). Introduction The intent of the POP Design Pattern is to ensure that a class has only one instance for a given set of parameter values. It also provides a point of access that is global to a given context. The POP uses the Singleton Design Pattern to ensure that there is only one POP, in the given context. The POP DP is responsible for checking out a reference to a given instance, and keeping track of that instance. The instance is responsible for sharing that instance. POP requires that users of the DP implement an interface that enables a recall facility. Thus, if there is a contention for a consumed resource, the deadlock can be resolved in an orderly fashion. Motivation A system cannot tolerate multiple instances of some classes with identical parameters used by different instances at the same time. For example, you cannot have two instances use the same serial port, at the same time. You cannot have two instances that are trying to listen to the same socket connection. You cannot have two instances writing to the same file structure at the same time. Further, once a serial port is checked out by a client, it is assigned to the client. This is like the spin-lock service provided by the operating system, only in the application layer. Naturally, deadlock will occur if a resource is not released, therefore the client of the resource is tracked. Recalling a resource is required for the POP DP by virtue of the implementation of an interface. The policy on how to break a deadlock (by honoring the recall) is application specific. As the operating system is often thought of as the arbiter of consumed resources (i.e., tape drives, serial ports, etc.) we frequently leave it to an operating system implementation to resolve these contention issues. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on naming conventions (which are not well standardized). The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. The POP Design Pattern can take on the role of the peer method mapper that homogenizes the API for different operating environments. That is, it can wrapper the different locking mechanisms used in different operating systems. POP that is responsible for keeping track of the instances created and the client that has checked them out. The POP Design Pattern is implemented using the Singleton Design Pattern. In Java, the POP implementation is declared final, so that it cannot be subclassed. The class also has a private constructor, so that other classes cannot instance it. The new design pattern is called the POP design pattern and it provides a way to check out and create instances with given parameters. Applicability Use the POP Design Pattern when: 1. There must be exactly one instance of a class with the given parameters in a given context. 2. The instances must be accessible to clients from a well-known access point. 3. The instances are reusable. 4. Only one client can check out an instance at a time. Structure Insert UML diagram here. Participants The POP Clients that need instances 1. The POP defines an instance upon request from a client, if, and only if, the instance does not already exist. 2. The POP returns the instance to the client. 3. The POP is responsible for creating unique instances from given parameters. 4. The POP is responsible to recalling instances from clients. Collaborations Clients obtain a reference to a POP instance only through the singleton design pattern. If the POP instance is left in an improper state (e.g., the serial port was left open) it is NOT the role of the POP to close the IO port. However, the POP can be requested to get the instance released. Nor is it the role of the POP Design Pattern to open the port. That role is delegate to some other part of the system. Further, it is the role of the POP Design Pattern to check out resources. However, it is still possible to have, multiple threads that have multiple references to the same resource at the same time. Checkout and resource requests are MUTEX locked (i.e., synchronized). Consequences The POP Design Pattern has several benefits: 1. Controlled access to parametrically defined instances. Since the POP encapsulates its instances, there is some limited control over how and when clients access it. 2. Reduced name space. The POP pattern avoids global variables that store instances created from the same parameter. Implementation Here are implementation issues to consider when using the POP pattern: 1. Unique mapping of parameters. The POP pattern requires that there be a mean to isomorphically map the parameter space into the instance space and back again. 2. Ensure unique instances. The POP pattern makes unique instances from parameters, and it does so only once. 3. Cache instances for fast retrieval. The POP must be able to look up instances, given some set of parameters, and do so from some data structure. That is, there must be enough space to hold references to all the instances the program will need. Also, a mechanism is needed to look up and retrieve the instances quickly enough to satisfy the clients. Sample Code To be written....any volunteers? Thanks! - Doug >I don't think I get it > >On Mar 22, 2006, at 9:36 AM, David Garnier wrote: >>Using the singleton pattern in this case is >>just convenient for the programmer. Problems >>arises >>pretty quickly, especially if you attempt to unit-test your classes. > > >so you're saying that something isn't so good >because you can not test it in the convenient >way? >if that's true, I'm totally disagree >change your test, debug whatever, but if >software is efficient at runtime, works fine and >only problem is some unit test >(which is some kind of framework for testing) >then dump that unit test , dump that unit >framework and make something appropriate to the >software >you're testing > >so if Douglas want to use singletons, what's the problem? >and what do you mean by abusing of singleton usage? > >of course singleton doesn't prevent concurrent >access to the resource across the processes >unless >you're using some OS facility to prevent it, besides >singleton as it was introduced is relevant only >and only inside of the same process >otherwise it's not singleton it's something else >(let's say network singleton: so you have remote >invocation facility >and some factory method that return object created by that facility) > >I don't have any problem with using any kind of singletons. > Parametric Singleton idea (if I understand it >right) could be easily implemented in the >following way: >use a map >populate map with instances of some class and key is your parameter >(you can use lazy population too) > >if somebody ask the key check the value if it's null so resource is taken >if somebody returns the resource put it back to the map > >public synchronized static Object getSomeResource(Object parameter); >public synchronized static void returnResource(Object parameter); > >getSomeResource (inside of the same process) could return null in 2 cases >1. if somebody (from other thread for example) already took that resource >2. if OS API said that resource corresponded to >that parameter (serial port with parameter = 1 >(port #)) >is locked and unavailable; >I'm not sure that in case of serial ports we >even need those Parametric Singletons >(unless lock checking is a very expensive operation) >just ask the OS about availability of that >resource and if it's available give it away >and then OS will lock it and therefore in next >time somebody ask it just answer that resource >is locked >and return null > >for example system has 2 serial ports available >so I ask getResource("tty"); >or I ask getResource("Bluetooth-Modem"); > >and if OS is ok you can give tty or Bluetooth-Modem or both > >no need for any additional pattern I think > >back to the problem >mac os x doesn't recognize locking via files, so >it handles locking via some API >an instance of the singleton in each process >should recognize that resource is locked >(by using that API) that's all >we don't have to make things more complicate >then they are just because there is some nice >design pattern or nice unit test framework or whatever >keep things simple, make them work fast, don't introduce middle layers >unless you have really good reason to do so > >of course I could be entirely wrong, so sorry about that in advance > >thanks > > >Dmitry Markman > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx >Good day, > >I guess that only a selected few (hi Trent) will be able to answer? >this question, but the answer might be interesting for anyone trying? >to debug or understand the code. > >Apparently the MonitorThread is started and stopped in? >RXTXPort.addEventListener and RXTXPort.removeEventListener. This? >would indicate that (originally?) the MonitorThread is only required? >when there is an EventListener. However the MonitorThread is also? >started in the RXTXPort constructor, which could mean that RXTX won't? >work at all if it isn't there. > >It seems to me, that if anyone would add an event listener and later? >on remove it, he could potentially wreak the port. Because the second? >action would kill the MonitorThread. > > >For the moment I am only trying to understand the role of and idea? >behind the MonitorThread. But of course there is a deeper reason thor? >my question: > >If the MonitorThread needs to exist anyway, it could be the thread? >that cleans up the port (ie calls nativeClose) - this would eliminate? >(a further) problem I am seeing with some USB drivers on Mac OSX.? >(Close blocks (after releasing the tty, but still) in the USB driver? >if the device is "not responding"). > >Greetings, >Joachim > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Sat May 13 10:07:37 2006 From: joachim at buechse.de (Joachim Buechse) Date: Sat, 13 May 2006 18:07:37 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Douglas, Looking at the current code, leaves me with the feeling, that there is a lot to do. Defining an API that wraps javax.comm to provide what you describe is certainly possible, but I wonder how much benefit it will actually provide. Personally I think the API defined by javax.comm "request/lock" a port with: cp= new CommunicationPort(identifier) "release" a port with: cp.close(); works quite nice for 99% of the applications. In my experience, the most efficient and elegant implementation is to wrap a port/socket/.. into a business object which declares the remote operations that are possible. Ie "uploadFile", "waitForPrompt", "getSerialNumber", "sendContact", "executeCommand", etc Those methods are then either synchronized or guarded by a monitor. I do not see how your design pattern applied to the port resource would help implementing this. [details start, skip if you agree to the above] When I talked about "thread-safe" I didn't mean several independent "sessions" accessing the port concurrently. I think this is a very rare usage. I believe the most common use case for serial ports today is the control of an external device from a PC running a GUI based application. To implement a clean Swing/AWT-GUI one needs to pass any action that can block to a "worker" thread (else the GUI blocks, the application appears dead). While it is possible to use own prespawned thread that will accept Runnables which operate on the port, this is not very elegant. It is more common to spawn a new thread for every action triggered by the user. Additionally the ABORT of a running operation is often implemented via a port.close() delegated to a different thread. - During the lifetime of a port, it will usually be accessed from several different threads. Instance variables need to be set/read in synchronized regions to guarantee a correct operation based on the Java memory model. - Synchronizing the access is usually handled on the application level (synchronizing the reads/writes is usually useless from the applications view because it is not a transaction mechanism). [details end] I am very open to learn about other scenarios where your proposed design pattern applied to the port resource is beneficial to the application implementor. Best regards, Joachim On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > Dmitry suggests that we acquire an implementation of > a serial port reference, use it, then release it (i.e., check it > back in). > > Joachim says that making serial ports thread friendly might be a > good idea. > > This is a good idea. The design pattern that is close to this idea > is the "Object Pool Design Pattern". > # Object Pool From jredman at ergotech.com Sun May 14 14:28:24 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 14:28:24 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers Message-ID: <446792E8.4000506@ergotech.com> Does anyone know of any work to make RXTX work with Ethernet (telent) Terminal Servers? If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? We've used RXTX with upwards of 100 virtual COM ports on Windows and it works well. Linux is more problematic. It would be good to have an OS independent solution to accesses remote Ethernet serial ports. Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From legolas.w at gmail.com Sun May 14 14:26:34 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:56:34 +0430 Subject: [Rxtx] does any one have a working sample of RXTX and LPT port Message-ID: <4467927A.4000008@gmail.com> Hi Thank you for reading my post does any one has a working sample for RXTX and LPT port ? Thanks From legolas.w at gmail.com Sun May 14 14:27:29 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:57:29 +0430 Subject: [Rxtx] does RXTX support Trigerr on parallel port? Message-ID: <446792B1.4040905@gmail.com> Hi does RXTX support trigger on LPT port ? if so , how i can use it ? Thanks From tjarvi at qbang.org Sun May 14 17:40:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 17:40:59 -0600 (MDT) Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: <446792E8.4000506@ergotech.com> References: <446792E8.4000506@ergotech.com> Message-ID: On Sun, 14 May 2006, Jim Redman wrote: > Does anyone know of any work to make RXTX work with Ethernet (telent) > Terminal Servers? > > If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 > Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? > Hi Jim It appears the author of NVTCom has decided to release the library into the public domain. Integration with rxtx is possible but it would be best to contact the author and find out what his intent is. I would suggest contacting the author with a proposal of what you would like to do and take it from there. We could 'take' public domain software but its better to show respect to the authors and respect their wishes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:10:23 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:10:23 -0600 (MDT) Subject: [Rxtx] does any one have a working sample of RXTX and LPT port In-Reply-To: <4467927A.4000008@gmail.com> References: <4467927A.4000008@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > Thank you for reading my post > does any one has a working sample for RXTX and LPT port ? > Thanks Hi Legolas LPT port support in rxtx is spotty. That means some people have sent in patches for what they do and it works well for them. The original code was not very good. It may have been 3 hours work :/ To get started, Sun has some demo programs with their commapi. With rxtx 2.1 you can change their code from using javax.com to gnu.io and it -should- work. But if it does not you can post here and on bugzilla. There has been more interest lately off the list and maybe there will be enough community resources to get what you need going. If you do get a sample program together, we would gladly put it in the contrib directory so the next person can get things going faster. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:12:12 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:12:12 -0600 (MDT) Subject: [Rxtx] does RXTX support Trigerr on parallel port? In-Reply-To: <446792B1.4040905@gmail.com> References: <446792B1.4040905@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > does RXTX support trigger on LPT port ? > if so , how i can use it ? > Hi Legolas As mentioned in the previous post, rxtx parallel support is not very mature. But if you can point to something that describes the trigger feature, we can probably make sure its there and give a quick code example. -- Trent Jarvi tjarvi at qbang.org From jredman at ergotech.com Sun May 14 22:22:48 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 22:22:48 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: References: <446792E8.4000506@ergotech.com> Message-ID: <44680218.4080008@ergotech.com> Trent, Trent Jarvi wrote: > On Sun, 14 May 2006, Jim Redman wrote: > >> Does anyone know of any work to make RXTX work with Ethernet (telent) >> Terminal Servers? >> >> If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 >> Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? >> > > Hi Jim > > It appears the author of NVTCom has decided to release the library into > the public domain. Integration with rxtx is possible but it would be best > to contact the author and find out what his intent is. > > I would suggest contacting the author with a proposal of what you would > like to do and take it from there. We could 'take' public domain software > but its better to show respect to the authors and respect their wishes. > I sent Marco(?), the author of the library, a note before asking the list - I'll let you know the response. If anyone is already working on it, or has an interest and more time and energy than me, I'd hate to duplicate the efforts. If no one is, and no one objects, maybe I'll see what I can do. Jim > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From Christian.Klemke at t-online.de Mon May 15 02:23:06 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Mon, 15 May 2006 10:23:06 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu><004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: <008a01c677f8$cae18590$02fea8c0@NB600> Hi Trent, Hi Paul, I finally found some time to create a simple patch to enable the optional suppression of version output to the console. It is based on a new system property called "gnu.io.rxtx.NoVersionOutput" which can by set to "true" if necessary. I had some problems accessing CVS, therefore I downloaded the rxtx-2.1-7r2 source archive from ftp.qbang.org (which is linked on the rxtx.org download page) and worked with that release. Please find my proposed patch in the attachment ! Regards, Christian ----- Original Message ----- From: "Trent Jarvi" To: "RXTX Developers and Users" Cc: ""Paul Gettings"" Sent: Friday, May 05, 2006 2:09 PM Subject: Re: [Rxtx] RXTX causing stdout messages > On Fri, 5 May 2006, Christian Klemke wrote: > >> Hi Paul, >> >> I was wondering about the same question some days ago and took a look at >> the >> source files. Unfortunately, I found that you can only get rid of that >> messages by altering and recompiling the Java code. There is a final >> static >> boolean variable called "devel" in the file "RXTXCommDriver.java" which >> is >> set to "true". This constellation causes the output after the native >> libraries have been loaded. No mechanism exists to suppress them >> otherwise >> :-(. >> >> Trent, does that mean that 2.1.7 is still officially a "development" >> version >> ? When will this value be changed to "false" by default ? With 2.1.8 ? It >> would be nice to provide a means to suppress such messages besides that >> static flag (maybe by setting a property called >> "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The >> output can indeed by annoying, especially when used with console >> applications, where the message potentially appears "in the middle" of >> your >> own output. Another possibility would be not to use System.out directly, >> but >> instead some PrintStream field which is initially set to System.out but >> can >> programatically be changed. That would allow for any kind of redirection >> or >> suppression by implementing appropriate user-defined PrintStream >> subclasses >> and making RXTX use that stream. What do you think ? >> > > A patch for using properties would be accepted I'm sure. > > The reason the default is to display the message is not related to the > development state of rxtx anymore. The problem is that people first using > rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. > The message prevents a great deal of email thats easily explained by the > message. > > I question if we should support rxtx 2.0 at all anymore. > > If you post a patch in bugzilla, we'll put it into CVS this weekend. > we'll be going through and doing such things anyhow. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_version_output_patch.diff Type: application/octet-stream Size: 991 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060515/3173c2b6/rxtx_version_output_patch-0003.obj From lyon at docjava.com Mon May 15 06:06:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 May 2006 08:06:21 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Joachim makes several good points. Let me see if I can address some of them below: >Hello Douglas, > >Looking at the current code, leaves me with the feeling, that there? >is a lot to do. Yes! >Defining an API that wraps javax.comm to provide what? >you describe is certainly possible, but I wonder how much benefit it? >will actually provide. > >Personally I think the API defined by javax.comm > >"request/lock" a port with: > cp= new CommunicationPort(identifier) >"release" a port with: > cp.close(); > >works quite nice for 99% of the applications. I don't know what percentage of applications turn off locking, the way that I do in my version of the RXTX lib. I do know that this is not safe practice. I also know that it was motivated by the multi-platform nature of my code and that this was the only way I could make things work, at the time. Java does not appear to have a cross-platform standard for locking resources on various platforms. Each OS appears to have its own standard. The question of who breaks deadlocks and how this is done remains open, as this is not an easy question to resolve. Let me continue, below: > >In my experience, the most efficient and elegant implementation is to? >wrap a port/socket/.. into a business object which declares the? >remote operations that are possible. Ie "uploadFile",? >"waitForPrompt", "getSerialNumber", "sendContact", "executeCommand",? >etc Those methods are then either synchronized or guarded by a? >monitor. I do not see how your design pattern applied to the port? >resource would help implementing this. I have no problem with high-level wrappers that are application specific. That is a very good idea, but orthogonal with respect to the issue of deadlocks. More below: > >[details start, skip if you agree to the above] >When I talked about "thread-safe" I didn't mean several independent? >"sessions" accessing the port concurrently. I think this is a very? >rare usage. That is probably why turning locking off works so well! On the other hand, it is not safe and I shouldn't do it. >I believe the most common use case for serial ports today? >is the control of an external device from a PC running a GUI based? >application. To implement a clean Swing/AWT-GUI one needs to pass any? >action that can block to a "worker" thread (else the GUI blocks, the? >application appears dead). While it is possible to use own prespawned? >thread that will accept Runnables which operate on the port, this is? >not very elegant. It is more common to spawn a new thread for every? >action triggered by the user. Additionally the ABORT of a running? >operation is often implemented via a port.close() delegated to a? >different thread. Here lies the heart of serial port concern. An application opens a serial port and then dies. The application is restarted and finds the port locked. How do we clear the lock? Must the application's user reside in the UUCP group? Must installers of the serial port add users to the UUCP group? Should locking be handled at a high-level of abstraction in an operating system independent way? Should the implementation of the locking mechanism be translated into an API that is dependent on the OS convention? Suppose that we restrict the discussion to serial ports. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on inconsistent naming conventions. Hence my feeling that we need to mirror what is done in other API's; we need a locking toolkit that references peer methods, IMHO. >From the Java programming point of view, the locking API is portable across different platforms, but has, as its implementation, a native peer method that uses the conventions of the underlying OS. This enables portable resource locking (in theory!). Consider, for example: org.apache.commons.transaction.locking with: Interface LockManager at: http://jakarta.apache.org/commons/transaction/apidocs/org/apache/commons/transaction/locking/LockManager.html Or, more recently: java.util.concurrent.locks Interface Lock based on Doug Lea's code: http://kickjava.com/src/EDU/oswego/cs/dl/util/concurrent/ReadWriteLock.java.htm Should we incorporate a clean, portable design into serial port use, one that is consistent with current locking APIs? Basically, a comm port is a resource and resources are typically controlled by managers. Thus, I suggest that we make use of a CommPortManager to help control and centralize serial port usage. The question of how this is done remains open, IMHO, but using core API's like: java.util.concurrent.locks might not be amiss. High-level methods (getAllPorts, getAllSerialPorts, getAllParallelPorts, etc...) might be welcome additions. Basic questions like, "what if a port is in use?" remain open, hence my proposal for the new design pattern. Isn't it the CommPortManager's role to break the deadlock? Cheers! - Doug > >- During the lifetime of a port, it will usually be accessed from? >several different threads. Instance variables need to be set/read in? >synchronized regions to guarantee a correct operation based on the? >Java memory model. >- Synchronizing the access is usually handled on the application? >level (synchronizing the reads/writes is usually useless from the? >applications view because it is not a transaction mechanism). >[details end] > >I am very open to learn about other scenarios where your proposed? >design pattern applied to the port resource is beneficial to the? >application implementor. > >Best regards, >Joachim > >On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > >> Dmitry suggests that we acquire an implementation of >> a serial port reference, use it, then release it (i.e., check it? >> back in). >> > > Joachim says that making serial ports thread friendly might be a? >> good idea. >> >> This is a good idea. The design pattern that is close to this idea >> is the "Object Pool Design Pattern". >> # Object Pool > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Mon May 15 06:58:19 2006 From: joachim at buechse.de (Joachim Buechse) Date: Mon, 15 May 2006 14:58:19 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Doug, I agree fully, that locking of the system resource should be abstracted from the user (programmer). Currently this is already the case, but I agree it might be nice to extract the code into a separate class, which uses platform dependent providers to do its job. What I described in my email was not targeted at allocating the system resource, but at handling an already allocated system resource inside the framework. I agree that it may be possible to combine the two - however, I would suggest to do this in phase2. I can contribute a work over of RXTXPort.java which implements clean internal locking and proper close behavior (which I would call phase 1). I could do this this week. However I strongly believe that there is little sense in trying to do this as a series of patches. It will be closer to a rewrite than to a patch. I have already provided a number of suggested patches via Bugzilla, but this is quite inconvenient (for me). My working copy diverges more and more from the master and hence it gets more and more annoying to provide self contained patches. Best regards, Joachim From tjarvi at qbang.org Mon May 15 08:27:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 May 2006 08:27:51 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Mon, 15 May 2006, Joachim Buechse wrote: > Hello Doug, > > I agree fully, that locking of the system resource should be > abstracted from the user (programmer). Currently this is already the > case, but I agree it might be nice to extract the code into a > separate class, which uses platform dependent providers to do its job. > > What I described in my email was not targeted at allocating the > system resource, but at handling an already allocated system resource > inside the framework. I agree that it may be possible to combine the > two - however, I would suggest to do this in phase2. > > I can contribute a work over of RXTXPort.java which implements clean > internal locking and proper close behavior (which I would call phase > 1). I could do this this week. > > However I strongly believe that there is little sense in trying to do > this as a series of patches. It will be closer to a rewrite than to a > patch. I have already provided a number of suggested patches via > Bugzilla, but this is quite inconvenient (for me). My working copy > diverges more and more from the master and hence it gets more and > more annoying to provide self contained patches. > For methodical testing purposes (which does go on) the incremental patches are better. I'm lagging behind in bugzilla but thats soon to change (this week). It has just been rather chaotic up until now. I moved, purchased a house, and jumped into the fire of a feature freeze timeframe at a new job. btw, we see the Solaris close issues on 2.8 also. 9 and 10 are fine. I'll work towards making those test results public and allow others to run new rxtx code through them. We had the OK at one point but setting up the environment is involved. It isn't just a collection of java classes. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Tue May 16 02:01:47 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:01:47 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] Message-ID: <446986EB.209@willicon.de> Hi, any ideas for my problem? Hans -------- Original-Nachricht -------- Betreff: [Rxtx] Problem under Mac OSX 10.3.9 Datum: Mon, 08 May 2006 18:47:20 +0200 Von: WILLICon Antwort an: RXTX Developers and Users An: RXTX Developers and Users Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/b0741c2b/attachment-0003.html From joachim at buechse.de Tue May 16 02:15:08 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 10:15:08 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: Hello Hans, I am using RXTX on OS X for my own project. I do not see the problem you describe. I had some troubles installing it because the current version uses lock files which is non-standard on OS X. I have created a patched version which I currently use. This version does not need to modify user groups and hence does not need an installer. I just pop it in the application directory. If you send me a link where I can download your OSX installer, I will have a quick look. Regards, Joachim On 16.05.2006, at 10:01, WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we > have some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + > spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + > spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always > the value "false". > I can only get the status, while I open the port and catch the > exception. > > Any ideas? > > Hans > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail at willicon.de Tue May 16 02:26:53 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:26:53 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: References: <446986EB.209@willicon.de> Message-ID: <44698CCD.7050709@willicon.de> Joachim, tanks for the answer. I'll send You a mail. Hans Joachim Buechse schrieb: > Hello Hans, > > I am using RXTX on OS X for my own project. I do not see the problem > you describe. > > I had some troubles installing it because the current version uses > lock files which is non-standard on OS X. I have created a patched > version which I currently use. This version does not need to modify > user groups and hence does not need an installer. I just pop it in > the application directory. If you send me a link where I can download > your OSX installer, I will have a quick look. > > Regards, > Joachim > > On 16.05.2006, at 10:01, WILLICon wrote: > > >> Hi, >> >> any ideas for my problem? >> >> Hans >> >> -------- Original-Nachricht -------- >> Betreff: [Rxtx] Problem under Mac OSX 10.3.9 >> Datum: Mon, 08 May 2006 18:47:20 +0200 >> Von: WILLICon >> Antwort an: RXTX Developers and Users >> An: RXTX Developers and Users >> >> >> Hi, >> >> I use for RXTX for communicate with CyclingComputers. >> >> It works good under Win32, Sloaris and Linux but with Mac OSX we >> have some problems. >> >> My users install the Mac OSX serial lib from the actual binary. >> >> After starting the program, they get this error message: >> >> java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while >> loading gnu.io.RXTXCommDriver >> >> Remember, this error comes only under Mac OSX. >> >> That is the code for the error: >> >> Enumeration portList = CommPortIdentifier.getPortIdentifiers(); >> spInUse = getBundleStr("serialPortInUse"); >> spFree = getBundleStr("serialPortFree"); >> while (portList.hasMoreElements()) { >> CommPortIdentifier portId = (CommPortIdentifier) >> portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (osName != null && osName.startsWith("mac")) { >> if (!portId.getName().startsWith("dev/cu.")) { >> continue; >> } >> } >> if (portId.isCurrentlyOwned()) { >> serialPortNames.add(portId.getName() + " - " + >> spInUse); >> } >> else { >> serialPortNames.add(portId.getName() + " - " + >> spFree); >> } >> } >> } >> if (serialPortNames.size() == 0) { >> serialPortNames.add(getBundleStr("serialPortNotFound")); >> } >> >> BTW: The methode isCurrentlyOwned() is not working. I get always >> the value "false". >> I can only get the status, while I open the port and catch the >> exception. >> >> Any ideas? >> >> Hans >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/948333be/attachment-0003.html From jredman at ergotech.com Tue May 16 07:35:52 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 16 May 2006 07:35:52 -0600 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: <4469D538.6070408@ergotech.com> Hans, I have no direct insight, but would note that what you have is a "NoClassDefFoundError" not a "ClassNotFoundException". So the class javax/comm/CommDriver is found, but one of its dependencies is missing. NoClassDefFoundError are a bigger problem to resolve because you get no indication of the real problem. Jim WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we have > some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > * spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always the > value "false". > I can only get the status, while I open the port and catch the exception. > > Any ideas? > > Hans > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.de Tue May 16 08:01:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 16:01:21 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 In-Reply-To: <4469AFC3.6000002@willicon.de> References: <44698EBC.8000008@willicon.de> <8C5680C4-E2BA-42FF-B221-36E1124FA6A4@buechse.de> <4469AFC3.6000002@willicon.de> Message-ID: <9825A602-D6ED-4C28-BF33-9A7C984FACD5@buechse.de> Hallo Hans, you include RXTX 2.17 in your "bikeXexperience.jar" (2.17 uses Interfaces from gnu.io.* not javax.comm.*). Now inspect your error log closely: The class gnu.io.RXTXCommDriver tries to load javax.comm.CommDriver: this is only the case for RXTX 2.07. I assume, that the user has installed Version 2.07 into one of the java.ext.dirs . The VM always tries to load classes from the "system" path first. The current Mac installer distributed with RXTX in fact installs RXTXcomm.jar and librxtxSerial.jnilib into /Library/Java/Extensions. (I wrote some time ago that I consider this as a bad idea because of potential version conflicts-> thanks for delivering the example). For 2.07 it does so without installing the javax.comm classes it seems. I would recommend that you instruct your users to install version 2.17 only. Until RXTX is changed to use TIOCEXCL instead of lock files, you can hardly avoid the installer, as the user needs to be added to a special group and a lockfile directory needs be created. More precisely you are waiting for: http://bugzilla.qbang.org/show_bug.cgi?id=50 [RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL)] Regards, Joachim -------------- next part -------------- A non-text attachment was scrubbed... Name: log.tiff Type: image/tiff Size: 38394 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/e3e52128/log-0003.tiff -------------- next part -------------- > > Ich verwende RXTX 2.17. Das orginal RXTXcomm.jar ist in > CyclingDataManager.jar enthalten. > From tjarvi at qbang.org Wed May 17 23:18:15 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 May 2006 23:18:15 -0600 (MDT) Subject: [Rxtx] update Message-ID: So we have several patches and these have stacked up. I'd like to thank everyone for being patient. Tests for the most intrusive patches look good so far. I still have to get some bits together on my end but it looks like we can catch everything up in CVS this week. I'll try to post a normal list of what went in by whom with links Saturday. But I'm not seeing anything that raises flags yet. I also think I'll be able to submit a patch for nonstandard baud rates. I have to confirm w32 but I think its going to be a one line fix. I don't know if its bugzilla or people tinkering with patch files before submitting but patches are not applying cleanly. So the patches have to be done by hand. This may make things difficult for people hoping to add other patches on top. I'm trying to make that go well but ... -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Thu May 18 02:23:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 May 2006 10:23:47 +0200 Subject: [Rxtx] update In-Reply-To: References: Message-ID: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Hello Trent, in fact I tinkered with the patches (never used this mechanism before, usually I "communicate" via cvs) ... so sorry for any trouble you had applying them. Basicly I edited the patches to make them self contained. Having the tests run with different speeds on different platforms, may well be an effect of caching. I have seen quite interesting propagation delays for the closing flag on my PowerPC system, which makes me doubt, that the propagation of output_buffer_empty_flag works as it should. Maybe the communication mechanism between the two threads should be replaced by something like pthread_cond_*. Could you describe which problems you see on Solaris/SPARC? I'd be interested to see if they exist on OS X (PowerPC) as well... As you seem to work on the stuff at the moment I would like to suggest the following additions (it looks more than it is, I posted some context to make clear where to apply the change). See the comments in braces for what was changed Greetings, Joachim (1) The end of the drain loop could be: --- report("drain_loop: received EINTR in tcdrain\n"); --- (added "in tcdrain" to make debug output clearer) (2) The start of the drain loop should be: --- for(i=0;;i++) { report_verbose("drain_loop: looping\n"); #if defined(__sun__) /* FIXME: No time to test on all OS's for production */ if( eis->eventloop_interrupted ) { goto end; } if (usleep(5000)) { report("drain_loop: received EINTR"); } #else if (usleep(1000000)) { report("drain_loop: received EINTR"); } #endif /* __sun__ */ --- (added a check for "eis->eventloop_interrupted" before the sleep) (3) The end of interrupt_event_loop could (and maybe should) be: --- #if !defined(TIOCSERGETLSR) && !defined(WIN32) /* make sure that the drainloop unblocks from tcdrain */ pthread_kill(index->drain_tid, SIGABRT); /* TODO use wait/join/SIGCHLD/?? instead of sleep? */ usleep(50 * 1000); /* Under normal conditions, SIGABRT will unblock tcdrain. However a non-responding USB device combined with an unclean driver may still block. This is very ugly because it may block the call to close indefinetly. */ if (index->closing != 1) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); index->closing = 1; } #endif report("interruptEventLoop: interrupted\n"); --- (added some comments and pthread_cancel for resisting drain thread) On 18.05.2006, at 07:18, Trent Jarvi wrote: > > So we have several patches and these have stacked up. I'd like to > thank > everyone for being patient. > > Tests for the most intrusive patches look good so far. I still > have to > get some bits together on my end but it looks like we can catch > everything > up in CVS this week. > > I'll try to post a normal list of what went in by whom with links > Saturday. But I'm not seeing anything that raises flags yet. I also > think I'll be able to submit a patch for nonstandard baud rates. > I have > to confirm w32 but I think its going to be a one line fix. > > I don't know if its bugzilla or people tinkering with patch files > before > submitting but patches are not applying cleanly. So the patches > have to > be done by hand. This may make things difficult for people hoping > to add > other patches on top. I'm trying to make that go well but ... > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu May 18 22:28:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 18 May 2006 22:28:00 -0600 (MDT) Subject: [Rxtx] update In-Reply-To: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> References: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Message-ID: On Thu, 18 May 2006, Joachim Buechse wrote: > Hello Trent, > > in fact I tinkered with the patches (never used this mechanism > before, usually I "communicate" via cvs) ... so sorry for any trouble > you had applying them. Basicly I edited the patches to make them self > contained. I think we are close to moving towards that. > > Having the tests run with different speeds on different platforms, > may well be an effect of caching. I have seen quite interesting > propagation delays for the closing flag on my PowerPC system, which > makes me doubt, that the propagation of output_buffer_empty_flag > works as it should. Maybe the communication mechanism between the two > threads should be replaced by something like pthread_cond_*. Could > you describe which problems you see on Solaris/SPARC? I'd be > interested to see if they exist on OS X (PowerPC) as well... This is interesting. I have seen problems with output buffer empty in applications that require it. I'm trying to get a bug list and or test results open for everyone to see but that may take time. But missed output buffer events ... yep. With Sparc, we have seen a few things. One was a kernel race condition that went away when we reimaged and updated 2.8. RXTX was hanging on close, top showed no cpu use but there was 2 second delays just typing on console. The other is our tests now take ~4 times longer on Solaris. Someone is looking at timing just open, close, read, write, ... to see if they can find where the slowdown is. This happened after solaris 2.8. I'll try to share more when/if there is something interesting. This may well not be solvable in userland. > > As you seem to work on the stuff at the moment I would like to > suggest the following additions (it looks more than it is, I posted > some context to make clear where to apply the change). See the > comments in braces for what was changed I'll take a look. This could all come together Saturday but I also have an event to attend that day. I may not wrap this up until Sunday. -- Trent Jarvi tjarvi at qbang.org From andrewlord at internode.on.net Sun May 21 20:10:02 2006 From: andrewlord at internode.on.net (Andrew Lord) Date: Mon, 22 May 2006 11:40:02 +0930 Subject: [Rxtx] Kernel include files do not match kernel Message-ID: <200605221140.03271.andrewlord@internode.on.net> Hi, I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel 2.6.12-18 with the command: ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include However I get the message: ## checking java.version 1.5.0_06 ## checking os.version 2.6.12-18mdk ## ## WARNING: Kernel include files do not match the current kernel ## ## configure: creating ./config.status etc. Is there a problem with the way I'm specifying the 'include' directory ? If not, how else can I specify the correct directory for the include files please ? Cheers, Andrew From tjarvi at qbang.org Sun May 21 20:31:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 May 2006 20:31:31 -0600 (MDT) Subject: [Rxtx] Kernel include files do not match kernel In-Reply-To: <200605221140.03271.andrewlord@internode.on.net> References: <200605221140.03271.andrewlord@internode.on.net> Message-ID: On Mon, 22 May 2006, Andrew Lord wrote: > Hi, > > I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel > 2.6.12-18 with the command: > > ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk > CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include > > However I get the message: > > ## checking java.version 1.5.0_06 > ## checking os.version 2.6.12-18mdk > ## > ## WARNING: Kernel include files do not match the current kernel > ## > ## configure: creating ./config.status > etc. > > Is there a problem with the way I'm specifying the 'include' directory ? If > not, how else can I specify the correct directory for the include files > please ? > Hi Andrew I'm fairly sure your --with-kernel option does nothing. The CPPFLAGS should do what you want. Maybe put an #error message in /usr/src/linux.../incude/linux/version.h But I don't recall a recent problem with version missmatches. It should work. Distros will even ship include files that don't match versions exactly. In theory it should never matter for users. I used to compile new kernels by hand and really didnt have a distro. I didnt have a seperate package of kernel headers for users (myself). When changing a gateway from linux 1.2.12 to 2.1.77, I would worry about such messages. So if you are doing something that weird, the message may be of use to you. If you just see the message on a distro you installed, it is more than likely harmless. -- Trent Jarvi tjarvi at qbang.org From mrogers at spro.net Mon May 22 14:45:39 2006 From: mrogers at spro.net (Mike Rogers) Date: Mon, 22 May 2006 14:45:39 -0600 Subject: [Rxtx] Sun's CommAPI -- think May? Message-ID: <447222F3.9040302@spro.net> Hi, Any word from Sun about progress towards fixing the Java CommAPI v3 "incompatibilities" so RXTX 2.0 can operate within the framework's namespace (javax.comm)? I recall mention of a May time frame. Thanks, Mike From paul.klissner at sun.com Mon May 22 15:09:27 2006 From: paul.klissner at sun.com (Paul Klissner) Date: Mon, 22 May 2006 14:09:27 -0700 Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <447222F3.9040302@spro.net> References: <447222F3.9040302@spro.net> Message-ID: <44722887.8080308@sun.com> Mike Rogers wrote: > Hi, > > Any word from Sun about progress towards fixing the Java CommAPI v3 > "incompatibilities" so RXTX 2.0 can operate within the framework's > namespace (javax.comm)? I recall mention of a May time frame. > > Thanks, > > Mike > We've had a lot of work come in. This hasn't been the only priority. I'm running behind the plan in addressing this, but will be looking at it again soon. Rather than state a new, I'll just say it is in progress, and not off the table. I'll get this fixed as soon as I can. Good timing for asking as we just started discussing javax.comm plans today, and I'll have some cycles to work on it soon. Paul From yhua537 at cse.unsw.edu.au Mon May 22 16:03:05 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Tue, 23 May 2006 08:03:05 +1000 (EST) Subject: [Rxtx] install rxtx in XP Message-ID: Hi Guys, I am new to serial port programming, and have no experience on programming java in xp, but my project require me to builld a communication link between xp and a UART device. Most of the information in the web site seems for linux only. including the commands such as export and chmod. How do I install rxtx in xp? cheers YiQi Huang From mark at mdsh.com Tue May 23 01:24:20 2006 From: mark at mdsh.com (Mark Himsley) Date: Tue, 23 May 2006 08:24:20 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off , it includes DLLs for Windows and the JAR for Java. Follow the Windows instructions in the INSTALL. ie RXTXcomm.jar goes in \jre\lib\ext (under java) rxtxSerial.dll goes in \jre\bin So, assuming a fairly standard Java install, copy RXTXcomm.jar into C:\Program Files\Java\jre1.5.0_06\lib\ext and copy rxtxSerial.dll into C:\Program Files\Java\jre1.5.0_06\bin Yes, it really is that simple. On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > I am new to serial port programming, and have no experience on > programming java in xp, but my project require me to builld a > communication link between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang -- Mark Himsley From joachim at buechse.de Tue May 23 02:51:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 23 May 2006 10:51:47 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) Unless it is absolutely required you should NOT install RXTX in your global Java Runtime Environment. This will for sure create versioning conflicts - if not now, than in the future, if not on your system than at your clients. Instead put the dll in your application directory and include the RXTXcomm.jar in your classpath. This is much safer and not a bit more complicated. Regards, Joachim On 23.05.2006, at 09:24, Mark Himsley wrote: > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR > for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > >> I am new to serial port programming, and have no experience on >> programming java in xp, but my project require me to builld a >> communication link between xp and a UART device. >> >> Most of the information in the web site seems for linux only. >> including >> the commands such as export and chmod. How do I install rxtx in xp? >> >> cheers >> YiQi Huang > > > > -- > Mark Himsley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tod at todbot.com Tue May 23 03:12:22 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 02:12:22 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I totally agree: do not contaminate the Java installation. I put all the RXTX files in a directory and then change my java invocation to be: % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* Alternatively, use Launch4J to create a double-clickable application and keep the RXTX libraries in the directory of the application. -=tod On May 23, 2006, at 1:51 AM, Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > >> Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off >> , it includes DLLs for Windows and the JAR >> for Java. >> >> Follow the Windows instructions in the INSTALL. >> >> ie >> >> RXTXcomm.jar goes in \jre\lib\ext (under java) >> rxtxSerial.dll goes in \jre\bin >> >> So, assuming a fairly standard Java install, copy RXTXcomm.jar into >> C:\Program Files\Java\jre1.5.0_06\lib\ext >> and copy rxtxSerial.dll into >> C:\Program Files\Java\jre1.5.0_06\bin >> >> Yes, it really is that simple. >> >> >> >> On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: >> >>> I am new to serial port programming, and have no experience on >>> programming java in xp, but my project require me to builld a >>> communication link between xp and a UART device. >>> >>> Most of the information in the web site seems for linux only. >>> including >>> the commands such as export and chmod. How do I install rxtx in xp? >>> >>> cheers >>> YiQi Huang >> >> >> >> -- >> Mark Himsley >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From smontgomery at mediaspansoftware.com Tue May 23 08:46:53 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Tue, 23 May 2006 10:46:53 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: Message-ID: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Joachim and Tod mentioned how to keep the files RXTX requires on Windows XP out of the Java installations - thanks gentlemen! Are there similar suggestions for an RXTX install on OS X? The current "canonical" OS X installation instructions "contaminate the Java installation", to use Tod's words. Our app will run fine under 1.4.2 and 5.0 on OS X, and a lot of users will have both. We've already been burned by the recent switch from 1.4.2 to 5.0 as the platform default. Any suggestions welcomed. From tod at todbot.com Tue May 23 13:27:55 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 12:27:55 -0700 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <9BA0F670-A862-42E7-BB2C-130D775ABDF9@todbot.com> Hi Sean, It depends on how you build and deploy your code. If you're using shell scripts, you can do something like this: #!/bin/sh # pick one JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/ Commands/java #JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/ Commands/java $JAVA -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* That both picks which VM to use and uses the RXTX in the directory called 'rxtxlib'. If you want your shell script to be clever, you could test for the existence of the different 'java' executables and go from there (maybe even use different jar files). I am almost positive all OS X systems with Java 1.5 are guaranteed to also have Java 1.4.2. If you're using Jar Builder or XCode, you can specify which JVM to use and add the extra args in the Info.plist file. The paths specified in the 'java' invocation then are based off of the $JAVAROOT variable that the JavaApplicationStub sets for you. For my app, I've have been compiling two sets of jars, one compiled with 1.4.2 and one with 1.5, but they both run under 1.5. So I have a similar shell script that chooses a different 'javac' depending on the need. -=tod On May 23, 2006, at 7:46 AM, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From yhua537 at cse.unsw.edu.au Tue May 23 11:09:37 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 03:09:37 +1000 (EST) Subject: [Rxtx] install rxtx in XP (Mark Himsley, Joachim Buechse, Tod E. Kurt> In-Reply-To: References: Message-ID: > Message: 8 > Date: Tue, 23 May 2006 08:03:05 +1000 (EST) > From: YiQi Huang > Subject: [Rxtx] install rxtx in XP > To: rxtx at qbang.org > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > Hi Guys, > > I am new to serial port programming, and have no experience on programming > java in xp, but my project require me to builld a communication link > between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang > > > ------------------------------ > > Message: 9 > Date: Tue, 23 May 2006 08:24:20 +0100 > From: Mark Himsley > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=us-ascii; format=flowed > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > ------------------------------ > > Message: 10 > Date: Tue, 23 May 2006 10:51:47 +0200 > From: Joachim Buechse > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > > ------------------------------ > > Message: 11 > Date: Tue, 23 May 2006 02:12:22 -0700 > From: "Tod E. Kurt" > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I totally agree: do not contaminate the Java installation. > > I put all the RXTX files in a directory and then change my java > invocation to be: > > % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* > > Alternatively, use Launch4J to create a double-clickable application > and keep the RXTX libraries in the directory of the application. > > -=tod > > Hi, Thanks guys, I don't know if this is the correct way to reply your mecessage, if wrong, please point out. Thank you for Mark to give the detail instructions and Joachim to point out the cons ot installing in the java directory, and specially thanks for Tod to give the instrection in detail. Sorry to ask another stupid question: I have followed Tod's instruction. Now I think i am ready to start hacking. But where is the RXTX API documentation? Is it the same as using normal java comm API? btw, where could i find some examples to start with? Thanks very much cheers YiQi Huang From tjarvi at qbang.org Tue May 23 16:09:32 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 May 2006 16:09:32 -0600 (MDT) Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <44722887.8080308@sun.com> References: <447222F3.9040302@spro.net> <44722887.8080308@sun.com> Message-ID: > Good timing for asking as we just started discussing javax.comm plans > today, and I'll have some cycles to work on it soon. Hi Paul I assume you mean Sun is discussing plans concerning its own internal actions and there is no community involvment at this point. -- Trent Jarvi tjarvi at qbang.org From yhua537 at cse.unsw.edu.au Tue May 23 22:50:01 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 14:50:01 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } From mmester at sps.edu Tue May 23 22:58:21 2006 From: mmester at sps.edu (Michael Mester) Date: Wed, 24 May 2006 00:58:21 -0400 Subject: [Rxtx] install rxtx in XP References: Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below -----Original Message----- From: rxtx-bounces at qbang.org on behalf of YiQi Huang Sent: Wed 5/24/2006 12:50 AM To: RXTX Developers and Users Subject: Re: [Rxtx] install rxtx in XP Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3950 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060523/b36d0c63/attachment-0003.bin From yhua537 at cse.unsw.edu.au Tue May 23 23:05:50 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 15:05:50 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: Yes, Michael you are right, it should be semicolons, But it still can't find the correct library. On Wed, 24 May 2006, Michael Mester wrote: > I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below > > > -----Original Message----- > From: rxtx-bounces at qbang.org on behalf of YiQi Huang > Sent: Wed 5/24/2006 12:50 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] install rxtx in XP > > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > cheers YiQi Huang From tod at todbot.com Wed May 24 00:01:57 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 23:01:57 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Yes, sorry, classpath entries are semicolon-separated on Windows and colon-separated on everything else. Your example code below is importing the wrong set of classes. It should not "import javax.comm.*", instead it should "import gnu.io.*". When I make that change, your example program compiles. The "javax.comm" package is the one released by Sun, the "gnu.io" package is the RXTX one. You might've seen some discussion that the two will be merged or become compatible, but that hasn't happened yet. -=tod On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > > Yes, Michael you are right, it should be semicolons, But it still > can't > find the correct library. > > On Wed, 24 May 2006, Michael Mester wrote: > >> I believe the entries in the classpath need to be seperated with >> semicolons, not a colon as you have in your command below >> >> >> -----Original Message----- >> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >> Sent: Wed 5/24/2006 12:50 AM >> To: RXTX Developers and Users >> Subject: Re: [Rxtx] install rxtx in XP >> >> Hi, >> >> Sorry guys.I follow Tod's instruction, and here is what i did: >> >> put >> RXTXcomm.jar, >> rxtxParallel.dll, >> rxtxSerial.dll >> in >> C:\RXTX_files >> >> and I got a SimpleRead class attached below, compile it with : >> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >> it still saying "cannot find symbol". >> >> Is there anything I did wrong? Do I need the comm.jar from Sun? >> >> Thanks & regards >> YiQi Huang >> >> >> //////////////////////////////////////////////////////// >> // SimpleRead.java >> //////////////////////////////////////////////////////// >> >> import java.io.*; >> import java.util.*; >> import javax.comm.*; >> >> public class SimpleRead >> implements Runnable, SerialPortEventListener { >> static CommPortIdentifier portId; >> static Enumeration portList; >> InputStream inputStream; >> SerialPort serialPort; >> Thread readThread; >> public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == >> CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals("COM1")) { >> //if (portId.getName().equals("/dev/term/a")) { >> SimpleRead reader = new SimpleRead(); >> } >> } >> } >> } >> public SimpleRead() { >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", >> 2000); >> } catch (PortInUseException e) {} >> try { >> inputStream = serialPort.getInputStream(); >> } catch (IOException e) {} >> try { >> serialPort.addEventListener(this); >> } catch (TooManyListenersException e) {} >> serialPort.notifyOnDataAvailable(true); >> try { >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } catch (UnsupportedCommOperationException e) {} >> readThread = new Thread(this); >> readThread.start(); >> } >> public void run() { >> try { >> Thread.sleep(20000); >> } catch (InterruptedException e) {} >> } >> public void serialEvent(SerialPortEvent event) { >> switch(event.getEventType()) { >> case SerialPortEvent.BI: >> case SerialPortEvent.OE: >> case SerialPortEvent.FE: >> case SerialPortEvent.PE: >> case SerialPortEvent.CD: >> case SerialPortEvent.CTS: >> case SerialPortEvent.DSR: >> case SerialPortEvent.RI: >> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >> break; >> case SerialPortEvent.DATA_AVAILABLE: >> byte[] readBuffer = new byte[20]; >> try { >> while (inputStream.available() > 0) { >> int numBytes = inputStream.read(readBuffer); >> } >> System.out.print(new String(readBuffer)); >> } catch (IOException e) {} >> break; >> } >> } >> } >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > cheers > YiQi Huang > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From joachim at buechse.de Wed May 24 00:10:06 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:10:06 +0200 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Hi Sean, my preferred way of dealing with RXTX on OS X is to include the RXTX classes into my application jar and to put the RXTX lib in the same directory as this jar. To make it even more comfortable, you can include the lib in the jar and have some startup code extract it and write it to a temporary file from which you load it with System.load(). Unfortunately the current version of RXTX for OS X requires tinkering with user groups as it is based on lockfiles - and hence it needs the RXTX OS X installer or you need to duplicated this functionality in your own installer. I have created my own native version which is not based on lockfiles but tty locking (the standard way to do it on OSX). I hope that these patches will be integrated soon into the distribution. Regards, Joachim On 23.05.2006, at 16:46, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Wed May 24 00:16:12 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:16:12 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <7017ECFC-B13E-4806-B321-9FFCAC5830F0@buechse.de> I assume you downloaded rxtx-217 (not 207). Instead of importing javax.comm.* you must import gnu.io.* The classes have the same name, but they are not in the same package. On 24.05.2006, at 06:50, YiQi Huang wrote: > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From yhua537 at cse.unsw.edu.au Wed May 24 00:17:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 16:17:45 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Message-ID: Thanks Tod again, i kept reading "gnu.io.*" as "gun.io.*" last few hours after i read some commons from web. Thanks very much Tod. thanks YiQi Huang On Tue, 23 May 2006, Tod E. Kurt wrote: > Yes, sorry, classpath entries are semicolon-separated on Windows and > colon-separated on everything else. > > Your example code below is importing the wrong set of classes. It > should not "import javax.comm.*", instead it should "import > gnu.io.*". When I make that change, your example program compiles. > The "javax.comm" package is the one released by Sun, the "gnu.io" > package is the RXTX one. You might've seen some discussion that the > two will be merged or become compatible, but that hasn't happened yet. > > -=tod > > > On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > >> >> Yes, Michael you are right, it should be semicolons, But it still >> can't >> find the correct library. >> >> On Wed, 24 May 2006, Michael Mester wrote: >> >>> I believe the entries in the classpath need to be seperated with >>> semicolons, not a colon as you have in your command below >>> >>> >>> -----Original Message----- >>> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >>> Sent: Wed 5/24/2006 12:50 AM >>> To: RXTX Developers and Users >>> Subject: Re: [Rxtx] install rxtx in XP >>> >>> Hi, >>> >>> Sorry guys.I follow Tod's instruction, and here is what i did: >>> >>> put >>> RXTXcomm.jar, >>> rxtxParallel.dll, >>> rxtxSerial.dll >>> in >>> C:\RXTX_files >>> >>> and I got a SimpleRead class attached below, compile it with : >>> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >>> it still saying "cannot find symbol". >>> >>> Is there anything I did wrong? Do I need the comm.jar from Sun? >>> >>> Thanks & regards >>> YiQi Huang >>> >>> >>> //////////////////////////////////////////////////////// >>> // SimpleRead.java >>> //////////////////////////////////////////////////////// >>> >>> import java.io.*; >>> import java.util.*; >>> import javax.comm.*; >>> >>> public class SimpleRead >>> implements Runnable, SerialPortEventListener { >>> static CommPortIdentifier portId; >>> static Enumeration portList; >>> InputStream inputStream; >>> SerialPort serialPort; >>> Thread readThread; >>> public static void main(String[] args) { >>> portList = CommPortIdentifier.getPortIdentifiers(); >>> while (portList.hasMoreElements()) { >>> portId = (CommPortIdentifier) portList.nextElement(); >>> if (portId.getPortType() == >>> CommPortIdentifier.PORT_SERIAL) { >>> if (portId.getName().equals("COM1")) { >>> //if (portId.getName().equals("/dev/term/a")) { >>> SimpleRead reader = new SimpleRead(); >>> } >>> } >>> } >>> } >>> public SimpleRead() { >>> try { >>> serialPort = (SerialPort) portId.open("SimpleReadApp", >>> 2000); >>> } catch (PortInUseException e) {} >>> try { >>> inputStream = serialPort.getInputStream(); >>> } catch (IOException e) {} >>> try { >>> serialPort.addEventListener(this); >>> } catch (TooManyListenersException e) {} >>> serialPort.notifyOnDataAvailable(true); >>> try { >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, >>> SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> } catch (UnsupportedCommOperationException e) {} >>> readThread = new Thread(this); >>> readThread.start(); >>> } >>> public void run() { >>> try { >>> Thread.sleep(20000); >>> } catch (InterruptedException e) {} >>> } >>> public void serialEvent(SerialPortEvent event) { >>> switch(event.getEventType()) { >>> case SerialPortEvent.BI: >>> case SerialPortEvent.OE: >>> case SerialPortEvent.FE: >>> case SerialPortEvent.PE: >>> case SerialPortEvent.CD: >>> case SerialPortEvent.CTS: >>> case SerialPortEvent.DSR: >>> case SerialPortEvent.RI: >>> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >>> break; >>> case SerialPortEvent.DATA_AVAILABLE: >>> byte[] readBuffer = new byte[20]; >>> try { >>> while (inputStream.available() > 0) { >>> int numBytes = inputStream.read(readBuffer); >>> } >>> System.out.print(new String(readBuffer)); >>> } catch (IOException e) {} >>> break; >>> } >>> } >>> } >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> >> cheers >> YiQi Huang >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From smontgomery at mediaspansoftware.com Wed May 24 10:24:13 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 12:24:13 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: Tod & Joachim, Thanks for the info, that's very helpful. I'll give that a whirl when I move to rxtx 2.1. I'm still using the older 2.0.7 version for now (don't ask), which probably requires the Sun comm.jar, javax.comm.properties and librxtxSerial.jnilib to be in very specific places in each jvm's file hierarchy. From tjarvi at qbang.org Wed May 24 11:59:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 11:59:16 -0600 (MDT) Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: On Wed, 24 May 2006, Sean Montgomery wrote: > Tod & Joachim, > > Thanks for the info, that's very helpful. I'll give that a whirl > when I move to rxtx 2.1. I'm still using the older 2.0.7 version for > now (don't ask), which probably requires the Sun comm.jar, > javax.comm.properties and librxtxSerial.jnilib to be in very specific > places in each jvm's file hierarchy. > You will need comm.jar from Sun then. It must be Sun's version 2.* or older for Linux or Solaris. I assume they have this in download archives. The default offering from Sun is version 3.0. This version currently does not support rxtx. The older version will probably be fine for your needs. -- Trent Jarvi tjarvi at qbang.org From smontgomery at mediaspansoftware.com Wed May 24 12:19:06 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 14:19:06 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: <3939EFB8-11E1-4E3E-A684-5B3C525577CD@mediaspansoftware.com> Yup, that's right, thanks Trent. I've been using these files for quite a while now. Thanks for bringing it up. I almost didn't mention using 2.0.7 because I didn't want to give any new members of the list the wrong idea! :-) On May 24, 2006, at 1:59 PM, Trent Jarvi wrote: > On Wed, 24 May 2006, Sean Montgomery wrote: > >> Tod & Joachim, >> >> Thanks for the info, that's very helpful. I'll give that a whirl >> when I move to rxtx 2.1. I'm still using the older 2.0.7 version for >> now (don't ask), which probably requires the Sun comm.jar, >> javax.comm.properties and librxtxSerial.jnilib to be in very specific >> places in each jvm's file hierarchy. >> > > You will need comm.jar from Sun then. It must be Sun's version 2.* or > older for Linux or Solaris. I assume they have this in download > archives. > > The default offering from Sun is version 3.0. This version > currently does > not support rxtx. > > The older version will probably be fine for your needs. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mark at mdsh.com Wed May 24 15:55:46 2006 From: mark at mdsh.com (Mark Himsley) Date: Wed, 24 May 2006 22:55:46 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <37B0FC4B1F3237321F093ABE@MacMini.local> On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) That's no problem. BUT, do note that the instructions I elaborated on are in the INSTALL file within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone please update the INSTALL file? > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > > , it includes DLLs for Windows and the JAR > > for Java. > > > > Follow the Windows instructions in the INSTALL. > > > > ie > > > > RXTXcomm.jar goes in \jre\lib\ext (under java) > > rxtxSerial.dll goes in \jre\bin > > > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > > C:\Program Files\Java\jre1.5.0_06\lib\ext > > and copy rxtxSerial.dll into > > C:\Program Files\Java\jre1.5.0_06\bin > > > > Yes, it really is that simple. > > > > > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > > > >> I am new to serial port programming, and have no experience on > >> programming java in xp, but my project require me to builld a > >> communication link between xp and a UART device. > >> > >> Most of the information in the web site seems for linux only. > >> including > >> the commands such as export and chmod. How do I install rxtx in xp? > >> > >> cheers > >> YiQi Huang > > > > > > > > -- > > Mark Himsley > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Mark Himsley From tjarvi at qbang.org Wed May 24 16:41:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 16:41:46 -0600 (MDT) Subject: [Rxtx] install rxtx in XP In-Reply-To: <37B0FC4B1F3237321F093ABE@MacMini.local> References: <37B0FC4B1F3237321F093ABE@MacMini.local> Message-ID: On Wed, 24 May 2006, Mark Himsley wrote: > > > On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > >> I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > That's no problem. > > BUT, do note that the instructions I elaborated on are in the INSTALL file > within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone > please update the INSTALL file? > > The INSTALL file may be updated by anyone at anytime. http://rxtx.qbang.org/wiki/index.php/Installation We are moving it to the wiki so end users may put the type of answers they would like to see in. Sometimes it's best if developers don't give what appears to be cryptic answers. You can even put in that jre/lib/ext is not the right place but you don't understand the classpath solution mentioned on the mail-list and then we know what to add. -- Trent Jarvi tjarvi at qbang.org From stramit at gmail.com Wed May 24 21:45:31 2006 From: stramit at gmail.com (Tim Cooper) Date: Thu, 25 May 2006 13:45:31 +1000 Subject: [Rxtx] Accessing Virtual Com Port Message-ID: Hi, I have to develop an application that talks to a virtual com port (in this case com3) which translates any messages sent across a USB cable to a micro. Using C++ I can talk to this com port and I know that it is configured, present, and working. For the application that I am trying to write I want to use RXTX for the communication. My problem is that the configured virtual port (in windows) is not showing up when I do an enumeration over the available ports. The output I get is (com 3 is not present) : Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 PORT FOUND: COM1 PORT FOUND: LPT1 Is there anything that I need to do to make com3 available to RXTX and my application? Timothy Cooper -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060524/c5591648/attachment-0003.html From antonio.luis at iscte.pt Thu May 25 01:39:13 2006 From: antonio.luis at iscte.pt (=?ISO-8859-1?Q?Ant=F3nio_Lopes?=) Date: Thu, 25 May 2006 08:39:13 +0100 Subject: [Rxtx] RXTX on Pocket PC Message-ID: <44755F21.8060103@iscte.pt> Hello everyone, I've been using RXTX to communicate with serial ports in Windows and it's been quite successful. However, I'm now considering porting my application from Windows to Pocket PC but I can't seem to find the RXTX binaries (*.jar and *.dll) to use in Pocket PC. I've been "digging" on the mailing list's archives and also on the web and I can't find these anywhere. Can anyone in this mailing list give me some pointers on this? Where can I find the necessary files and basic installation instructions? Thanks very much for your help. I very much appreciate any help that you can provide me. Regards, -- Ant?nio Lopes @contact: antonio.luis at iscte.pt @work: ADETTI - ISCTE @web: http://antonio.lopes.googlepages.com/home From doug at dupreeinc.com Fri May 26 15:45:50 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Fri, 26 May 2006 14:45:50 -0700 Subject: [Rxtx] rxtx slow startup Message-ID: <4477770E.9010400@dupreeinc.com> Hello, I hope there are people still reading this mailing list. The archive appeared to not have anything new after 4/2005. I was using the commapi from sun for a project where a java application reads data from test equipment connected to the serial port. I had to upgrade the ftdi vcp driver on my pc and the old sun commapi no longer works with hardware flow control. as an experiment I replaced the javax.com with gnu.io in the SerialDemo.java project that was included with the commapi. This compiled fine using JBuilder 2006 and JRE 1.5.0_05. RXTX also works with the latest ftdi drivers so life is wonderful again... almost... When using the commapi jar the SerialDemo program starts in about 1 second on my system. Using the RXTX jar it takes over 56 seconds to start. Has anyone else seen this problem? Is there a workaround to get the startup performance close to the old commapi? The last thing printed to the console before this delay is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks for your time! Doug From yhua537 at cse.unsw.edu.au Sat May 27 05:46:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 21:46:45 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <4477770E.9010400@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> Message-ID: hi Doug The archive hasn't been update for a long time, But people certainly still reading the list. I don't have enough experience to help on your problem, but without any detail about what your problem doing during that 56 seconds, it is hard to target the your question, I think. cheers YiQi On Fri, 26 May 2006, Doug Thistlethwaite wrote: > Hello, > > I hope there are people still reading this mailing list. The archive > appeared to not have anything new after 4/2005. > > I was using the commapi from sun for a project where a java application > reads data from test equipment connected to the serial port. I had to > upgrade the ftdi vcp driver on my pc and the old sun commapi no longer > works with hardware flow control. as an experiment I replaced the > javax.com with gnu.io in the SerialDemo.java project that was included > with the commapi. This compiled fine using JBuilder 2006 and JRE > 1.5.0_05. RXTX also works with the latest ftdi drivers so life is > wonderful again... almost... > > When using the commapi jar the SerialDemo program starts in about 1 > second on my system. Using the RXTX jar it takes over 56 seconds to > start. Has anyone else seen this problem? Is there a workaround to get > the startup performance close to the old commapi? > > The last thing printed to the console before this delay is: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Thanks for your time! > > Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------- Just a student, Still a student ------------------------------- From yhua537 at cse.unsw.edu.au Sat May 27 06:04:26 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 22:04:26 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: Sorry, I don't think you could understand what I mean .I mean this: Without any detail about what your program is doing during that 56 seconds, it is hard for anyone to target the problem. On Sat, 27 May 2006, YiQi Huang wrote: > hi Doug > > The archive hasn't been update for a long time, But people certainly still > reading the list. > > I don't have enough experience to help on your problem, but without any > detail about what your problem doing during that 56 seconds, it is hard to > target the your question, I think. > > cheers > YiQi > > On Fri, 26 May 2006, Doug Thistlethwaite wrote: > >> Hello, >> >> I hope there are people still reading this mailing list. The archive >> appeared to not have anything new after 4/2005. >> >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From jredman at ergotech.com Sat May 27 08:32:02 2006 From: jredman at ergotech.com (Jim Redman) Date: Sat, 27 May 2006 08:32:02 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: <447862E2.4080506@ergotech.com> Doug, Since you mentioned it, we have a system that is also seems slow. From memory (I don't have one of the slow systems around), I'm not sure that it's consistent, it seems that sometimes it may take longer than others. Since it's part of the bootup it hasn't raised a flag and I haven't researched it. The same code runs much faster on other systems, so now you've got me wondering what's different. The slow system boots DSL (http://www.damnsmalllinux.org/) from a compact flash. FC4 is on my desktop where I haven't noticed a slow down. I think that the rxtx code is the same in both cases with lock files disabled. The slow system has a bunch of serial ports defined, including 4 USB serial ports that do not exist - they are not plugged in. Any clues in there? Jim > On Fri, 26 May 2006, Doug Thistlethwaite wrote: >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Sat May 27 10:41:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 May 2006 10:41:54 -0600 (MDT) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447862E2.4080506@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: On Sat, 27 May 2006, Jim Redman wrote: > Doug, > > Since you mentioned it, we have a system that is also seems slow. From > memory (I don't have one of the slow systems around), I'm not sure that > it's consistent, it seems that sometimes it may take longer than others. > Since it's part of the bootup it hasn't raised a flag and I haven't > researched it. > > The same code runs much faster on other systems, so now you've got me > wondering what's different. > > The slow system boots DSL (http://www.damnsmalllinux.org/) from a > compact flash. FC4 is on my desktop where I haven't noticed a slow > down. I think that the rxtx code is the same in both cases with lock > files disabled. > > The slow system has a bunch of serial ports defined, including 4 USB > serial ports that do not exist - they are not plugged in. > > Any clues in there? > rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. When it does this, it will try to open each port and do a timed out read. most systems will not have entries in device if the port is not there. But some minimal systems will just put all the device files there in case hardware is added. The list of devices scanned used to be ~10-20 times longer than it is today. That was getting very slow. I suspect moving the device files not used to a backup directory would increase the enumeration. I'll look into why the mail-list archive is not updating. The last update was about when I thought I 'fixed' the cron jobs. I probably didn't actually fix it but rather moved the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon May 29 19:46:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 May 2006 19:46:47 -0600 (MDT) Subject: [Rxtx] Mail-List Archives are updating. Message-ID: It was pointed out earlier that the archive is dated. This was a missing crontab entry. The list is currently archived by the week on the web page. It is updated once a day. So every 7 days it starts a new link and updates it daily. I've been limited in what I could do while my cable modem was disconnected this last week. rxtx.org is something I do on my own time. The patches and credits will be comming next. Many of these can be seen in bugzilla right now. -- Trent Jarvi tjarvi at qbang.org From doug at dupreeinc.com Tue May 30 11:18:41 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 10:18:41 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: <447C7E71.4080204@dupreeinc.com> Trent, YiQi, and Jim: Thanks to all for the replies and information! I am just back from a long weekend and I am now trying to figure out what I was doing! :) As for more information. First off, this example is being run under windows XP. I am developing test equipment that communicates with a java application via a serial port. I have been using the commapi for several years and have not had a problem. Recently, I have started a design modification that will replace the RS232 connection with a USB port. I am using the ftdi module for prototyping and I discovered that their virtual com port driver was not compatible with the commapi that Sun released. It turns out that it has problems with hardware flow control ( it works on incoming but not outgoing communications). The way I figured this out was by experimenting with the SerialDemo that was included with the Sum commapi. One nice thing about this example is it has the ability to set incoming and outgoing flow control independently. After I installed RXTX into my JBuilder 2006 IDE, I just replaced all all instances of javax.comm with gnu.io and it compiled and runs without a hitch (except for the slow startup). I Paused the JBuilder IDE during this long pause and the last few entries in the stack trace are: testRead() : -1, gnu.io.RXTXCommDriver registerValidPorts() : 255, gnu.io.RXTXCommDriver registerScannedPorts() : 777, gnu.io.RXTXCommDriver This was all initiated by the following call in the programs init routine: Enumeration en = CommPortIdentifier.getPortIdentifiers(); After looking at this, My guess is that Trent is correct in that the delay is in scanning for ports. I guess one solution would be to not scan for ports, though it would be nice to detect what is available on the system. Is there any way to reduce the number of ports scanned by this function in windows XP? Thanks again for your time, Doug Trent Jarvi wrote: >On Sat, 27 May 2006, Jim Redman wrote: > > > >>Doug, >> >>Since you mentioned it, we have a system that is also seems slow. From >>memory (I don't have one of the slow systems around), I'm not sure that >>it's consistent, it seems that sometimes it may take longer than others. >>Since it's part of the bootup it hasn't raised a flag and I haven't >>researched it. >> >>The same code runs much faster on other systems, so now you've got me >>wondering what's different. >> >>The slow system boots DSL (http://www.damnsmalllinux.org/) from a >>compact flash. FC4 is on my desktop where I haven't noticed a slow >>down. I think that the rxtx code is the same in both cases with lock >>files disabled. >> >>The slow system has a bunch of serial ports defined, including 4 USB >>serial ports that do not exist - they are not plugged in. >> >>Any clues in there? >> >> >> > >rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. > >When it does this, it will try to open each port and do a timed out read. >most systems will not have entries in device if the port is not there. >But some minimal systems will just put all the device files there in case >hardware is added. > >The list of devices scanned used to be ~10-20 times longer than it is >today. That was getting very slow. > >I suspect moving the device files not used to a backup directory would >increase the enumeration. > >I'll look into why the mail-list archive is not updating. The last update >was about when I thought I 'fixed' the cron jobs. I probably didn't >actually fix it but rather moved the problem. > >-- >Trent Jarvi >tjarvi at qbang.org > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/86796453/attachment-0003.html From doug at dupreeinc.com Tue May 30 14:36:09 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 13:36:09 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447C7E71.4080204@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com> Message-ID: <447CACB9.1000801@dupreeinc.com> Hello all, I also notice this pause (not as long however) when I call: CommPortIdentifier.getPortIdentifier(PortName); I would think that if I supply the name of the port, it would not have to go through the same discovery process. If you have any ideas of how to get rid of this startup delay, I would really appreciate it. Thanks, Doug Doug Thistlethwaite wrote: > Trent, YiQi, and Jim: > > Thanks to all for the replies and information! I am just back from a > long weekend and I am now trying to figure out what I was doing! :) > > As for more information. First off, this example is being run under > windows XP. I am developing test equipment that communicates with a > java application via a serial port. I have been using the commapi for > several years and have not had a problem. Recently, I have started a > design modification that will replace the RS232 connection with a USB > port. I am using the ftdi module for prototyping and I discovered > that their virtual com port driver was not compatible with the commapi > that Sun released. It turns out that it has problems with hardware > flow control ( it works on incoming but not outgoing communications). > The way I figured this out was by experimenting with the SerialDemo > that was included with the Sum commapi. One nice thing about this > example is it has the ability to set incoming and outgoing flow > control independently. > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup). > > I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are: > > testRead() : -1, gnu.io.RXTXCommDriver > registerValidPorts() : 255, gnu.io.RXTXCommDriver > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > This was all initiated by the following call in the programs init routine: > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > After looking at this, My guess is that Trent is correct in that the > delay is in scanning for ports. I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system. Is there any way to reduce the number of ports scanned by > this function in windows XP? > > Thanks again for your time, > > Doug > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/edaa5c3c/attachment-0003.html From lynn at swcp.com Tue May 30 15:07:18 2006 From: lynn at swcp.com (lynn@swcp.com) Date: Tue, 30 May 2006 21:07:18 -0000 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CACB9.1000801@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: *IF* the name of the port is supplied, we might want to use the preferences mechanism (java.util.prefs) where we could have previously saved the info for the port. We could do a quick check to see that things have not changed before using it. If things have changed (or never been defined) we would do a full port scan and save detected ports in the preferences. This way if the hardware is not changed, you only pay the time penalty one time. just an idea... Lynn Doug Thistlethwaite said: > This is a multi-part message in MIME format. > --------------070808020900080005070500 > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > Content-Transfer-Encoding: 7bit > > Hello all, > > I also notice this pause (not as long however) when I call: > > CommPortIdentifier.getPortIdentifier(PortName); > > I would think that if I supply the name of the port, it would not have > to go through the same discovery process. If you have any ideas of how > to get rid of this startup delay, I would really appreciate it. > > Thanks, > > Doug > > Doug Thistlethwaite wrote: > > > Trent, YiQi, and Jim: > > > > Thanks to all for the replies and information! I am just back from a > > long weekend and I am now trying to figure out what I was doing! :) > > > > As for more information. First off, this example is being run under > > windows XP. I am developing test equipment that communicates with a > > java application via a serial port. I have been using the commapi for > > several years and have not had a problem. Recently, I have started a > > design modification that will replace the RS232 connection with a USB > > port. I am using the ftdi module for prototyping and I discovered > > that their virtual com port driver was not compatible with the commapi > > that Sun released. It turns out that it has problems with hardware > > flow control ( it works on incoming but not outgoing communications). > > The way I figured this out was by experimenting with the SerialDemo > > that was included with the Sum commapi. One nice thing about this > > example is it has the ability to set incoming and outgoing flow > > control independently. > > > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > > all instances of javax.comm with gnu.io and it compiled and runs > > without a hitch (except for the slow startup). > > > > I Paused the JBuilder IDE during this long pause and the last few > > entries in the stack trace are: > > > > testRead() : -1, gnu.io.RXTXCommDriver > > registerValidPorts() : 255, gnu.io.RXTXCommDriver > > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > > > This was all initiated by the following call in the programs init routine: > > > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > > > After looking at this, My guess is that Trent is correct in that the > > delay is in scanning for ports. I guess one solution would be to not > > scan for ports, though it would be nice to detect what is available on > > the system. Is there any way to reduce the number of ports scanned by > > this function in windows XP? > > > > Thanks again for your time, > > > > Doug > > > > --------------070808020900080005070500 > Content-Type: text/html; charset=ISO-8859-1 > Content-Transfer-Encoding: 7bit > > > > > > > > > Hello all,
>
> I also notice this pause (not as long however) when I call:
>
>          CommPortIdentifier.getPortIdentifier(PortName);
>
> I would think that if I supply the name of the port, it would not have > to go through the same discovery process.  If you have any ideas of how > to get rid of this startup delay, I would really appreciate it.
>
> Thanks,
>
> Doug
>
> Doug Thistlethwaite wrote: >
> > Trent, YiQi, and Jim:
>
> Thanks to all for the replies and information!  I am just back from a > long weekend and I am now trying to figure out what I was doing! :)
>
> As for more information.  First off, this example is being run under > windows XP.  I am developing test equipment that communicates with a > java application via a serial port.  I have been using the commapi for > several years and have not had a problem.  Recently, I have started a > design modification that will replace the RS232 connection with a USB > port.  I am using the ftdi module for prototyping and I discovered that > their virtual com port driver was not compatible with the commapi that > Sun released.  It turns out that it has problems with hardware flow > control ( it works on incoming but not outgoing communications).  The > way I figured this out was by experimenting with the SerialDemo that > was included with the Sum commapi.  One nice thing about this example > is it has the ability to set incoming and outgoing flow control > independently.
>
> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup).
>
> I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are:
>
> testRead() : -1, gnu.io.RXTXCommDriver
> registerValidPorts() : 255, gnu.io.RXTXCommDriver
> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>
> This was all initiated by the following call in the programs init > routine:
>
> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>
> After looking at this,  My guess is that Trent is correct in that the > delay is in scanning for ports.  I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system.  Is there any way to reduce the number of ports scanned by > this function in windows XP? 
>
> Thanks again for your time,
>
> Doug
>
>
> > > > --------------070808020900080005070500-- > -- From jredman at ergotech.com Tue May 30 15:42:35 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 30 May 2006 15:42:35 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: <447CBC4B.2080206@ergotech.com> Lynn, If I understand your idea correctly, I don't think that this would work well for, say, USB ports since these can be easily added/removed by the end user. Jim lynn at swcp.com wrote: > *IF* the name of the port is supplied, we might want to use the preferences > mechanism (java.util.prefs) where we could have previously saved the info for > the port. We could do a quick check to see that things have not changed > before using it. If things have changed (or never been defined) we would do a > full port scan and save detected ports in the preferences. > > This way if the hardware is not changed, you only pay the time penalty one time. > > just an idea... > Lynn > > > Doug Thistlethwaite said: > >> This is a multi-part message in MIME format. >> --------------070808020900080005070500 >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >> Content-Transfer-Encoding: 7bit >> >> Hello all, >> >> I also notice this pause (not as long however) when I call: >> >> CommPortIdentifier.getPortIdentifier(PortName); >> >> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process. If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it. >> >> Thanks, >> >> Doug >> >> Doug Thistlethwaite wrote: >> >>> Trent, YiQi, and Jim: >>> >>> Thanks to all for the replies and information! I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :) >>> >>> As for more information. First off, this example is being run under >>> windows XP. I am developing test equipment that communicates with a >>> java application via a serial port. I have been using the commapi for >>> several years and have not had a problem. Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port. I am using the ftdi module for prototyping and I discovered >>> that their virtual com port driver was not compatible with the commapi >>> that Sun released. It turns out that it has problems with hardware >>> flow control ( it works on incoming but not outgoing communications). >>> The way I figured this out was by experimenting with the SerialDemo >>> that was included with the Sum commapi. One nice thing about this >>> example is it has the ability to set incoming and outgoing flow >>> control independently. >>> >>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup). >>> >>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are: >>> >>> testRead() : -1, gnu.io.RXTXCommDriver >>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>> >>> This was all initiated by the following call in the programs init routine: >>> >>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>> >>> After looking at this, My guess is that Trent is correct in that the >>> delay is in scanning for ports. I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system. Is there any way to reduce the number of ports scanned by >>> this function in windows XP? >>> >>> Thanks again for your time, >>> >>> Doug >>> >> --------------070808020900080005070500 >> Content-Type: text/html; charset=ISO-8859-1 >> Content-Transfer-Encoding: 7bit >> >> >> >> >> >> >> >> >> Hello all,
>>
>> I also notice this pause (not as long however) when I call:
>>
>>         >  CommPortIdentifier.getPortIdentifier(PortName);
>>
>> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process.  If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it.
>>
>> Thanks,
>>
>> Doug
>>
>> Doug Thistlethwaite wrote: >>
>> >> Trent, YiQi, and Jim:
>>
>> Thanks to all for the replies and information!  I am just back from a >> long weekend and I am now trying to figure out what I was doing! :)
>>
>> As for more information.  First off, this example is being run under >> windows XP.  I am developing test equipment that communicates with a >> java application via a serial port.  I have been using the commapi for >> several years and have not had a problem.  Recently, I have started a >> design modification that will replace the RS232 connection with a USB >> port.  I am using the ftdi module for prototyping and I discovered that >> their virtual com port driver was not compatible with the commapi that >> Sun released.  It turns out that it has problems with hardware flow >> control ( it works on incoming but not outgoing communications).  The >> way I figured this out was by experimenting with the SerialDemo that >> was included with the Sum commapi.  One nice thing about this example >> is it has the ability to set incoming and outgoing flow control >> independently.
>>
>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >> all instances of javax.comm with gnu.io and it compiled and runs >> without a hitch (except for the slow startup).
>>
>> I Paused the JBuilder IDE during this long pause and the last few >> entries in the stack trace are:
>>
>> testRead() : -1, gnu.io.RXTXCommDriver
>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>
>> This was all initiated by the following call in the programs init >> routine:
>>
>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>
>> After looking at this,  My guess is that Trent is correct in that the >> delay is in scanning for ports.  I guess one solution would be to not >> scan for ports, though it would be nice to detect what is available on >> the system.  Is there any way to reduce the number of ports scanned by >> this function in windows XP? 
>>
>> Thanks again for your time,
>>
>> Doug
>>
>>
>> >> >> >> --------------070808020900080005070500-- >> > > > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From yhua537 at cse.unsw.edu.au Tue May 30 18:10:23 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 31 May 2006 10:10:23 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CBC4B.2080206@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: Doug, In the SerialDemo, it allow us to save the parameters into a file, and use it when your program start up. Would this help? YiQi On Tue, 30 May 2006, Jim Redman wrote: > Lynn, > > If I understand your idea correctly, I don't think that this would work > well for, say, USB ports since these can be easily added/removed by the > end user. > > Jim > > lynn at swcp.com wrote: >> *IF* the name of the port is supplied, we might want to use the preferences >> mechanism (java.util.prefs) where we could have previously saved the info for >> the port. We could do a quick check to see that things have not changed >> before using it. If things have changed (or never been defined) we would do a >> full port scan and save detected ports in the preferences. >> >> This way if the hardware is not changed, you only pay the time penalty one time. >> >> just an idea... >> Lynn >> >> >> Doug Thistlethwaite said: >> >>> This is a multi-part message in MIME format. >>> --------------070808020900080005070500 >>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>> Content-Transfer-Encoding: 7bit >>> >>> Hello all, >>> >>> I also notice this pause (not as long however) when I call: >>> >>> CommPortIdentifier.getPortIdentifier(PortName); >>> >>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process. If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it. >>> >>> Thanks, >>> >>> Doug >>> >>> Doug Thistlethwaite wrote: >>> >>>> Trent, YiQi, and Jim: >>>> >>>> Thanks to all for the replies and information! I am just back from a >>>> long weekend and I am now trying to figure out what I was doing! :) >>>> >>>> As for more information. First off, this example is being run under >>>> windows XP. I am developing test equipment that communicates with a >>>> java application via a serial port. I have been using the commapi for >>>> several years and have not had a problem. Recently, I have started a >>>> design modification that will replace the RS232 connection with a USB >>>> port. I am using the ftdi module for prototyping and I discovered >>>> that their virtual com port driver was not compatible with the commapi >>>> that Sun released. It turns out that it has problems with hardware >>>> flow control ( it works on incoming but not outgoing communications). >>>> The way I figured this out was by experimenting with the SerialDemo >>>> that was included with the Sum commapi. One nice thing about this >>>> example is it has the ability to set incoming and outgoing flow >>>> control independently. >>>> >>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>> all instances of javax.comm with gnu.io and it compiled and runs >>>> without a hitch (except for the slow startup). >>>> >>>> I Paused the JBuilder IDE during this long pause and the last few >>>> entries in the stack trace are: >>>> >>>> testRead() : -1, gnu.io.RXTXCommDriver >>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>> >>>> This was all initiated by the following call in the programs init routine: >>>> >>>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>> >>>> After looking at this, My guess is that Trent is correct in that the >>>> delay is in scanning for ports. I guess one solution would be to not >>>> scan for ports, though it would be nice to detect what is available on >>>> the system. Is there any way to reduce the number of ports scanned by >>>> this function in windows XP? >>>> >>>> Thanks again for your time, >>>> >>>> Doug >>>> >>> --------------070808020900080005070500 >>> Content-Type: text/html; charset=ISO-8859-1 >>> Content-Transfer-Encoding: 7bit >>> >>> >>> >>> >>> >>> >>> >>> >>> Hello all,
>>>
>>> I also notice this pause (not as long however) when I call:
>>>
>>>         >>  CommPortIdentifier.getPortIdentifier(PortName);
>>>
>>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process.  If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it.
>>>
>>> Thanks,
>>>
>>> Doug
>>>
>>> Doug Thistlethwaite wrote: >>>
>>> >>> Trent, YiQi, and Jim:
>>>
>>> Thanks to all for the replies and information!  I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :)
>>>
>>> As for more information.  First off, this example is being run under >>> windows XP.  I am developing test equipment that communicates with a >>> java application via a serial port.  I have been using the commapi for >>> several years and have not had a problem.  Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port.  I am using the ftdi module for prototyping and I discovered that >>> their virtual com port driver was not compatible with the commapi that >>> Sun released.  It turns out that it has problems with hardware flow >>> control ( it works on incoming but not outgoing communications).  The >>> way I figured this out was by experimenting with the SerialDemo that >>> was included with the Sum commapi.  One nice thing about this example >>> is it has the ability to set incoming and outgoing flow control >>> independently.
>>>
>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup).
>>>
>>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are:
>>>
>>> testRead() : -1, gnu.io.RXTXCommDriver
>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>
>>> This was all initiated by the following call in the programs init >>> routine:
>>>
>>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>
>>> After looking at this,  My guess is that Trent is correct in that the >>> delay is in scanning for ports.  I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system.  Is there any way to reduce the number of ports scanned by >>> this function in windows XP? 
>>>
>>> Thanks again for your time,
>>>
>>> Doug
>>>
>>>
>>> >>> >>> >>> --------------070808020900080005070500-- >>> >> >> >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From halbleib at rechnerbetriebsgruppe.de Wed May 31 02:06:16 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 10:06:16 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp Message-ID: <447D4E78.30302@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, I getting an error while reloading my app in tomcat. At the first start everything runs well, but if i reload mit webapp by tomcat manager i get the following error. java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader Is there a possibility to unload the native library rxtxSerial.dll? thx for all help! regards tom -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 b8FT80HQ1xlbDLnRecDANCc= =heb1 -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 02:52:17 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 10:52:17 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D4E78.30302@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> Message-ID: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Hello Tom, To the best of my knowledge it is impossible to unload native libraries once loaded into the JVM. The exception you see stems from the fact, that Tomcat creates a new classloader when you "reload" the weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar is loaded from the session class loader. Try to add RXTXComm.jar to your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. Regards, Joachim On 31.05.2006, at 10:06, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 > b8FT80HQ1xlbDLnRecDANCc= > =heb1 > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From halbleib at rechnerbetriebsgruppe.de Wed May 31 03:28:35 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 11:28:35 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Message-ID: <447D61C3.1030807@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Joachim, I'm still not getting it. How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml-file? Perhaps web.xml? Regards, Tom Joachim Buechse schrieb: > Hello Tom, > > To the best of my knowledge it is impossible to unload native > libraries once loaded into the JVM. The exception you see stems from > the fact, that Tomcat creates a new classloader when you "reload" the > weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar > is loaded from the session class loader. Try to add RXTXComm.jar to > your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. > > Regards, > Joachim > > On 31.05.2006, at 10:06, Tom Halbleib wrote: > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL tzNy+/0iIUfkYYgt1+UT1ko= =pkpY -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 04:03:42 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 12:03:42 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D61C3.1030807@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> <447D61C3.1030807@rechnerbetriebsgruppe.de> Message-ID: -Xbootclasspath/a: is a start option to the java vm. Google is your friend in finding how to modfiy it and what it means: tomcat modifying bootclasspath Regards, Joachim On 31.05.2006, at 11:28, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Joachim, > > I'm still not getting it. > How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml- > file? > Perhaps web.xml? > > Regards, > Tom > > Joachim Buechse schrieb: >> Hello Tom, >> >> To the best of my knowledge it is impossible to unload native >> libraries once loaded into the JVM. The exception you see stems from >> the fact, that Tomcat creates a new classloader when you "reload" the >> weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar >> is loaded from the session class loader. Try to add RXTXComm.jar to >> your bootlclasspath (-Xbootclasspath/a:) and the problem should go >> away. >> >> Regards, >> Joachim >> >> On 31.05.2006, at 10:06, Tom Halbleib wrote: >> >> Hi all, >> >> I getting an error while reloading my app in tomcat. At the first >> start >> everything runs well, but if i reload mit webapp by tomcat manager >> i get >> the following error. >> >> java.lang.UnsatisfiedLinkError: Native Library >> C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in >> another classloader thrown while loading gnu.io.RXTXCommDriver >> Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: >> Native >> Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already >> loaded >> in another classloader >> >> >> Is there a possibility to unload the native library rxtxSerial.dll? >> >> thx for all help! >> >> regards >> >> tom > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL > tzNy+/0iIUfkYYgt1+UT1ko= > =pkpY > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From impakt01 at optusnet.com.au Wed May 31 06:55:42 2006 From: impakt01 at optusnet.com.au (Daren) Date: Wed, 31 May 2006 22:55:42 +1000 Subject: [Rxtx] (no subject) Message-ID: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/ade7ad37/attachment-0003.html From doug at dupreeinc.com Wed May 31 10:19:19 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 31 May 2006 09:19:19 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: <447DC207.3070702@dupreeinc.com> I am not sure what you are saying. The Save parameters menu option saves the current settings (baud, data bits, etc.). The long pause (~60 seconds) is when the application first starts (before loading the saved parameters). This does bring up a question, though I hate this type of kludge approach to getting this library to work... What exactly is a PortIdentifier? Is it always the same? If I stored the results from "CommPortIdentifier.getPortIdentifier(PortName);" in a file, could I use this the next time the program is executed? In this case I am using a virtual com port driver to connect to the device through a USB port. Doug YiQi Huang wrote: >Doug, > >In the SerialDemo, it allow us to save the parameters into a file, and use >it when your program start up. Would this help? > >YiQi > >On Tue, 30 May 2006, Jim Redman wrote: > > > >>Lynn, >> >>If I understand your idea correctly, I don't think that this would work >>well for, say, USB ports since these can be easily added/removed by the >>end user. >> >>Jim >> >>lynn at swcp.com wrote: >> >> >>>*IF* the name of the port is supplied, we might want to use the preferences >>>mechanism (java.util.prefs) where we could have previously saved the info for >>>the port. We could do a quick check to see that things have not changed >>>before using it. If things have changed (or never been defined) we would do a >>>full port scan and save detected ports in the preferences. >>> >>>This way if the hardware is not changed, you only pay the time penalty one time. >>> >>>just an idea... >>>Lynn >>> >>> >>>Doug Thistlethwaite said: >>> >>> >>> >>>>This is a multi-part message in MIME format. >>>>--------------070808020900080005070500 >>>>Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>>>Content-Transfer-Encoding: 7bit >>>> >>>>Hello all, >>>> >>>>I also notice this pause (not as long however) when I call: >>>> >>>> CommPortIdentifier.getPortIdentifier(PortName); >>>> >>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process. If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it. >>>> >>>>Thanks, >>>> >>>>Doug >>>> >>>>Doug Thistlethwaite wrote: >>>> >>>> >>>> >>>>>Trent, YiQi, and Jim: >>>>> >>>>>Thanks to all for the replies and information! I am just back from a >>>>>long weekend and I am now trying to figure out what I was doing! :) >>>>> >>>>>As for more information. First off, this example is being run under >>>>>windows XP. I am developing test equipment that communicates with a >>>>>java application via a serial port. I have been using the commapi for >>>>>several years and have not had a problem. Recently, I have started a >>>>>design modification that will replace the RS232 connection with a USB >>>>>port. I am using the ftdi module for prototyping and I discovered >>>>>that their virtual com port driver was not compatible with the commapi >>>>>that Sun released. It turns out that it has problems with hardware >>>>>flow control ( it works on incoming but not outgoing communications). >>>>>The way I figured this out was by experimenting with the SerialDemo >>>>>that was included with the Sum commapi. One nice thing about this >>>>>example is it has the ability to set incoming and outgoing flow >>>>>control independently. >>>>> >>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>>without a hitch (except for the slow startup). >>>>> >>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>>entries in the stack trace are: >>>>> >>>>>testRead() : -1, gnu.io.RXTXCommDriver >>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>>> >>>>>This was all initiated by the following call in the programs init routine: >>>>> >>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>>> >>>>>After looking at this, My guess is that Trent is correct in that the >>>>>delay is in scanning for ports. I guess one solution would be to not >>>>>scan for ports, though it would be nice to detect what is available on >>>>>the system. Is there any way to reduce the number of ports scanned by >>>>>this function in windows XP? >>>>> >>>>>Thanks again for your time, >>>>> >>>>>Doug >>>>> >>>>> >>>>> >>>>--------------070808020900080005070500 >>>>Content-Type: text/html; charset=ISO-8859-1 >>>>Content-Transfer-Encoding: 7bit >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>>Hello all,
>>>>
>>>>I also notice this pause (not as long however) when I call:
>>>>
>>>>        >>>> >>>> >>> CommPortIdentifier.getPortIdentifier(PortName);
>>> >>> >>>>
>>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process.  If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it.
>>>>
>>>>Thanks,
>>>>
>>>>Doug
>>>>
>>>>Doug Thistlethwaite wrote: >>>>
>>>> >>>>Trent, YiQi, and Jim:
>>>>
>>>>Thanks to all for the replies and information!  I am just back from a >>>>long weekend and I am now trying to figure out what I was doing! :)
>>>>
>>>>As for more information.  First off, this example is being run under >>>>windows XP.  I am developing test equipment that communicates with a >>>>java application via a serial port.  I have been using the commapi for >>>>several years and have not had a problem.  Recently, I have started a >>>>design modification that will replace the RS232 connection with a USB >>>>port.  I am using the ftdi module for prototyping and I discovered that >>>>their virtual com port driver was not compatible with the commapi that >>>>Sun released.  It turns out that it has problems with hardware flow >>>>control ( it works on incoming but not outgoing communications).  The >>>>way I figured this out was by experimenting with the SerialDemo that >>>>was included with the Sum commapi.  One nice thing about this example >>>>is it has the ability to set incoming and outgoing flow control >>>>independently.
>>>>
>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>without a hitch (except for the slow startup).
>>>>
>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>entries in the stack trace are:
>>>>
>>>>testRead() : -1, gnu.io.RXTXCommDriver
>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>>
>>>>This was all initiated by the following call in the programs init >>>>routine:
>>>>
>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>>
>>>>After looking at this,  My guess is that Trent is correct in that the >>>>delay is in scanning for ports.  I guess one solution would be to not >>>>scan for ports, though it would be nice to detect what is available on >>>>the system.  Is there any way to reduce the number of ports scanned by >>>>this function in windows XP? 
>>>>
>>>>Thanks again for your time,
>>>>
>>>>Doug
>>>>
>>>>
>>>> >>>> >>>> >>>>--------------070808020900080005070500-- >>>> >>>> >>>> >>> >>> >>> >>-- >>Jim Redman >>(505) 662 5156 x85 >>http://www.ergotech.com >>_______________________________________________ >>Rxtx mailing list >>Rxtx at qbang.org >>http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > >cheers >YiQi Huang >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/61d4d4c9/attachment-0003.html From impakt01 at optusnet.com.au Wed May 31 17:02:54 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 09:02:54 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Message-ID: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Hi all, I downloaded 2.1.7-pre16 and managed to build it and get it going. I made the changes as suggested by Peter Smith in an old post, by adding his code to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. Still not working, it opens the port at 9600 according to portmon.exe . Has anyone managed to get this going at a custom rate? Here is the post I'm referring to: http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 Thanks, Daren ________________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Daren Sent: Wednesday, 31 May 2006 10:56 PM To: rxtx at qbang.org Subject: [Rxtx] (no subject) Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren From tjarvi at qbang.org Wed May 31 21:44:01 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 May 2006 21:44:01 -0600 (MDT) Subject: [Rxtx] custom baud rate win32 In-Reply-To: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> References: <200605312302.k4VN2rHQ024136@mail28.syd.optusnet.com.au> Message-ID: On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org From impakt01 at optusnet.com.au Wed May 31 22:06:04 2006 From: impakt01 at optusnet.com.au (Daren) Date: Thu, 1 Jun 2006 14:06:04 +1000 Subject: [Rxtx] custom baud rate win32 In-Reply-To: Message-ID: <200606010406.k51464X2010447@mail03.syd.optusnet.com.au> Trent, I have managed to successfully open the port at this speed using Realterm (available on sourceforge). From memory this uses DLPortIO. Using portmon.exe with realterm, even there it says that the port has opened at 1953. I changed termios.c:560 to dcb->BaudRate = 1953 ; and it still opens the port at 9600. Daren -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Thursday, 1 June 2006 1:44 PM To: RXTX Developers and Users Subject: Re: [Rxtx] custom baud rate win32 On Thu, 1 Jun 2006, Daren wrote: > Hi all, > > I downloaded 2.1.7-pre16 and managed to build it and get it going. I made > the changes as suggested by Peter Smith in an old post, by adding his code > to SerialImpl.c, uncommenting the TIOCGSERIAL and TIOCSSERIAL, and defining > ASYNC_SPD_CUST which is equal to 0x0030 (according to linus header files).. > > > Still not working, it opens the port at 9600 according to portmon.exe . Has > anyone managed to get this going at a custom rate? > > Here is the post I'm referring to: > http://marc.theaimsgroup.com/?l=rxtx&m=106270038110713&w=2 > > > Thanks, > Daren > > ________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Daren > Sent: Wednesday, 31 May 2006 10:56 PM > To: rxtx at qbang.org > Subject: [Rxtx] (no subject) > > Hi All, > I have been using rxtx for a little while and needed to get it working at > 1953, like a past user in the mailing list, who seemed to have got it > working by changing some C code. > > I wanted to build rxtx myself with these changes but don't know where to > start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, > each build works by building a rxtxSerial.dll file that is ~11k smaller than > the original, and I always get the following error when testing the dll: > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x8077655 > Function=[Unknown.] > Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll > > NOTE: We are unable to locate the function name symbol for the error > just occurred. Please refer to release documentation for possible > reason and solutions. > > > Current Java thread: > at gnu.io.RXTXPort.open(Native Method) > - locked <0x1002c800> (a gnu.io.RXTXPort) > at gnu.io.RXTXPort.(RXTXPort.java:84) > > Anyone know what im doing wrong? > > > > Hi Daren You are running into the same rats nest I'm looking at now. With win32 and specific custom baud rates, I'm not sure how this will go. I've got the Linux custom baud rates working very nicely. I did much like the post you linked. In fact I had forgot about that post. You probably noticed that it becomes a bunch of dirt roads going noplace fast in termios.c for w32. I'm probably only going to get 14400, 28800, 128000 and 256000 working with the next release on w32. I'll look a little further. If you have an example w32 that works at 1953 I'd really like to hear. Thats an unusual baud rate. Assuming a baud_base of 128000, your divisor will be 65 or 66. 128000/66=1939 -14 128000/65=1969 +13 One thing I've been wondering about with linux is which would be the right answer in cases like this. Right now it would just go with a baud base of 65 and ignore the modulus details. It appears to be a general trend for kernel developers to hide these details thinking that they can come up with a general solution. Then they run out of time. Perahps the solution is to help out but there are ultiple OS's rxtx supports making that nontrivial. If you look at current linux kernels, the 'tricks' above have been marked deprecated with no replacement. Windows has some hard defines and then ancient near magic. I've not looked at Solaris via Open Solaris yet but doubt there is a solution at all. What I'd try since you have the equipment and the monitor software is to hardcode the dcb->Baud in termios.c to 1953 (no define) and see what the w32 kernel does with it. I think if you toss a baud rate at the driver it will try to come close. You may try comming closer to a real baudrate based upon the 128000 baud base as shown above. If it works, it is worth looking at the rest of the ping/pong logic then. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From smontgomery at mediaspansoftware.com Mon May 1 09:52:28 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 11:52:28 -0400 Subject: [Rxtx] RXTX, Java COMM and Windows Server 2003 on x64 experiences? Message-ID: Just wondering if anybody here has had to deploy RXTX or the javax.comm on Windows Server 2003 machines running on x64 (i.e. Xeon EM64T) and would like to relate how things went. From Sun's site, the Supported System Configurations pages give the options for that system: Java 5.0: - 32-bit Java 5.0 running on the OS in the 32-bit mode - 64-bit Java 5.0 running on the OS in the 64-bit native mode Java 1.4.2: - no options listed for EM64T processors, but potentially the standard 32-bit Java 1.4.2 could run on the OS in 32-bit mode? I guess the two main points of failure would be 1) the JVM itself and 2) the jni components. Make that three: there's gotta be hardware vendor driver support for the OS in the various modes, too. Guess I better go look at Keyspan's website... Thanks in advance for any info anyone might be able to provide. From smontgomery at mediaspansoftware.com Mon May 1 10:18:33 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Mon, 1 May 2006 12:18:33 -0400 Subject: [Rxtx] Mailing list archive out of date? Message-ID: The mailing list archive at: http://mailman.qbang.org/pipermail/rxtx/ only shows emails through the end of March. Is there a new archive somewhere else? Didn't see anything mentioned on the wiki. From p.cain at phasefale.com.au Mon May 1 22:33:09 2006 From: p.cain at phasefale.com.au (Peter Cain) Date: Tue, 02 May 2006 14:33:09 +1000 Subject: [Rxtx] RXTX and the Linux kernel. Message-ID: <4456E105.5080106@phasefale.com.au> Hi, First off the problem I am having isn't caused by RXTX itself but I'm hoping someone out there may have some knowledge that may help me. Background: I have an application monitoring a control system through a standard PC serial port which I talk to with rxtx-2.0.5. The application runs on RedHat7.3 kernel version 2.4.18 using Java 1.4. This configuration has been in use for several years and has proved to be stable. But it has become necessary for me to upgrade the OS but I'm running into problems with the serial communications. Its not that the comms don't work on the new OS (its never that simple) the comms work for a variable period of time (sometimes several hours) and then just stop, nothing on the data lines and control lines all indicate that data could flow. The new OS is Ubuntu 5.10 running kernel version 2.6.12. I have installed the OS and software on a PC and had it perform ok, then install the new OS and same software on the very same hardware and experienced the problems of them comms stopping. In the new OS I'm using Java5 to run the app but since I have experience the problem I reverted back to Java1.4 which didn't fix the problem. I've moved the app to a different system RedHat FC3 running 2.6.14 had experienced the problem. Not wanting to go through all the thing I have tried but I have established that it seems to be the 2.6 versions of the kernel that seem to be the problem and not an individual distribution of Linux. I should point out that I am using the same jar and library files for each java and OS combination. So I'm just wondering if anyone has had or heard of problems similar to these ? Or perhaps might know of what changed in the Linux serial driver (something I'm having a hard time establishing). I'm starting to run low on ideas of what to try so any help would be much appreciated. -- Peter Cain Senior Programmer Phasefale Pty Ltd From tjarvi at qbang.org Wed May 3 07:31:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 May 2006 07:31:00 -0600 (MDT) Subject: [Rxtx] Re: Concering ircomm and RXTX In-Reply-To: References: Message-ID: On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From legolas.w at gmail.com Wed May 3 08:46:23 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 19:16:23 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <4458C23F.2000003@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From legolas.w at gmail.com Wed May 3 13:10:57 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Wed, 03 May 2006 23:40:57 +0430 Subject: [Rxtx] does any one used RXTX in widows with parallel port? Message-ID: <44590041.80706@gmail.com> Hi Thank you for reading my post I want to know does any one used RXTX for windows and parallel port? does it support interrupt ? Thanks From Lars.Hennig at wow-portal.com Thu May 4 00:39:15 2006 From: Lars.Hennig at wow-portal.com (Lars.Hennig@wow-portal.com) Date: Thu, 4 May 2006 08:39:15 +0200 Subject: [Rxtx] USB Serialport - disconnection problems In-Reply-To: Message-ID: Hi, I could not find any solution. I therefore decided to to my own native implementation. Allthough it only supports the functions I need, it works pretty well now for me. I think the main problem there is the use of a wrong Windows API function and not setting an timeout. Regards, Lars Hennig W?rth Online World GmbH Tel. (0049)7181-258183 Mob. (0049)160-3522889 Fax. (0049)7940-153299 Lars.Hennig at wow-portal.com Gesendet von: rxtx-bounces at qbang.org 09.04.2006 10:42 Bitte antworten zu RXTX Developers and Users An d.herwald at dsh-elektronik.de, RXTX Developers and Users Kopie Thema Re: [Rxtx] USB Serialport - disconnection problems WV Proj./Teilpr.: Hi, I am experiencing the same problem. It is getting even worst if you us Win2000. There the method nativeavailable() is not returning from its call. The whole application blocks in this case waiting for an answer. Any ideas what can be done to avoid this behavior? Thanks, Lars > Hi Dominik > > This is going to be a problem for more and more people. I was just > getting into a new position and looking at some serial bugs. It was > about day three I realized the computer didnt even have a UART :) > > These USB serial dongles are going to be more and more common. At > least some appear to work very well. > > Right now, all you can do is say "Don't unplug the dongle." Thats not > very clean. We could perhaps through an exception when the w32 error > is shown. The real solution is probably to start listening for USB > events. Thats not a small task to determine if the port is actually > USB off the top of my head. > > I wonder if there is ever a time when you would recieve permission > denied that was not the result of the 'virtual' hardware going away. > You should not be able to open the port otherwise. > > The 'no error' message is lazy programming on my part. w32 should set > the errorno but did not in that case. The 'YACK()' is printing into > your logs the actual w32 API error which needs to be translated into > POSIX error codes. The default is 0 which is 'no error.' > > So there are a few questions. > > Where is the native code slipping out of the normal paths upon this > error? This is a bug regardless of USB/UART. > > Is the 'permission denied' message enough to know what happened at all > times? What will happen on Unix/Linux/Mac OS X? > > Would it be posible to listen to USB events while still using the > virtual device. or.. can you connect the dots? > > The errorno and incorrect code paths I can look at sooner rather than > later. The other issues will take more thought and testing. > Hi Trent, You are right, the standard serial ports are about to be thrown away by the industry. Actually I integrate usb to serial interfaces into all my new projects because of this. (mainly based on FTDI devices, they are quite small, require few external components and fit nice on my boards) Nearly all new Notebooks and more and more Desktop PCs don't have serial and parallel ports anymore so IMHO full support for USB dongles will be required for RXTX Project in the future. RXTX works very nice with my USB interfaces - 500kBaud is no problem. (I did not test it, but it should work at up to 3MBaud) The only problem I have is this disconnection Bug... > We could perhaps through an exception when the w32 error is shown Maybe you could just do a small work around if it is possible: Well, if I restart the application everything works again... So I get the idea of maybe reload/restart the library when you get such an error? uhhm - let's better call this "reinitialize" the library to its initial state. ==> When you get such an error, just reinitialize the library (if this is possible in any way), throw an exception and allow the Java application to savely close the port and reinitialize the RXTX port stuff if required. (?) > Is the 'permission denied' message enough to know what happened at all times? > What will happen on Unix/Linux/Mac OS X? Good question. Maybe I can try it on my linux box this weekend and see what happens. But I don't have a Mac ;) For USB you could maybe have a look at http://javax-usb.org/ or http://libusb.sourceforge.net/ http://libusb-win32.sourceforge.net/ I just wanted to let you know about these libs if you don't already know them. Maybe this is too complex. > "Don't unplug the dongle." My application is already showing an error dialog, which tells the user about this problem and terminates the application... Not nice, but until you found the time to fix it - I can live with it. > The default is 0 which is 'no error.' Hehe yes - this reads a bit strange "no error in read byte" ;) At least this should be changed some day. > So there are a few questions. Well, as I told you - I am not much help with x86 C/C++ programming... Once I wrote a JNI shared object for Linux that interfaced the parallel port (simple inb outb functions) out of a Java app running on my Robots' embedded PC - that was nearly all I ever did with C on the x86 platform ;) Best regards, Dominik S. Herwald http://www.dsh-elektronik.de/ _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/7b39f374/attachment-0004.html From Pawan.Kharbanda at dot.state.co.us Thu May 4 11:00:58 2006 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Thu, 4 May 2006 11:00:58 -0600 Subject: [Rxtx] Dangling Lock Files Message-ID: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Hi, I have been using RXTX API's for the Serial Communication for quite some time now and for some of the devices we are opening and closing the connection every 2 minutes. This works great for few days and then suddenly I start seeing some "Port in Use Exception" and I see that the Lock files are still in the /var/lock folder after manually removing the lock files it works good for few hours and I see the same problem again. Can somebody explain me the scenarios why I am seeing the dangling Lock files? I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise Servers. Thanks Pawan Kharbanda -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060504/ba0e9261/attachment-0004.html From tjarvi at qbang.org Thu May 4 14:10:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:10:30 -0600 (MDT) Subject: [Rxtx] Dangling Lock Files In-Reply-To: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> References: <939A619A756047469C41EE9BA51890FB0385E01B@hqexchange3.dot.state.co.us> Message-ID: On Thu, 4 May 2006, Kharbanda, Pawan wrote: > Hi, > I have been using RXTX API's for the Serial Communication for quite > some time now and for some of the devices we are opening and closing the > connection every 2 minutes. This works great for few days and then > suddenly I start seeing some "Port in Use Exception" and I see that the > Lock files are still in the /var/lock folder after manually removing the > lock files it works good for few hours and I see the same problem again. > Can somebody explain me the scenarios why I am seeing the dangling Lock > files? > > I am using RXTX 2.1.7 version with JDK 1.5 on Red Hat Enterprise > Servers. Hi Pawan The next time it happens, look in the lockfile. There will be a pid. ps aux |grep 'pid' I think you will see that the application is still running for some reason. RXTX does a kill -0 on the pid to see if its alive. If not, it will remove the lockfile. So I suspect the previous program did not exit as you expected. -- Trent Jarvi tjarvi at qbang.org From Scott.Hughes at dalsemi.com Thu May 4 14:23:11 2006 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 4 May 2006 15:23:11 -0500 Subject: [Rxtx] Wiki instructions... Message-ID: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire demo apps, when I stumbled across this tip on the wiki to add yourself to the uucp group: It may be simpler to just run usermod -G uucp jarvi Taken from: http://rxtx.qbang.org/wiki/index.php/Installation This does not work as advertised. I should have read the man page for usermod before I tried that out. If there are any groups which are not listed after the -G switch, the user is removed from those groups. On Ubuntu, this is bad... I removed myself from the Admin group, which removed my sudo priviledges. Ubuntu has no root account, so I've disabled the only account which could fix it. Anyone know of a good workaround? Scott -- Scott Hughes - Engineer Shughes aht dalsemi daut com Maxim/Dallas Semiconductor From tjarvi at qbang.org Thu May 4 14:32:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 14:32:09 -0600 (MDT) Subject: [Rxtx] Wiki instructions... In-Reply-To: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF2194317BFA57@misnts1.dalsemi.com> Message-ID: On Thu, 4 May 2006, Scott Hughes wrote: > I was experimenting with Ubuntu, trying to get RXTX working with the 1-Wire > demo apps, when I stumbled across this tip on the wiki to add yourself to > the uucp group: > > It may be simpler to just run > > usermod -G uucp jarvi > > Taken from: > http://rxtx.qbang.org/wiki/index.php/Installation > > This does not work as advertised. I should have read the man page for > usermod before I tried that out. If there are any groups which are not > listed after the -G switch, the user is removed from those groups. On > Ubuntu, this is bad... I removed myself from the Admin group, which removed > my sudo priviledges. Ubuntu has no root account, so I've disabled the only > account which could fix it. > > Anyone know of a good workaround? > Yikes This will get your permissions back: in grub/lilo/.. pass the following option to the kernel init=/bin/sh You are now root. when it boots, mount -o remount,rw / add yourself to the groups, reboot to get normal init going. Thats about all I can think of without sudo/root. -- Trent Jarvi tjarvi at qbang.org From Gettings at earth.utah.edu Thu May 4 14:41:22 2006 From: Gettings at earth.utah.edu (Paul Gettings) Date: Thu, 4 May 2006 14:41:22 -0600 Subject: [Rxtx] RXTX causing stdout messages Message-ID: <20060504204122.GA6534@earth.utah.edu> When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get messages on stdout from the JVM: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 As the only change was the version of RXTX (from 2.1.6), I am unsure why the messages suddenly appeared. Anyone know how to get rid of them? Thanks. -- 101 USES FOR A DEAD MICROPROCESSOR (23) Dead cat brush From mmester at sps.edu Mon May 1 21:22:28 2006 From: mmester at sps.edu (Michael Mester) Date: Mon, 1 May 2006 23:22:28 -0400 Subject: [Rxtx] Windows PortInUseException Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> I'm trying to get simple serial communication going with RxTx under Windows XP. I can enumerate the ports fine, but I always run into problems when I try to open one. I get a PortInUseException, but the owner application is "Unknown" and the port is never open. I've tried this on several different systems and all of them give the same behavior. The only thing I can thiunk of that might be causing the problem is that fact that I had to put the serial .dll file in system32 instead of the reccommended folder, because it didn't work in the folder the documentation gives. The library loads fine, though, so I'm not sure whether that makes sense, and I don't know how to fix it anyway. Any help is greatly appreciated. Below is the output of the program, right up to the PortInUseException and the NullPointerException it causes (because the serial port object is not instantiated). C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI Starting GPSTalkerGUI... Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 gnu.io.PortInUseException: Unknown Application Exception in thread "main" java.lang.NullPointerException at GPSTalkerGUI.(GPSTalkerGUI.java:102) at GPSTalkerGUI.main(GPSTalkerGUI.java:161) Again, thank you very much for any help you can give. From lshellman at qwest.net Wed May 3 01:38:34 2006 From: lshellman at qwest.net (Lucious Shellman) Date: Wed, 03 May 2006 01:38:34 -0600 Subject: [Rxtx] Help needed: Project using parallel port Message-ID: <1146641914.8337.14.camel@localhost.localdomain> I was looking for a way to access the parallel port on a PC using Java. Searching the Internet, I came across this site (rxtx.org). What I am trying to do is detect logic levels from a TTL logic IC on the parallel port. I am not trying to do classic parallel port communication. I just want to detect whether a line(s) is (are) high or low. I am using Windows 98. Can rxtx be used to do this? If yes, is there a tutorial for using rxtx posted on the Internet that someone can direct me to. If you need more information, feel free to e-mail me. Unfortunately for me, I need the information ASAP. Thanks. lshellman at qwest.net From webmaster at egyhelp.com Wed May 3 18:43:39 2006 From: webmaster at egyhelp.com (Mohamed Samy) Date: Thu, 4 May 2006 02:43:39 +0200 Subject: [Rxtx] RE: Concering ircomm and RXTX In-Reply-To: Message-ID: <20060503184362.SM01044@Geek> Hey, I issue the command "modprobe ircomm-tty" yet no ttyircomm appears, while the ircomm appear by "modprobe ircomm" so forgive me but I am bit lost. Even searching google for the keyword "ttyircomm" only returns 3 matches. So any way I can start the ttyircomm???? Thanks a lot. -----Original Message----- From: Trent Jarvi [mailto:tjarvi at qbang.org] Sent: Wednesday, May 03, 2006 3:31 PM To: Mohamed Samy; rxtx at qbang.org Cc: taj at www.linux.org.uk Subject: Re: Concering ircomm and RXTX On Wed, 3 May 2006, Mohamed Samy wrote: > > Hello Mr. Jarvi. > I am using the RXTX API so as to make a JAVA based application that > sends/receives SMS msgs from a Nokia 6100 device attatched to my laptop > through USB IrDA. > I used the irattatch applicaiton to bind the ttyUSB0 (which has the USB > IrDA) to ircomm0 (the serial IrDA interface on Linux) > I am using Mandriva 2006 Kernel 2.6.12 > I tried editinig the source of RXTXCommDriver.class and added the ircomm > to the /dev enumeration (this was mentioned on the wiki) > Anyway, after what i did, it still only detects the /dev/ttyS0 and > NOTHING ELSE, even the ttyUSB0 sometimes get detected, others not, but > never detect the ircomm0 nor the modem(i did it as a trial). > So can you please guide me how to detect the ircomm interface under > Linux so i can send/receive? > Kindly find my source code afterwords. > Thanks for your attention. > > Mohamed Samy. Hi Mohamed I think you want to use ttyircomm not ircomm. This will give you the termios layer in the kernel that rxtx requires. If you have more questions, please ask on the rxtx mail-list. I know people have done things like this before but I have not done it myself. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 4 15:49:49 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 May 2006 15:49:49 -0600 (MDT) Subject: [Rxtx] Windows PortInUseException In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC05F65@PELICAN3.spsnet.sps.edu> Message-ID: On Mon, 1 May 2006, Michael Mester wrote: > > I'm trying to get simple serial communication going with RxTx under > Windows XP. I can enumerate the ports fine, but I always run into > problems when I try to open one. I get a PortInUseException, but the > owner application is "Unknown" and the port is never open. I've tried > this on several different systems and all of them give the same > behavior. The only thing I can thiunk of that might be causing the > problem is that fact that I had to put the serial .dll file in system32 > instead of the reccommended folder, because it didn't work in the folder > the documentation gives. The library loads fine, though, so I'm not sure > whether that makes sense, and I don't know how to fix it anyway. Any > help is greatly appreciated. Below is the output of the program, right > up to the PortInUseException and the NullPointerException it causes > (because the serial port object is not instantiated). > > C:\Documents and Settings\Mike\Desktop>java GPSTalkerGUI > Starting GPSTalkerGUI... > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > gnu.io.PortInUseException: Unknown Application > Exception in thread "main" java.lang.NullPointerException > at GPSTalkerGUI.(GPSTalkerGUI.java:102) > at GPSTalkerGUI.main(GPSTalkerGUI.java:161) > Perhaps you are trying to open the port twice in your code? rxtx does open the ports, do a timed out read and then close the ports during enumeration. I think the port is being opened fine. The Unknown Application is always reported. On linux, there is some code that finds the actual application but on windows, its always unknown. If the port enumeration is returning the ports you expect, rxtx has opened the port and closed it with success. The port should open. There is also example code in the contrib directory that comes with rxtx source that has examples you can modify to work. -- Trent Jarvi tjarvi at qbang.org From Christian.Klemke at t-online.de Thu May 4 23:37:23 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Fri, 5 May 2006 07:37:23 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu> Message-ID: <004f01c67005$fc72fee0$016a10ac@NB600> Hi Paul, I was wondering about the same question some days ago and took a look at the source files. Unfortunately, I found that you can only get rid of that messages by altering and recompiling the Java code. There is a final static boolean variable called "devel" in the file "RXTXCommDriver.java" which is set to "true". This constellation causes the output after the native libraries have been loaded. No mechanism exists to suppress them otherwise :-(. Trent, does that mean that 2.1.7 is still officially a "development" version ? When will this value be changed to "false" by default ? With 2.1.8 ? It would be nice to provide a means to suppress such messages besides that static flag (maybe by setting a property called "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The output can indeed by annoying, especially when used with console applications, where the message potentially appears "in the middle" of your own output. Another possibility would be not to use System.out directly, but instead some PrintStream field which is initially set to System.out but can programatically be changed. That would allow for any kind of redirection or suppression by implementing appropriate user-defined PrintStream subclasses and making RXTX use that stream. What do you think ? Best regards, Christian ----- Original Message ----- From: "Paul Gettings" To: Sent: Thursday, May 04, 2006 10:41 PM Subject: [Rxtx] RXTX causing stdout messages > When I upgraded to RXTX 2.1.7r2 (via Debian packages), I started to get > messages on stdout from the JVM: > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > As the only change was the version of RXTX (from 2.1.6), I am unsure > why the messages suddenly appeared. Anyone know how to get rid of > them? > > Thanks. > > -- > 101 USES FOR A DEAD MICROPROCESSOR > (23) Dead cat brush > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Fri May 5 06:09:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 06:09:46 -0600 (MDT) Subject: [Rxtx] RXTX causing stdout messages In-Reply-To: <004f01c67005$fc72fee0$016a10ac@NB600> References: <20060504204122.GA6534@earth.utah.edu> <004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: On Fri, 5 May 2006, Christian Klemke wrote: > Hi Paul, > > I was wondering about the same question some days ago and took a look at the > source files. Unfortunately, I found that you can only get rid of that > messages by altering and recompiling the Java code. There is a final static > boolean variable called "devel" in the file "RXTXCommDriver.java" which is > set to "true". This constellation causes the output after the native > libraries have been loaded. No mechanism exists to suppress them otherwise > :-(. > > Trent, does that mean that 2.1.7 is still officially a "development" version > ? When will this value be changed to "false" by default ? With 2.1.8 ? It > would be nice to provide a means to suppress such messages besides that > static flag (maybe by setting a property called > "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The > output can indeed by annoying, especially when used with console > applications, where the message potentially appears "in the middle" of your > own output. Another possibility would be not to use System.out directly, but > instead some PrintStream field which is initially set to System.out but can > programatically be changed. That would allow for any kind of redirection or > suppression by implementing appropriate user-defined PrintStream subclasses > and making RXTX use that stream. What do you think ? > A patch for using properties would be accepted I'm sure. The reason the default is to display the message is not related to the development state of rxtx anymore. The problem is that people first using rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. The message prevents a great deal of email thats easily explained by the message. I question if we should support rxtx 2.0 at all anymore. If you post a patch in bugzilla, we'll put it into CVS this weekend. we'll be going through and doing such things anyhow. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Fri May 5 13:23:56 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 May 2006 13:23:56 -0600 (MDT) Subject: [Rxtx] How to read from RxTx parallel port in Win XP In-Reply-To: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> References: <0BC54F4063F4F240A3C30F67E40E380703EF4376@cacexc09.americas.cpqcorp.net> Message-ID: On Thu, 27 Apr 2006, Worsley, Bob (Development Engineer) wrote: > I'm sorry if this is a dumb question, but I didn't find the answer in > the archives. > > I'm using the RxTx binaries for Windows on a reasonably current notebook > PC running Windows XP. I can send stuff to a printer on the parallel > port (LPT1), but I can't get anything back. > > I wrote a class that has the methods listed below. I write some data to > the printer with the "write" method and then try to read a response > using the "read" method, but I never get any data. I'd greatly > appreciate any help you can give! > > Bob Worsley > bobwoyid2 at yahoo.com > > > > > private ParallelPort parallelPort = null; > private RXTXCommDriver parallelPortDriver = null; > > > public boolean initialize() throws IOException { > if (parallelPort != null) { > return false; // Already initialized > } > > // Create the parallel port; > parallelPortDriver = new RXTXCommDriver(); > parallelPort = > (ParallelPort)parallelPortDriver.getCommPort(address, > CommPortIdentifier.PORT_PARALLEL); > > // Set the parallel port parameters. > try { > parallelPort.enableReceiveTimeout(READ_TIMEOUT); > parallelPort.disableReceiveFraming(); > parallelPort.disableReceiveThreshold(); > //parallelPort.setMode(mode); !!!!errors > } catch (UnsupportedCommOperationException e) { > throw (new IOException("Parallel port with address '" + > address > + "' cannot be configured as specified")); > } > > return true; > } > > > > public void write(final byte[] bytes) throws IOException { > initialize(); > while (busyReading) { > Thread.yield(); > } > busyWriting = true; > if (bytes.length < 1) { > return; > } > OutputStream outputStream = parallelPort.getOutputStream(); > outputStream.write(bytes); > outputStream.flush(); > outputStream.close(); > Debug.p("PPIOP.write: wrote '" + new String(bytes) + "'"); > busyWriting = false; > } > > > public byte[] read() throws IOException { > > // Read up to MAX_BYTES bytes. > initialize(); > while (busyWriting) { > Thread.yield(); > } > busyReading = true; > byte[] buff = new byte[MAX_BYTES_READ]; > InputStream inputStream = parallelPort.getInputStream(); > // This read blocks until input data is available > int bytesRead = inputStream.read(buff); > inputStream.close(); > // If no data read, create empty array > if (bytesRead == -1) { > bytesRead = 0; > } > byte[] deviceBytes = new byte[bytesRead]; > System.arraycopy(buff, 0, deviceBytes, 0, bytesRead); > if (bytesRead > 0) { > Debug.p("PPIOP.read - got data: '" + new > String(deviceBytes) + "'"); > } > busyReading = false; > return deviceBytes; > } > Hi Bob I've only used rxtx to test a hello world page printing but there are others that have used it. PPIOP? hmm what is this? :) The rxtx parallel support is behind the serial support but should be OK. As you note, the setting of modes is not supported. rxtx uses what is provided when the port is open. Are your asserting the pin for the printer being online? I suspect what often happens is people try to just use the data pins but the C API rxtx uses wants the printer to be online. There should be some posts relating to this in the rxtx mail-list archive. Some APIs are probably reading and writing from the port address (also suggested in your code as something you are looking at). RXTX currently uses a higher level C/C++ API for port access. This can still work if the API thinks the 'printer' is there. -- Trent Jarvi tjarvi at qbang.org From agrodellic at gmail.com Sat May 6 08:39:40 2006 From: agrodellic at gmail.com (Leigh Stewart) Date: Sat, 6 May 2006 10:39:40 -0400 Subject: [Rxtx] sun commapi 3 Message-ID: I think I read here: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html that rxtx-2.0 is basically fracked for now? Does anyone know of a workaround? ie can i somehow get an older version of sun's comm api and use that (not easy to find)? i mean 2.0 must be working for someone...how is it being tested. 2.1 isnt working for me....im getting nasty native exceptions etc, which is why im so set on 2.0... any ideas? From tjarvi at qbang.org Sun May 7 15:40:27 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 7 May 2006 15:40:27 -0600 (MDT) Subject: [Rxtx] sun commapi 3 In-Reply-To: References: Message-ID: On Sat, 6 May 2006, Leigh Stewart wrote: > > 2.1 isnt working for me....im getting nasty native exceptions etc, > which is why im so set on 2.0... any ideas? > Hi Leigh What native exceptions are you seeing? Which OS? The native code is almost identical between rxtx 2.0 and 2.1. Only the names have been changed to protect the inocent. :) ie: javax_comm_... vs gnu_io_... So the odds are very likely that even if you do find commapi 2.0 and get it installed, you will run into the same error. It would be better to just find and fix the problem. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Mon May 8 10:47:20 2006 From: mail at willicon.de (WILLICon) Date: Mon, 08 May 2006 18:47:20 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 Message-ID: <445F7618.3070303@willicon.de> Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/ef37e8ec/attachment-0004.html From tjarvi at qbang.org Mon May 8 16:14:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 May 2006 16:14:51 -0600 (MDT) Subject: [Rxtx] Screenshot of Application using RXTX (fwd) Message-ID: Just though someone may end up searching for 0x0D and 0x0A. Here are the details from his system. SuSE Linux 10.0 (x86_64) Kernel 2.6.13-15.8 j2se 1.4.2_11 (i586) Sun: comm3.0_u1 rxtx: rxtx-2.1-7 ---------- Forwarded message ---------- Date: Sat, 6 May 2006 20:01:46 +0200 From: Michael Poppitz To: taj at www.linux.org.uk Subject: Screenshot of Application using RXTX Hi Trent, the rxtx package works like a charm. Sun's package seemed to replace all 0x0D with 0x0A in received data on my Linux box, which is really annoying when transfering binary data. But rxtx came and saved the day - and turned out to be a lot more convenient as it does not require a configuration file. I use it for connecting to a home made logic analyzer. (http://www.sump.org/projects/analyzer/) Thanks for your great job, Michael -------------- next part -------------- A non-text attachment was scrubbed... Name: la_client.png Type: image/png Size: 16592 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060508/45494fbb/la_client-0004.png From tjarvi at qbang.org Tue May 9 14:56:05 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 May 2006 14:56:05 -0600 (MDT) Subject: [Rxtx] RXTX javax.comm: which one to install? In-Reply-To: <20060509161742.43547.qmail@web53814.mail.yahoo.com> References: <20060509161742.43547.qmail@web53814.mail.yahoo.com> Message-ID: On Tue, 9 May 2006, Adenilson Cavalcanti wrote: > Dear Trent Jarvi > > I'm trying to write a small Java app running in linux that interfaces with a device connected to serial port. > > I do have some questions about RXTX and javax.comm state of affairs, since I'm new to Java programming (used to program in plain old C writting to devices using termios and open/write/read syscalls, but this is another story). > > I ask you the favor to clarify this issues (if possible...): > > a) Sun offers to download a file (comm3.0_u1_PUTAUNIXVERSION.zip) which does contain .so files. Does it work out of box? > > b) Case negative, its there that we should use 'librxtx*.so' provided by your site? > > c) Sun's comm3 API version does work with which version of rxtx? > > I already searched google and read documentation available in rxtx site ("Java Comm Serial API How-to") but still have this issues unsolved. Any help will be appreciated. > > Best regards > > Adenilson Hi Adenilson, RXTX does not currently support javax.comm in Sun's CommAPI 3.0. I would recommend using package gnu.io provided by rxtx 2.1. -- Trent Jarvi tjarvi at qbang.org From chris.develder at intec.ugent.be Wed May 10 08:45:40 2006 From: chris.develder at intec.ugent.be (Chris Develder) Date: Wed, 10 May 2006 16:45:40 +0200 Subject: [Rxtx] rxtx troubles on ARM Message-ID: <4461FC94.6040909@intec.ugent.be> Hi all, Sorry to bother you, but I don't seem to get RXTX working on an ARM processor (xscale ixp 425, big endian). I managed to crosscompile the rxtx libs and moved it over to the ARM. Using jamvm (which is the only open source java VM we got working on the ARM), I get the following error result when running SimpleRead from Sun's javax.comm examples (commapi\examples\Simple\SimpleRead) -- see bottom of mail for complete output: "java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver" However, output shows that the RXTXCommDriver code is accessible (cf. debug and devel output of lib versions). So it doesn't seem to be a missing lib/jar issue. The error happens before RXTXCommDriver.initialize() is called, since the first line there is System.out.println("RXTXCommDriver:initialize()"); Any ideas? Cheers, Chris ---------------------------- [root at xxx(ttyp1) /work/cdvelder/xscale/test]# jamvm -Djava.library.path=/work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/jre/lib/arm -classpath /work/cdvelder/xscale/usr/local/rxtx-2.1-7r2/lib/ext/RXTXcomm.jar:./comm.jar:. SimpleRead RXTXCommDriver {} Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTXCommDriver: Jar version = RXTX-2.1-7 native lib Version = RXTX-2.1-7 java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver gnu/io/RXTXCommDriver at javax.comm.CommPortIdentifier.loadDriver (CommPortIdentifier.java:239) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:109) at SimpleRead.main (Unknown Source) java.lang.UnsatisfiedLinkError: isSessionActive at com.sun.comm.SunrayInfo.isSessionActive (Native Method) at com.sun.comm.Portmapping.registerCommPorts (Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase (Portmapping.java:100) at javax.comm.CommPortIdentifier. (CommPortIdentifier.java:138) at SimpleRead.main (Unknown Source) From joachim at buechse.de Fri May 12 00:44:48 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 08:44:48 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) Message-ID: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Good day, I guess that only a selected few (hi Trent) will be able to answer this question, but the answer might be interesting for anyone trying to debug or understand the code. Apparently the MonitorThread is started and stopped in RXTXPort.addEventListener and RXTXPort.removeEventListener. This would indicate that (originally?) the MonitorThread is only required when there is an EventListener. However the MonitorThread is also started in the RXTXPort constructor, which could mean that RXTX won't work at all if it isn't there. It seems to me, that if anyone would add an event listener and later on remove it, he could potentially wreak the port. Because the second action would kill the MonitorThread. For the moment I am only trying to understand the role of and idea behind the MonitorThread. But of course there is a deeper reason thor my question: If the MonitorThread needs to exist anyway, it could be the thread that cleans up the port (ie calls nativeClose) - this would eliminate (a further) problem I am seeing with some USB drivers on Mac OSX. (Close blocks (after releasing the tty, but still) in the USB driver if the device is "not responding"). Greetings, Joachim From tjarvi at qbang.org Fri May 12 07:10:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 12 May 2006 07:10:59 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Fri, 12 May 2006, Joachim Buechse wrote: > Good day, > > I guess that only a selected few (hi Trent) will be able to answer > this question, but the answer might be interesting for anyone trying > to debug or understand the code. > > Apparently the MonitorThread is started and stopped in > RXTXPort.addEventListener and RXTXPort.removeEventListener. This > would indicate that (originally?) the MonitorThread is only required > when there is an EventListener. However the MonitorThread is also > started in the RXTXPort constructor, which could mean that RXTX won't > work at all if it isn't there. > > It seems to me, that if anyone would add an event listener and later > on remove it, he could potentially wreak the port. Because the second > action would kill the MonitorThread. > > > For the moment I am only trying to understand the role of and idea > behind the MonitorThread. But of course there is a deeper reason thor > my question: > > If the MonitorThread needs to exist anyway, it could be the thread > that cleans up the port (ie calls nativeClose) - this would eliminate > (a further) problem I am seeing with some USB drivers on Mac OSX. > (Close blocks (after releasing the tty, but still) in the USB driver > if the device is "not responding"). > Hi Jaochim Before commapi, rxtx did not support events. You could read, write and change port settings. The MonitorThread was added as an afterthought to support commapi events. So the way things are now his historical spaghetti not a well devised plan. It is my opinion that the MonitorThread should exist as long as the port is open. The odd starting of the thread in the constructor and addEventListener was just to get past the obvious problem of people using the port without adding listeners. -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Fri May 12 07:59:50 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 15:59:50 +0200 Subject: [Rxtx] MonitorThread -> ChangeRequest In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: <2B1E508C-8CEE-4AB7-914D-E7BA25C871A2@buechse.de> In this case I suggest removing the starting/stopping of MonitorThread in addEventListener / removeEventListener. This should not affect existing projects. On 12.05.2006, at 15:10, Trent Jarvi wrote: > It is my opinion that the MonitorThread should exist as long as the > port > is open. The odd starting of the thread in the constructor and > addEventListener was just to get past the obvious problem of people > using > the port without adding listeners. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Fri May 12 11:43:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Fri, 12 May 2006 19:43:21 +0200 Subject: [Rxtx] Spring Cleaning - some suggestions Message-ID: The current implementation of RXTX contains quite a lot of code that will break if it is used from several threads (especially on a multi processor machine). I think it would be nice to clean this up. I suggest the following changes (which keep the current semantics and should not influence existing projects in a negative way): - InterruptedException will never be ignored or reset - read methods will be protected with a Monitor - write methods will be protected with a (separate) Monitor - close() sets the read and write monitors into a "closed" state which will lead to IOExceptions for any following call to RXTXPort.read/write. - close() will wait a finite amount of time (maybe 500ms) for the release of the read and write monitors after that, it will trigger the closing of the file descriptor to abort any pending read or write. - close() will not call close(file_desc). Instead it will "interrupt" (ie set a flag and then, pthread_kill(ABRT)) the MonitorThread, the MonitorThread will call close(file_desc). - the monitors are properly released in a finally block the try of which starts directly after obtaining the monitor. - finally will not call close(file_desc) it will only "interrupt" the MonitorThread (see above) - the native-code (esp read) does not use SA_RESTART but checks Thread.interrupted() when it receives a SIGNAL (ie system call returns with EINTR or other signalling method). The read/write monitors will be allocated from a factory whose mode can be set to fast/normal/advanced. In fast-mode it will create "non thread safe, non synchronized" pseudo-monitors. In default mode, the monitors will store the owning thread. In "advanced" mode setting the monitors into closed state will "interrupt()" threads which are blocked in a native read/write. {Reasoning close behaviour: Calling close on a file descriptor in Windows unblocks any read() or write() on the same file descriptor with an error. On Solaris < 2.7 and MacOS X however the close() will/ can block - until the read or write have finished:-(( Even the JDK people have trouble with this. I dont know how Linux reacts in this case. The best practice for BSD/Solaris is to send a signal to the thread which will usually unblock the read/write with an EINTR - this however is not guarenteed as it also depends on the device driver. So the only resolution that will certainly not block the thread calling RXTXPort.close() (which will often enough be the AWT event dispatcher or the VM finalizer thread) is to call close(fd) from another thread.} {Reasoning read behaviour: It is rather uncommon to receive a signal while reading or writing - it will happen, but checking Thread.interrupted() when it happens will not degrade performance. The checking of Thread.interrupted() can be handled by returning to Java and potententially reentering into the native code if the thread was not interrupted or by calling back into the VM from the native code. On top of this, many functions like read(byte[]) or read(byte [], int, int) are allowed to return less than the requested amount of data. Only int read() is a bit more tricky. } [Trent: From the code I can tell, that you experimented quite a bit with signals. Do you know if the Java Thread.interrupt() triggers a unix signal on Linux/Solaris? If so, which one?? References: - http://java.sun.com/docs/hotspot/VMOptions.html - http://www.hp.com/products1/unix/java/infolibrary/prog_guide/ signals.html ] On OS X (hotspot client jdk-1.4.2) I did not see any signal propagated to the SELECT of the event_loop/MonitorThread (ie no EINTR) when I call monThread.interrupt(). This is a pitty, but thats the way it is. I simply assume this is true for most system calls. How to handle this? Of course it would be possible to install/ deinstall a specific signal handler before/after every native read and to natively send an ABRT signal if RXTXPort.close is called. A more elegant solution might be to have an additional "signaling" socket which is always included in the SELECT. Or the simplest solution: cap the timeout of the select to 500 ms (the loop around it exists already) after every timeout check the Thread.interrupted() flag. From a performance perspective this should be completely invisible... On the other hand, all write() calls need to be preceeded by a SELECT as well, to avoid running into a blocking write. Best regards, Joachim From lyon at docjava.com Sat May 13 05:54:52 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Sat, 13 May 2006 07:54:52 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Dmitry suggests that we acquire an implementation of a serial port reference, use it, then release it (i.e., check it back in). Joachim says that making serial ports thread friendly might be a good idea. This is a good idea. The design pattern that is close to this idea is the "Object Pool Design Pattern". # Object Pool Manage the reuse of objects for a type of object that is expensive to create or only a limited number of a kind of object can be created. It has been described at: http://www.developer.com/java/ent/article.php/626171 and in Marks' book, Patterns in Java, Volume 1. However, the Object Pool is intended to pool objects so that each object is just like every other object. The intent of the Parametric Singleton is to enable others to access the same resource at the same time (as long as the same parameters were used in construction). It sounds like we need a NEW Design Pattern (Oh no, Doug is doing it again!). Yes friends, you got me on a role (roll) :) If you like design patterns, you can thank me later. If you don't like design patterns, blame Dmitry, it was his idea ;) And Dave, thanks for the feedback on Singleton abuse. It has led me to change the way I think about application contexts, which we will see, below. We need (drum roll please): The Parametric Object Pool Design Pattern (POP) By Douglas A. Lyon ABSTRACT The goal of the Parametric Singleton design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values, in a given context. In comparison, the goal of the POP design pattern is to make sure that there is one, and only one, instance of a given class with the given parametric values and that only one reference to the class is checked out at a time, in a given context. A context is a namespace for holding identifiers during execution. In Java, A context can be changed in any of several ways. For example, creation of a new class loader, the deserialization of an old POP or the creation of a new process all create a new namespace. The POP Design Pattern combines the Parametric Singleton Design Pattern with the check out mechanism of the Object Pool Design Pattern. This enables unique creation of instances of a class. These instances are cached in a table. When a clients asks for an instance with these parameters, the cache is checked. If the instance is not in the cache it is created. If the instance is available, the clients checks out the instance. A reference is left to the clients that checked out the instance. The POP has the role of creating objects uniquely, from parameters. It also has the role of keeping track of which clients has checked out a given object. This is just like a library keeping track of who borrowed a book. If a resource is left unavailable in a system, a deadlock can occur. Deadlock debugging is facilitated by mapping a resource to the clients that have checked it out. We apply our POP Design Pattern to the retrieval of serial ports. The goal of our system is to make sure that serial ports are checked out to only one client at a time, and that they be checked back in when the client is done. The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. Users are discouraged from calling this the Parametric Object Oriented Pool (POOP). Introduction The intent of the POP Design Pattern is to ensure that a class has only one instance for a given set of parameter values. It also provides a point of access that is global to a given context. The POP uses the Singleton Design Pattern to ensure that there is only one POP, in the given context. The POP DP is responsible for checking out a reference to a given instance, and keeping track of that instance. The instance is responsible for sharing that instance. POP requires that users of the DP implement an interface that enables a recall facility. Thus, if there is a contention for a consumed resource, the deadlock can be resolved in an orderly fashion. Motivation A system cannot tolerate multiple instances of some classes with identical parameters used by different instances at the same time. For example, you cannot have two instances use the same serial port, at the same time. You cannot have two instances that are trying to listen to the same socket connection. You cannot have two instances writing to the same file structure at the same time. Further, once a serial port is checked out by a client, it is assigned to the client. This is like the spin-lock service provided by the operating system, only in the application layer. Naturally, deadlock will occur if a resource is not released, therefore the client of the resource is tracked. Recalling a resource is required for the POP DP by virtue of the implementation of an interface. The policy on how to break a deadlock (by honoring the recall) is application specific. As the operating system is often thought of as the arbiter of consumed resources (i.e., tape drives, serial ports, etc.) we frequently leave it to an operating system implementation to resolve these contention issues. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on naming conventions (which are not well standardized). The POP Design Pattern is not meant to replace the locking mechanism used by the milieu, but to supplement it. The POP Design Pattern can take on the role of the peer method mapper that homogenizes the API for different operating environments. That is, it can wrapper the different locking mechanisms used in different operating systems. POP that is responsible for keeping track of the instances created and the client that has checked them out. The POP Design Pattern is implemented using the Singleton Design Pattern. In Java, the POP implementation is declared final, so that it cannot be subclassed. The class also has a private constructor, so that other classes cannot instance it. The new design pattern is called the POP design pattern and it provides a way to check out and create instances with given parameters. Applicability Use the POP Design Pattern when: 1. There must be exactly one instance of a class with the given parameters in a given context. 2. The instances must be accessible to clients from a well-known access point. 3. The instances are reusable. 4. Only one client can check out an instance at a time. Structure Insert UML diagram here. Participants The POP Clients that need instances 1. The POP defines an instance upon request from a client, if, and only if, the instance does not already exist. 2. The POP returns the instance to the client. 3. The POP is responsible for creating unique instances from given parameters. 4. The POP is responsible to recalling instances from clients. Collaborations Clients obtain a reference to a POP instance only through the singleton design pattern. If the POP instance is left in an improper state (e.g., the serial port was left open) it is NOT the role of the POP to close the IO port. However, the POP can be requested to get the instance released. Nor is it the role of the POP Design Pattern to open the port. That role is delegate to some other part of the system. Further, it is the role of the POP Design Pattern to check out resources. However, it is still possible to have, multiple threads that have multiple references to the same resource at the same time. Checkout and resource requests are MUTEX locked (i.e., synchronized). Consequences The POP Design Pattern has several benefits: 1. Controlled access to parametrically defined instances. Since the POP encapsulates its instances, there is some limited control over how and when clients access it. 2. Reduced name space. The POP pattern avoids global variables that store instances created from the same parameter. Implementation Here are implementation issues to consider when using the POP pattern: 1. Unique mapping of parameters. The POP pattern requires that there be a mean to isomorphically map the parameter space into the instance space and back again. 2. Ensure unique instances. The POP pattern makes unique instances from parameters, and it does so only once. 3. Cache instances for fast retrieval. The POP must be able to look up instances, given some set of parameters, and do so from some data structure. That is, there must be enough space to hold references to all the instances the program will need. Also, a mechanism is needed to look up and retrieve the instances quickly enough to satisfy the clients. Sample Code To be written....any volunteers? Thanks! - Doug >I don't think I get it > >On Mar 22, 2006, at 9:36 AM, David Garnier wrote: >>Using the singleton pattern in this case is >>just convenient for the programmer. Problems >>arises >>pretty quickly, especially if you attempt to unit-test your classes. > > >so you're saying that something isn't so good >because you can not test it in the convenient >way? >if that's true, I'm totally disagree >change your test, debug whatever, but if >software is efficient at runtime, works fine and >only problem is some unit test >(which is some kind of framework for testing) >then dump that unit test , dump that unit >framework and make something appropriate to the >software >you're testing > >so if Douglas want to use singletons, what's the problem? >and what do you mean by abusing of singleton usage? > >of course singleton doesn't prevent concurrent >access to the resource across the processes >unless >you're using some OS facility to prevent it, besides >singleton as it was introduced is relevant only >and only inside of the same process >otherwise it's not singleton it's something else >(let's say network singleton: so you have remote >invocation facility >and some factory method that return object created by that facility) > >I don't have any problem with using any kind of singletons. > Parametric Singleton idea (if I understand it >right) could be easily implemented in the >following way: >use a map >populate map with instances of some class and key is your parameter >(you can use lazy population too) > >if somebody ask the key check the value if it's null so resource is taken >if somebody returns the resource put it back to the map > >public synchronized static Object getSomeResource(Object parameter); >public synchronized static void returnResource(Object parameter); > >getSomeResource (inside of the same process) could return null in 2 cases >1. if somebody (from other thread for example) already took that resource >2. if OS API said that resource corresponded to >that parameter (serial port with parameter = 1 >(port #)) >is locked and unavailable; >I'm not sure that in case of serial ports we >even need those Parametric Singletons >(unless lock checking is a very expensive operation) >just ask the OS about availability of that >resource and if it's available give it away >and then OS will lock it and therefore in next >time somebody ask it just answer that resource >is locked >and return null > >for example system has 2 serial ports available >so I ask getResource("tty"); >or I ask getResource("Bluetooth-Modem"); > >and if OS is ok you can give tty or Bluetooth-Modem or both > >no need for any additional pattern I think > >back to the problem >mac os x doesn't recognize locking via files, so >it handles locking via some API >an instance of the singleton in each process >should recognize that resource is locked >(by using that API) that's all >we don't have to make things more complicate >then they are just because there is some nice >design pattern or nice unit test framework or whatever >keep things simple, make them work fast, don't introduce middle layers >unless you have really good reason to do so > >of course I could be entirely wrong, so sorry about that in advance > >thanks > > >Dmitry Markman > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx >Good day, > >I guess that only a selected few (hi Trent) will be able to answer? >this question, but the answer might be interesting for anyone trying? >to debug or understand the code. > >Apparently the MonitorThread is started and stopped in? >RXTXPort.addEventListener and RXTXPort.removeEventListener. This? >would indicate that (originally?) the MonitorThread is only required? >when there is an EventListener. However the MonitorThread is also? >started in the RXTXPort constructor, which could mean that RXTX won't? >work at all if it isn't there. > >It seems to me, that if anyone would add an event listener and later? >on remove it, he could potentially wreak the port. Because the second? >action would kill the MonitorThread. > > >For the moment I am only trying to understand the role of and idea? >behind the MonitorThread. But of course there is a deeper reason thor? >my question: > >If the MonitorThread needs to exist anyway, it could be the thread? >that cleans up the port (ie calls nativeClose) - this would eliminate? >(a further) problem I am seeing with some USB drivers on Mac OSX.? >(Close blocks (after releasing the tty, but still) in the USB driver? >if the device is "not responding"). > >Greetings, >Joachim > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Sat May 13 10:07:37 2006 From: joachim at buechse.de (Joachim Buechse) Date: Sat, 13 May 2006 18:07:37 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Douglas, Looking at the current code, leaves me with the feeling, that there is a lot to do. Defining an API that wraps javax.comm to provide what you describe is certainly possible, but I wonder how much benefit it will actually provide. Personally I think the API defined by javax.comm "request/lock" a port with: cp= new CommunicationPort(identifier) "release" a port with: cp.close(); works quite nice for 99% of the applications. In my experience, the most efficient and elegant implementation is to wrap a port/socket/.. into a business object which declares the remote operations that are possible. Ie "uploadFile", "waitForPrompt", "getSerialNumber", "sendContact", "executeCommand", etc Those methods are then either synchronized or guarded by a monitor. I do not see how your design pattern applied to the port resource would help implementing this. [details start, skip if you agree to the above] When I talked about "thread-safe" I didn't mean several independent "sessions" accessing the port concurrently. I think this is a very rare usage. I believe the most common use case for serial ports today is the control of an external device from a PC running a GUI based application. To implement a clean Swing/AWT-GUI one needs to pass any action that can block to a "worker" thread (else the GUI blocks, the application appears dead). While it is possible to use own prespawned thread that will accept Runnables which operate on the port, this is not very elegant. It is more common to spawn a new thread for every action triggered by the user. Additionally the ABORT of a running operation is often implemented via a port.close() delegated to a different thread. - During the lifetime of a port, it will usually be accessed from several different threads. Instance variables need to be set/read in synchronized regions to guarantee a correct operation based on the Java memory model. - Synchronizing the access is usually handled on the application level (synchronizing the reads/writes is usually useless from the applications view because it is not a transaction mechanism). [details end] I am very open to learn about other scenarios where your proposed design pattern applied to the port resource is beneficial to the application implementor. Best regards, Joachim On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > Dmitry suggests that we acquire an implementation of > a serial port reference, use it, then release it (i.e., check it > back in). > > Joachim says that making serial ports thread friendly might be a > good idea. > > This is a good idea. The design pattern that is close to this idea > is the "Object Pool Design Pattern". > # Object Pool From jredman at ergotech.com Sun May 14 14:28:24 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 14:28:24 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers Message-ID: <446792E8.4000506@ergotech.com> Does anyone know of any work to make RXTX work with Ethernet (telent) Terminal Servers? If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? We've used RXTX with upwards of 100 virtual COM ports on Windows and it works well. Linux is more problematic. It would be good to have an OS independent solution to accesses remote Ethernet serial ports. Jim -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From legolas.w at gmail.com Sun May 14 14:26:34 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:56:34 +0430 Subject: [Rxtx] does any one have a working sample of RXTX and LPT port Message-ID: <4467927A.4000008@gmail.com> Hi Thank you for reading my post does any one has a working sample for RXTX and LPT port ? Thanks From legolas.w at gmail.com Sun May 14 14:27:29 2006 From: legolas.w at gmail.com (Legolas Woodland) Date: Mon, 15 May 2006 00:57:29 +0430 Subject: [Rxtx] does RXTX support Trigerr on parallel port? Message-ID: <446792B1.4040905@gmail.com> Hi does RXTX support trigger on LPT port ? if so , how i can use it ? Thanks From tjarvi at qbang.org Sun May 14 17:40:59 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 17:40:59 -0600 (MDT) Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: <446792E8.4000506@ergotech.com> References: <446792E8.4000506@ergotech.com> Message-ID: On Sun, 14 May 2006, Jim Redman wrote: > Does anyone know of any work to make RXTX work with Ethernet (telent) > Terminal Servers? > > If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 > Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? > Hi Jim It appears the author of NVTCom has decided to release the library into the public domain. Integration with rxtx is possible but it would be best to contact the author and find out what his intent is. I would suggest contacting the author with a proposal of what you would like to do and take it from there. We could 'take' public domain software but its better to show respect to the authors and respect their wishes. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:10:23 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:10:23 -0600 (MDT) Subject: [Rxtx] does any one have a working sample of RXTX and LPT port In-Reply-To: <4467927A.4000008@gmail.com> References: <4467927A.4000008@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > Thank you for reading my post > does any one has a working sample for RXTX and LPT port ? > Thanks Hi Legolas LPT port support in rxtx is spotty. That means some people have sent in patches for what they do and it works well for them. The original code was not very good. It may have been 3 hours work :/ To get started, Sun has some demo programs with their commapi. With rxtx 2.1 you can change their code from using javax.com to gnu.io and it -should- work. But if it does not you can post here and on bugzilla. There has been more interest lately off the list and maybe there will be enough community resources to get what you need going. If you do get a sample program together, we would gladly put it in the contrib directory so the next person can get things going faster. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun May 14 20:12:12 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 14 May 2006 20:12:12 -0600 (MDT) Subject: [Rxtx] does RXTX support Trigerr on parallel port? In-Reply-To: <446792B1.4040905@gmail.com> References: <446792B1.4040905@gmail.com> Message-ID: On Mon, 15 May 2006, Legolas Woodland wrote: > Hi > does RXTX support trigger on LPT port ? > if so , how i can use it ? > Hi Legolas As mentioned in the previous post, rxtx parallel support is not very mature. But if you can point to something that describes the trigger feature, we can probably make sure its there and give a quick code example. -- Trent Jarvi tjarvi at qbang.org From jredman at ergotech.com Sun May 14 22:22:48 2006 From: jredman at ergotech.com (Jim Redman) Date: Sun, 14 May 2006 22:22:48 -0600 Subject: [Rxtx] RXTX Ethernet Terminal Servers In-Reply-To: References: <446792E8.4000506@ergotech.com> Message-ID: <44680218.4080008@ergotech.com> Trent, Trent Jarvi wrote: > On Sun, 14 May 2006, Jim Redman wrote: > >> Does anyone know of any work to make RXTX work with Ethernet (telent) >> Terminal Servers? >> >> If not does anyone have an opinion of integrating NVTCom JAVA RFC2217 >> Library (http://www.viara.cn/en/nvtcom.htm) with RXTX? >> > > Hi Jim > > It appears the author of NVTCom has decided to release the library into > the public domain. Integration with rxtx is possible but it would be best > to contact the author and find out what his intent is. > > I would suggest contacting the author with a proposal of what you would > like to do and take it from there. We could 'take' public domain software > but its better to show respect to the authors and respect their wishes. > I sent Marco(?), the author of the library, a note before asking the list - I'll let you know the response. If anyone is already working on it, or has an interest and more time and energy than me, I'd hate to duplicate the efforts. If no one is, and no one objects, maybe I'll see what I can do. Jim > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From Christian.Klemke at t-online.de Mon May 15 02:23:06 2006 From: Christian.Klemke at t-online.de (Christian Klemke) Date: Mon, 15 May 2006 10:23:06 +0200 Subject: [Rxtx] RXTX causing stdout messages References: <20060504204122.GA6534@earth.utah.edu><004f01c67005$fc72fee0$016a10ac@NB600> Message-ID: <008a01c677f8$cae18590$02fea8c0@NB600> Hi Trent, Hi Paul, I finally found some time to create a simple patch to enable the optional suppression of version output to the console. It is based on a new system property called "gnu.io.rxtx.NoVersionOutput" which can by set to "true" if necessary. I had some problems accessing CVS, therefore I downloaded the rxtx-2.1-7r2 source archive from ftp.qbang.org (which is linked on the rxtx.org download page) and worked with that release. Please find my proposed patch in the attachment ! Regards, Christian ----- Original Message ----- From: "Trent Jarvi" To: "RXTX Developers and Users" Cc: ""Paul Gettings"" Sent: Friday, May 05, 2006 2:09 PM Subject: Re: [Rxtx] RXTX causing stdout messages > On Fri, 5 May 2006, Christian Klemke wrote: > >> Hi Paul, >> >> I was wondering about the same question some days ago and took a look at >> the >> source files. Unfortunately, I found that you can only get rid of that >> messages by altering and recompiling the Java code. There is a final >> static >> boolean variable called "devel" in the file "RXTXCommDriver.java" which >> is >> set to "true". This constellation causes the output after the native >> libraries have been loaded. No mechanism exists to suppress them >> otherwise >> :-(. >> >> Trent, does that mean that 2.1.7 is still officially a "development" >> version >> ? When will this value be changed to "false" by default ? With 2.1.8 ? It >> would be nice to provide a means to suppress such messages besides that >> static flag (maybe by setting a property called >> "gnu.io.rxtx.NoVersionOutput" to true or something like that...) ? The >> output can indeed by annoying, especially when used with console >> applications, where the message potentially appears "in the middle" of >> your >> own output. Another possibility would be not to use System.out directly, >> but >> instead some PrintStream field which is initially set to System.out but >> can >> programatically be changed. That would allow for any kind of redirection >> or >> suppression by implementing appropriate user-defined PrintStream >> subclasses >> and making RXTX use that stream. What do you think ? >> > > A patch for using properties would be accepted I'm sure. > > The reason the default is to display the message is not related to the > development state of rxtx anymore. The problem is that people first using > rxtx try rxtx 2.0 and 2.1 then end up with a mix of both causing problems. > The message prevents a great deal of email thats easily explained by the > message. > > I question if we should support rxtx 2.0 at all anymore. > > If you post a patch in bugzilla, we'll put it into CVS this weekend. > we'll be going through and doing such things anyhow. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx_version_output_patch.diff Type: application/octet-stream Size: 991 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060515/3173c2b6/rxtx_version_output_patch-0004.obj From lyon at docjava.com Mon May 15 06:06:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 May 2006 08:06:21 -0400 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hi All, Joachim makes several good points. Let me see if I can address some of them below: >Hello Douglas, > >Looking at the current code, leaves me with the feeling, that there? >is a lot to do. Yes! >Defining an API that wraps javax.comm to provide what? >you describe is certainly possible, but I wonder how much benefit it? >will actually provide. > >Personally I think the API defined by javax.comm > >"request/lock" a port with: > cp= new CommunicationPort(identifier) >"release" a port with: > cp.close(); > >works quite nice for 99% of the applications. I don't know what percentage of applications turn off locking, the way that I do in my version of the RXTX lib. I do know that this is not safe practice. I also know that it was motivated by the multi-platform nature of my code and that this was the only way I could make things work, at the time. Java does not appear to have a cross-platform standard for locking resources on various platforms. Each OS appears to have its own standard. The question of who breaks deadlocks and how this is done remains open, as this is not an easy question to resolve. Let me continue, below: > >In my experience, the most efficient and elegant implementation is to? >wrap a port/socket/.. into a business object which declares the? >remote operations that are possible. Ie "uploadFile",? >"waitForPrompt", "getSerialNumber", "sendContact", "executeCommand",? >etc Those methods are then either synchronized or guarded by a? >monitor. I do not see how your design pattern applied to the port? >resource would help implementing this. I have no problem with high-level wrappers that are application specific. That is a very good idea, but orthogonal with respect to the issue of deadlocks. More below: > >[details start, skip if you agree to the above] >When I talked about "thread-safe" I didn't mean several independent? >"sessions" accessing the port concurrently. I think this is a very? >rare usage. That is probably why turning locking off works so well! On the other hand, it is not safe and I shouldn't do it. >I believe the most common use case for serial ports today? >is the control of an external device from a PC running a GUI based? >application. To implement a clean Swing/AWT-GUI one needs to pass any? >action that can block to a "worker" thread (else the GUI blocks, the? >application appears dead). While it is possible to use own prespawned? >thread that will accept Runnables which operate on the port, this is? >not very elegant. It is more common to spawn a new thread for every? >action triggered by the user. Additionally the ABORT of a running? >operation is often implemented via a port.close() delegated to a? >different thread. Here lies the heart of serial port concern. An application opens a serial port and then dies. The application is restarted and finds the port locked. How do we clear the lock? Must the application's user reside in the UUCP group? Must installers of the serial port add users to the UUCP group? Should locking be handled at a high-level of abstraction in an operating system independent way? Should the implementation of the locking mechanism be translated into an API that is dependent on the OS convention? Suppose that we restrict the discussion to serial ports. Even for similar resources (like serial ports) there are few standards for handling contention. For example, serial ports on Linux are locked using a "/var/lock" file. POSIX, on the other hand, uses ioctl mechanisms to make sure that no other process will open the port. Also, lock files depend on inconsistent naming conventions. Hence my feeling that we need to mirror what is done in other API's; we need a locking toolkit that references peer methods, IMHO. >From the Java programming point of view, the locking API is portable across different platforms, but has, as its implementation, a native peer method that uses the conventions of the underlying OS. This enables portable resource locking (in theory!). Consider, for example: org.apache.commons.transaction.locking with: Interface LockManager at: http://jakarta.apache.org/commons/transaction/apidocs/org/apache/commons/transaction/locking/LockManager.html Or, more recently: java.util.concurrent.locks Interface Lock based on Doug Lea's code: http://kickjava.com/src/EDU/oswego/cs/dl/util/concurrent/ReadWriteLock.java.htm Should we incorporate a clean, portable design into serial port use, one that is consistent with current locking APIs? Basically, a comm port is a resource and resources are typically controlled by managers. Thus, I suggest that we make use of a CommPortManager to help control and centralize serial port usage. The question of how this is done remains open, IMHO, but using core API's like: java.util.concurrent.locks might not be amiss. High-level methods (getAllPorts, getAllSerialPorts, getAllParallelPorts, etc...) might be welcome additions. Basic questions like, "what if a port is in use?" remain open, hence my proposal for the new design pattern. Isn't it the CommPortManager's role to break the deadlock? Cheers! - Doug > >- During the lifetime of a port, it will usually be accessed from? >several different threads. Instance variables need to be set/read in? >synchronized regions to guarantee a correct operation based on the? >Java memory model. >- Synchronizing the access is usually handled on the application? >level (synchronizing the reads/writes is usually useless from the? >applications view because it is not a transaction mechanism). >[details end] > >I am very open to learn about other scenarios where your proposed? >design pattern applied to the port resource is beneficial to the? >application implementor. > >Best regards, >Joachim > >On 13.05.2006, at 13:54, Dr. Douglas Lyon wrote: > >> Dmitry suggests that we acquire an implementation of >> a serial port reference, use it, then release it (i.e., check it? >> back in). >> > > Joachim says that making serial ports thread friendly might be a? >> good idea. >> >> This is a good idea. The design pattern that is close to this idea >> is the "Object Pool Design Pattern". >> # Object Pool > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Mon May 15 06:58:19 2006 From: joachim at buechse.de (Joachim Buechse) Date: Mon, 15 May 2006 14:58:19 +0200 Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: Hello Doug, I agree fully, that locking of the system resource should be abstracted from the user (programmer). Currently this is already the case, but I agree it might be nice to extract the code into a separate class, which uses platform dependent providers to do its job. What I described in my email was not targeted at allocating the system resource, but at handling an already allocated system resource inside the framework. I agree that it may be possible to combine the two - however, I would suggest to do this in phase2. I can contribute a work over of RXTXPort.java which implements clean internal locking and proper close behavior (which I would call phase 1). I could do this this week. However I strongly believe that there is little sense in trying to do this as a series of patches. It will be closer to a rewrite than to a patch. I have already provided a number of suggested patches via Bugzilla, but this is quite inconvenient (for me). My working copy diverges more and more from the master and hence it gets more and more annoying to provide self contained patches. Best regards, Joachim From tjarvi at qbang.org Mon May 15 08:27:51 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 May 2006 08:27:51 -0600 (MDT) Subject: [Rxtx] The role of MonitorThread (or the idea behind) In-Reply-To: References: <017B9602-725D-45F9-BB73-3181280AD2AB@buechse.de> Message-ID: On Mon, 15 May 2006, Joachim Buechse wrote: > Hello Doug, > > I agree fully, that locking of the system resource should be > abstracted from the user (programmer). Currently this is already the > case, but I agree it might be nice to extract the code into a > separate class, which uses platform dependent providers to do its job. > > What I described in my email was not targeted at allocating the > system resource, but at handling an already allocated system resource > inside the framework. I agree that it may be possible to combine the > two - however, I would suggest to do this in phase2. > > I can contribute a work over of RXTXPort.java which implements clean > internal locking and proper close behavior (which I would call phase > 1). I could do this this week. > > However I strongly believe that there is little sense in trying to do > this as a series of patches. It will be closer to a rewrite than to a > patch. I have already provided a number of suggested patches via > Bugzilla, but this is quite inconvenient (for me). My working copy > diverges more and more from the master and hence it gets more and > more annoying to provide self contained patches. > For methodical testing purposes (which does go on) the incremental patches are better. I'm lagging behind in bugzilla but thats soon to change (this week). It has just been rather chaotic up until now. I moved, purchased a house, and jumped into the fire of a feature freeze timeframe at a new job. btw, we see the Solaris close issues on 2.8 also. 9 and 10 are fine. I'll work towards making those test results public and allow others to run new rxtx code through them. We had the OK at one point but setting up the environment is involved. It isn't just a collection of java classes. -- Trent Jarvi tjarvi at qbang.org From mail at willicon.de Tue May 16 02:01:47 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:01:47 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] Message-ID: <446986EB.209@willicon.de> Hi, any ideas for my problem? Hans -------- Original-Nachricht -------- Betreff: [Rxtx] Problem under Mac OSX 10.3.9 Datum: Mon, 08 May 2006 18:47:20 +0200 Von: WILLICon Antwort an: RXTX Developers and Users An: RXTX Developers and Users Hi, I use for RXTX for communicate with CyclingComputers. It works good under Win32, Sloaris and Linux but with Mac OSX we have some problems. My users install the Mac OSX serial lib from the actual binary. After starting the program, they get this error message: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Remember, this error comes only under Mac OSX. That is the code for the error: * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); * spInUse = getBundleStr("serialPortInUse"); spFree = getBundleStr("serialPortFree"); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (osName != null && osName.startsWith("mac")) { if (!portId.getName().startsWith("dev/cu.")) { continue; } } if (portId.isCurrentlyOwned()) { serialPortNames.add(portId.getName() + " - " + spInUse); } else { serialPortNames.add(portId.getName() + " - " + spFree); } } } if (serialPortNames.size() == 0) { serialPortNames.add(getBundleStr("serialPortNotFound")); } BTW: The methode isCurrentlyOwned() is not working. I get always the value "false". I can only get the status, while I open the port and catch the exception. Any ideas? Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/b0741c2b/attachment-0004.html From joachim at buechse.de Tue May 16 02:15:08 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 10:15:08 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: Hello Hans, I am using RXTX on OS X for my own project. I do not see the problem you describe. I had some troubles installing it because the current version uses lock files which is non-standard on OS X. I have created a patched version which I currently use. This version does not need to modify user groups and hence does not need an installer. I just pop it in the application directory. If you send me a link where I can download your OSX installer, I will have a quick look. Regards, Joachim On 16.05.2006, at 10:01, WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we > have some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + > spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + > spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always > the value "false". > I can only get the status, while I open the port and catch the > exception. > > Any ideas? > > Hans > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mail at willicon.de Tue May 16 02:26:53 2006 From: mail at willicon.de (WILLICon) Date: Tue, 16 May 2006 10:26:53 +0200 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: References: <446986EB.209@willicon.de> Message-ID: <44698CCD.7050709@willicon.de> Joachim, tanks for the answer. I'll send You a mail. Hans Joachim Buechse schrieb: > Hello Hans, > > I am using RXTX on OS X for my own project. I do not see the problem > you describe. > > I had some troubles installing it because the current version uses > lock files which is non-standard on OS X. I have created a patched > version which I currently use. This version does not need to modify > user groups and hence does not need an installer. I just pop it in > the application directory. If you send me a link where I can download > your OSX installer, I will have a quick look. > > Regards, > Joachim > > On 16.05.2006, at 10:01, WILLICon wrote: > > >> Hi, >> >> any ideas for my problem? >> >> Hans >> >> -------- Original-Nachricht -------- >> Betreff: [Rxtx] Problem under Mac OSX 10.3.9 >> Datum: Mon, 08 May 2006 18:47:20 +0200 >> Von: WILLICon >> Antwort an: RXTX Developers and Users >> An: RXTX Developers and Users >> >> >> Hi, >> >> I use for RXTX for communicate with CyclingComputers. >> >> It works good under Win32, Sloaris and Linux but with Mac OSX we >> have some problems. >> >> My users install the Mac OSX serial lib from the actual binary. >> >> After starting the program, they get this error message: >> >> java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while >> loading gnu.io.RXTXCommDriver >> >> Remember, this error comes only under Mac OSX. >> >> That is the code for the error: >> >> Enumeration portList = CommPortIdentifier.getPortIdentifiers(); >> spInUse = getBundleStr("serialPortInUse"); >> spFree = getBundleStr("serialPortFree"); >> while (portList.hasMoreElements()) { >> CommPortIdentifier portId = (CommPortIdentifier) >> portList.nextElement(); >> if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { >> if (osName != null && osName.startsWith("mac")) { >> if (!portId.getName().startsWith("dev/cu.")) { >> continue; >> } >> } >> if (portId.isCurrentlyOwned()) { >> serialPortNames.add(portId.getName() + " - " + >> spInUse); >> } >> else { >> serialPortNames.add(portId.getName() + " - " + >> spFree); >> } >> } >> } >> if (serialPortNames.size() == 0) { >> serialPortNames.add(getBundleStr("serialPortNotFound")); >> } >> >> BTW: The methode isCurrentlyOwned() is not working. I get always >> the value "false". >> I can only get the status, while I open the port and catch the >> exception. >> >> Any ideas? >> >> Hans >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/948333be/attachment-0004.html From jredman at ergotech.com Tue May 16 07:35:52 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 16 May 2006 07:35:52 -0600 Subject: [Rxtx] [Fwd: Problem under Mac OSX 10.3.9] In-Reply-To: <446986EB.209@willicon.de> References: <446986EB.209@willicon.de> Message-ID: <4469D538.6070408@ergotech.com> Hans, I have no direct insight, but would note that what you have is a "NoClassDefFoundError" not a "ClassNotFoundException". So the class javax/comm/CommDriver is found, but one of its dependencies is missing. NoClassDefFoundError are a bigger problem to resolve because you get no indication of the real problem. Jim WILLICon wrote: > Hi, > > any ideas for my problem? > > Hans > > -------- Original-Nachricht -------- > Betreff: [Rxtx] Problem under Mac OSX 10.3.9 > Datum: Mon, 08 May 2006 18:47:20 +0200 > Von: WILLICon > Antwort an: RXTX Developers and Users > An: RXTX Developers and Users > > > > Hi, > > I use for RXTX for communicate with CyclingComputers. > > It works good under Win32, Sloaris and Linux but with Mac OSX we have > some problems. > > My users install the Mac OSX serial lib from the actual binary. > > After starting the program, they get this error message: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while > loading gnu.io.RXTXCommDriver > > Remember, this error comes only under Mac OSX. > > That is the code for the error: > > * Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > * spInUse = getBundleStr("serialPortInUse"); > spFree = getBundleStr("serialPortFree"); > while (portList.hasMoreElements()) { > CommPortIdentifier portId = (CommPortIdentifier) > portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (osName != null && osName.startsWith("mac")) { > if (!portId.getName().startsWith("dev/cu.")) { > continue; > } > } > if (portId.isCurrentlyOwned()) { > serialPortNames.add(portId.getName() + " - " + spInUse); > } > else { > serialPortNames.add(portId.getName() + " - " + spFree); > } > } > } > if (serialPortNames.size() == 0) { > serialPortNames.add(getBundleStr("serialPortNotFound")); > } > > BTW: The methode isCurrentlyOwned() is not working. I get always the > value "false". > I can only get the status, while I open the port and catch the exception. > > Any ideas? > > Hans > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From joachim at buechse.de Tue May 16 08:01:21 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 16 May 2006 16:01:21 +0200 Subject: [Rxtx] Problem under Mac OSX 10.3.9 In-Reply-To: <4469AFC3.6000002@willicon.de> References: <44698EBC.8000008@willicon.de> <8C5680C4-E2BA-42FF-B221-36E1124FA6A4@buechse.de> <4469AFC3.6000002@willicon.de> Message-ID: <9825A602-D6ED-4C28-BF33-9A7C984FACD5@buechse.de> Hallo Hans, you include RXTX 2.17 in your "bikeXexperience.jar" (2.17 uses Interfaces from gnu.io.* not javax.comm.*). Now inspect your error log closely: The class gnu.io.RXTXCommDriver tries to load javax.comm.CommDriver: this is only the case for RXTX 2.07. I assume, that the user has installed Version 2.07 into one of the java.ext.dirs . The VM always tries to load classes from the "system" path first. The current Mac installer distributed with RXTX in fact installs RXTXcomm.jar and librxtxSerial.jnilib into /Library/Java/Extensions. (I wrote some time ago that I consider this as a bad idea because of potential version conflicts-> thanks for delivering the example). For 2.07 it does so without installing the javax.comm classes it seems. I would recommend that you instruct your users to install version 2.17 only. Until RXTX is changed to use TIOCEXCL instead of lock files, you can hardly avoid the installer, as the user needs to be added to a special group and a lockfile directory needs be created. More precisely you are waiting for: http://bugzilla.qbang.org/show_bug.cgi?id=50 [RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL)] Regards, Joachim -------------- next part -------------- A non-text attachment was scrubbed... Name: log.tiff Type: image/tiff Size: 38394 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060516/e3e52128/log-0004.tiff -------------- next part -------------- > > Ich verwende RXTX 2.17. Das orginal RXTXcomm.jar ist in > CyclingDataManager.jar enthalten. > From tjarvi at qbang.org Wed May 17 23:18:15 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 May 2006 23:18:15 -0600 (MDT) Subject: [Rxtx] update Message-ID: So we have several patches and these have stacked up. I'd like to thank everyone for being patient. Tests for the most intrusive patches look good so far. I still have to get some bits together on my end but it looks like we can catch everything up in CVS this week. I'll try to post a normal list of what went in by whom with links Saturday. But I'm not seeing anything that raises flags yet. I also think I'll be able to submit a patch for nonstandard baud rates. I have to confirm w32 but I think its going to be a one line fix. I don't know if its bugzilla or people tinkering with patch files before submitting but patches are not applying cleanly. So the patches have to be done by hand. This may make things difficult for people hoping to add other patches on top. I'm trying to make that go well but ... -- Trent Jarvi tjarvi at qbang.org From joachim at buechse.de Thu May 18 02:23:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 May 2006 10:23:47 +0200 Subject: [Rxtx] update In-Reply-To: References: Message-ID: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Hello Trent, in fact I tinkered with the patches (never used this mechanism before, usually I "communicate" via cvs) ... so sorry for any trouble you had applying them. Basicly I edited the patches to make them self contained. Having the tests run with different speeds on different platforms, may well be an effect of caching. I have seen quite interesting propagation delays for the closing flag on my PowerPC system, which makes me doubt, that the propagation of output_buffer_empty_flag works as it should. Maybe the communication mechanism between the two threads should be replaced by something like pthread_cond_*. Could you describe which problems you see on Solaris/SPARC? I'd be interested to see if they exist on OS X (PowerPC) as well... As you seem to work on the stuff at the moment I would like to suggest the following additions (it looks more than it is, I posted some context to make clear where to apply the change). See the comments in braces for what was changed Greetings, Joachim (1) The end of the drain loop could be: --- report("drain_loop: received EINTR in tcdrain\n"); --- (added "in tcdrain" to make debug output clearer) (2) The start of the drain loop should be: --- for(i=0;;i++) { report_verbose("drain_loop: looping\n"); #if defined(__sun__) /* FIXME: No time to test on all OS's for production */ if( eis->eventloop_interrupted ) { goto end; } if (usleep(5000)) { report("drain_loop: received EINTR"); } #else if (usleep(1000000)) { report("drain_loop: received EINTR"); } #endif /* __sun__ */ --- (added a check for "eis->eventloop_interrupted" before the sleep) (3) The end of interrupt_event_loop could (and maybe should) be: --- #if !defined(TIOCSERGETLSR) && !defined(WIN32) /* make sure that the drainloop unblocks from tcdrain */ pthread_kill(index->drain_tid, SIGABRT); /* TODO use wait/join/SIGCHLD/?? instead of sleep? */ usleep(50 * 1000); /* Under normal conditions, SIGABRT will unblock tcdrain. However a non-responding USB device combined with an unclean driver may still block. This is very ugly because it may block the call to close indefinetly. */ if (index->closing != 1) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); index->closing = 1; } #endif report("interruptEventLoop: interrupted\n"); --- (added some comments and pthread_cancel for resisting drain thread) On 18.05.2006, at 07:18, Trent Jarvi wrote: > > So we have several patches and these have stacked up. I'd like to > thank > everyone for being patient. > > Tests for the most intrusive patches look good so far. I still > have to > get some bits together on my end but it looks like we can catch > everything > up in CVS this week. > > I'll try to post a normal list of what went in by whom with links > Saturday. But I'm not seeing anything that raises flags yet. I also > think I'll be able to submit a patch for nonstandard baud rates. > I have > to confirm w32 but I think its going to be a one line fix. > > I don't know if its bugzilla or people tinkering with patch files > before > submitting but patches are not applying cleanly. So the patches > have to > be done by hand. This may make things difficult for people hoping > to add > other patches on top. I'm trying to make that go well but ... > > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Thu May 18 22:28:00 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 18 May 2006 22:28:00 -0600 (MDT) Subject: [Rxtx] update In-Reply-To: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> References: <15DAC93C-069B-4B78-AF5F-B8B7BB4BECB8@buechse.de> Message-ID: On Thu, 18 May 2006, Joachim Buechse wrote: > Hello Trent, > > in fact I tinkered with the patches (never used this mechanism > before, usually I "communicate" via cvs) ... so sorry for any trouble > you had applying them. Basicly I edited the patches to make them self > contained. I think we are close to moving towards that. > > Having the tests run with different speeds on different platforms, > may well be an effect of caching. I have seen quite interesting > propagation delays for the closing flag on my PowerPC system, which > makes me doubt, that the propagation of output_buffer_empty_flag > works as it should. Maybe the communication mechanism between the two > threads should be replaced by something like pthread_cond_*. Could > you describe which problems you see on Solaris/SPARC? I'd be > interested to see if they exist on OS X (PowerPC) as well... This is interesting. I have seen problems with output buffer empty in applications that require it. I'm trying to get a bug list and or test results open for everyone to see but that may take time. But missed output buffer events ... yep. With Sparc, we have seen a few things. One was a kernel race condition that went away when we reimaged and updated 2.8. RXTX was hanging on close, top showed no cpu use but there was 2 second delays just typing on console. The other is our tests now take ~4 times longer on Solaris. Someone is looking at timing just open, close, read, write, ... to see if they can find where the slowdown is. This happened after solaris 2.8. I'll try to share more when/if there is something interesting. This may well not be solvable in userland. > > As you seem to work on the stuff at the moment I would like to > suggest the following additions (it looks more than it is, I posted > some context to make clear where to apply the change). See the > comments in braces for what was changed I'll take a look. This could all come together Saturday but I also have an event to attend that day. I may not wrap this up until Sunday. -- Trent Jarvi tjarvi at qbang.org From andrewlord at internode.on.net Sun May 21 20:10:02 2006 From: andrewlord at internode.on.net (Andrew Lord) Date: Mon, 22 May 2006 11:40:02 +0930 Subject: [Rxtx] Kernel include files do not match kernel Message-ID: <200605221140.03271.andrewlord@internode.on.net> Hi, I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel 2.6.12-18 with the command: ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include However I get the message: ## checking java.version 1.5.0_06 ## checking os.version 2.6.12-18mdk ## ## WARNING: Kernel include files do not match the current kernel ## ## configure: creating ./config.status etc. Is there a problem with the way I'm specifying the 'include' directory ? If not, how else can I specify the correct directory for the include files please ? Cheers, Andrew From tjarvi at qbang.org Sun May 21 20:31:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 May 2006 20:31:31 -0600 (MDT) Subject: [Rxtx] Kernel include files do not match kernel In-Reply-To: <200605221140.03271.andrewlord@internode.on.net> References: <200605221140.03271.andrewlord@internode.on.net> Message-ID: On Mon, 22 May 2006, Andrew Lord wrote: > Hi, > > I have been attempting to correctly configure rxtx-2.1.7-rc2 on kernel > 2.6.12-18 with the command: > > ./configure --with-kernel=/usr/src/linux-2.6.12-18mdk > CPPFLAGS=-I/usr/src/linux-2.6.12-18mdk/include > > However I get the message: > > ## checking java.version 1.5.0_06 > ## checking os.version 2.6.12-18mdk > ## > ## WARNING: Kernel include files do not match the current kernel > ## > ## configure: creating ./config.status > etc. > > Is there a problem with the way I'm specifying the 'include' directory ? If > not, how else can I specify the correct directory for the include files > please ? > Hi Andrew I'm fairly sure your --with-kernel option does nothing. The CPPFLAGS should do what you want. Maybe put an #error message in /usr/src/linux.../incude/linux/version.h But I don't recall a recent problem with version missmatches. It should work. Distros will even ship include files that don't match versions exactly. In theory it should never matter for users. I used to compile new kernels by hand and really didnt have a distro. I didnt have a seperate package of kernel headers for users (myself). When changing a gateway from linux 1.2.12 to 2.1.77, I would worry about such messages. So if you are doing something that weird, the message may be of use to you. If you just see the message on a distro you installed, it is more than likely harmless. -- Trent Jarvi tjarvi at qbang.org From mrogers at spro.net Mon May 22 14:45:39 2006 From: mrogers at spro.net (Mike Rogers) Date: Mon, 22 May 2006 14:45:39 -0600 Subject: [Rxtx] Sun's CommAPI -- think May? Message-ID: <447222F3.9040302@spro.net> Hi, Any word from Sun about progress towards fixing the Java CommAPI v3 "incompatibilities" so RXTX 2.0 can operate within the framework's namespace (javax.comm)? I recall mention of a May time frame. Thanks, Mike From paul.klissner at sun.com Mon May 22 15:09:27 2006 From: paul.klissner at sun.com (Paul Klissner) Date: Mon, 22 May 2006 14:09:27 -0700 Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <447222F3.9040302@spro.net> References: <447222F3.9040302@spro.net> Message-ID: <44722887.8080308@sun.com> Mike Rogers wrote: > Hi, > > Any word from Sun about progress towards fixing the Java CommAPI v3 > "incompatibilities" so RXTX 2.0 can operate within the framework's > namespace (javax.comm)? I recall mention of a May time frame. > > Thanks, > > Mike > We've had a lot of work come in. This hasn't been the only priority. I'm running behind the plan in addressing this, but will be looking at it again soon. Rather than state a new, I'll just say it is in progress, and not off the table. I'll get this fixed as soon as I can. Good timing for asking as we just started discussing javax.comm plans today, and I'll have some cycles to work on it soon. Paul From yhua537 at cse.unsw.edu.au Mon May 22 16:03:05 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Tue, 23 May 2006 08:03:05 +1000 (EST) Subject: [Rxtx] install rxtx in XP Message-ID: Hi Guys, I am new to serial port programming, and have no experience on programming java in xp, but my project require me to builld a communication link between xp and a UART device. Most of the information in the web site seems for linux only. including the commands such as export and chmod. How do I install rxtx in xp? cheers YiQi Huang From mark at mdsh.com Tue May 23 01:24:20 2006 From: mark at mdsh.com (Mark Himsley) Date: Tue, 23 May 2006 08:24:20 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off , it includes DLLs for Windows and the JAR for Java. Follow the Windows instructions in the INSTALL. ie RXTXcomm.jar goes in \jre\lib\ext (under java) rxtxSerial.dll goes in \jre\bin So, assuming a fairly standard Java install, copy RXTXcomm.jar into C:\Program Files\Java\jre1.5.0_06\lib\ext and copy rxtxSerial.dll into C:\Program Files\Java\jre1.5.0_06\bin Yes, it really is that simple. On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > I am new to serial port programming, and have no experience on > programming java in xp, but my project require me to builld a > communication link between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang -- Mark Himsley From joachim at buechse.de Tue May 23 02:51:47 2006 From: joachim at buechse.de (Joachim Buechse) Date: Tue, 23 May 2006 10:51:47 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) Unless it is absolutely required you should NOT install RXTX in your global Java Runtime Environment. This will for sure create versioning conflicts - if not now, than in the future, if not on your system than at your clients. Instead put the dll in your application directory and include the RXTXcomm.jar in your classpath. This is much safer and not a bit more complicated. Regards, Joachim On 23.05.2006, at 09:24, Mark Himsley wrote: > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR > for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > >> I am new to serial port programming, and have no experience on >> programming java in xp, but my project require me to builld a >> communication link between xp and a UART device. >> >> Most of the information in the web site seems for linux only. >> including >> the commands such as export and chmod. How do I install rxtx in xp? >> >> cheers >> YiQi Huang > > > > -- > Mark Himsley > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tod at todbot.com Tue May 23 03:12:22 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 02:12:22 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: I totally agree: do not contaminate the Java installation. I put all the RXTX files in a directory and then change my java invocation to be: % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* Alternatively, use Launch4J to create a double-clickable application and keep the RXTX libraries in the directory of the application. -=tod On May 23, 2006, at 1:51 AM, Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > >> Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off >> , it includes DLLs for Windows and the JAR >> for Java. >> >> Follow the Windows instructions in the INSTALL. >> >> ie >> >> RXTXcomm.jar goes in \jre\lib\ext (under java) >> rxtxSerial.dll goes in \jre\bin >> >> So, assuming a fairly standard Java install, copy RXTXcomm.jar into >> C:\Program Files\Java\jre1.5.0_06\lib\ext >> and copy rxtxSerial.dll into >> C:\Program Files\Java\jre1.5.0_06\bin >> >> Yes, it really is that simple. >> >> >> >> On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: >> >>> I am new to serial port programming, and have no experience on >>> programming java in xp, but my project require me to builld a >>> communication link between xp and a UART device. >>> >>> Most of the information in the web site seems for linux only. >>> including >>> the commands such as export and chmod. How do I install rxtx in xp? >>> >>> cheers >>> YiQi Huang >> >> >> >> -- >> Mark Himsley >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From smontgomery at mediaspansoftware.com Tue May 23 08:46:53 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Tue, 23 May 2006 10:46:53 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: Message-ID: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Joachim and Tod mentioned how to keep the files RXTX requires on Windows XP out of the Java installations - thanks gentlemen! Are there similar suggestions for an RXTX install on OS X? The current "canonical" OS X installation instructions "contaminate the Java installation", to use Tod's words. Our app will run fine under 1.4.2 and 5.0 on OS X, and a lot of users will have both. We've already been burned by the recent switch from 1.4.2 to 5.0 as the platform default. Any suggestions welcomed. From tod at todbot.com Tue May 23 13:27:55 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 12:27:55 -0700 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <9BA0F670-A862-42E7-BB2C-130D775ABDF9@todbot.com> Hi Sean, It depends on how you build and deploy your code. If you're using shell scripts, you can do something like this: #!/bin/sh # pick one JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/ Commands/java #JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/ Commands/java $JAVA -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* That both picks which VM to use and uses the RXTX in the directory called 'rxtxlib'. If you want your shell script to be clever, you could test for the existence of the different 'java' executables and go from there (maybe even use different jar files). I am almost positive all OS X systems with Java 1.5 are guaranteed to also have Java 1.4.2. If you're using Jar Builder or XCode, you can specify which JVM to use and add the extra args in the Info.plist file. The paths specified in the 'java' invocation then are based off of the $JAVAROOT variable that the JavaApplicationStub sets for you. For my app, I've have been compiling two sets of jars, one compiled with 1.4.2 and one with 1.5, but they both run under 1.5. So I have a similar shell script that chooses a different 'javac' depending on the need. -=tod On May 23, 2006, at 7:46 AM, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From yhua537 at cse.unsw.edu.au Tue May 23 11:09:37 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 03:09:37 +1000 (EST) Subject: [Rxtx] install rxtx in XP (Mark Himsley, Joachim Buechse, Tod E. Kurt> In-Reply-To: References: Message-ID: > Message: 8 > Date: Tue, 23 May 2006 08:03:05 +1000 (EST) > From: YiQi Huang > Subject: [Rxtx] install rxtx in XP > To: rxtx at qbang.org > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > Hi Guys, > > I am new to serial port programming, and have no experience on programming > java in xp, but my project require me to builld a communication link > between xp and a UART device. > > Most of the information in the web site seems for linux only. including > the commands such as export and chmod. How do I install rxtx in xp? > > cheers > YiQi Huang > > > ------------------------------ > > Message: 9 > Date: Tue, 23 May 2006 08:24:20 +0100 > From: Mark Himsley > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=us-ascii; format=flowed > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > , it includes DLLs for Windows and the JAR for Java. > > Follow the Windows instructions in the INSTALL. > > ie > > RXTXcomm.jar goes in \jre\lib\ext (under java) > rxtxSerial.dll goes in \jre\bin > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > C:\Program Files\Java\jre1.5.0_06\lib\ext > and copy rxtxSerial.dll into > C:\Program Files\Java\jre1.5.0_06\bin > > Yes, it really is that simple. > > > ------------------------------ > > Message: 10 > Date: Tue, 23 May 2006 10:51:47 +0200 > From: Joachim Buechse > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > > ------------------------------ > > Message: 11 > Date: Tue, 23 May 2006 02:12:22 -0700 > From: "Tod E. Kurt" > Subject: Re: [Rxtx] install rxtx in XP > To: RXTX Developers and Users > Message-ID: > Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed > > I totally agree: do not contaminate the Java installation. > > I put all the RXTX files in a directory and then change my java > invocation to be: > > % java -Djava.library.path=rxtxlib -classpath .:rxtxlib/RXTXcomm.jar $* > > Alternatively, use Launch4J to create a double-clickable application > and keep the RXTX libraries in the directory of the application. > > -=tod > > Hi, Thanks guys, I don't know if this is the correct way to reply your mecessage, if wrong, please point out. Thank you for Mark to give the detail instructions and Joachim to point out the cons ot installing in the java directory, and specially thanks for Tod to give the instrection in detail. Sorry to ask another stupid question: I have followed Tod's instruction. Now I think i am ready to start hacking. But where is the RXTX API documentation? Is it the same as using normal java comm API? btw, where could i find some examples to start with? Thanks very much cheers YiQi Huang From tjarvi at qbang.org Tue May 23 16:09:32 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 May 2006 16:09:32 -0600 (MDT) Subject: [Rxtx] Sun's CommAPI -- think May? In-Reply-To: <44722887.8080308@sun.com> References: <447222F3.9040302@spro.net> <44722887.8080308@sun.com> Message-ID: > Good timing for asking as we just started discussing javax.comm plans > today, and I'll have some cycles to work on it soon. Hi Paul I assume you mean Sun is discussing plans concerning its own internal actions and there is no community involvment at this point. -- Trent Jarvi tjarvi at qbang.org From yhua537 at cse.unsw.edu.au Tue May 23 22:50:01 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 14:50:01 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } From mmester at sps.edu Tue May 23 22:58:21 2006 From: mmester at sps.edu (Michael Mester) Date: Wed, 24 May 2006 00:58:21 -0400 Subject: [Rxtx] install rxtx in XP References: Message-ID: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below -----Original Message----- From: rxtx-bounces at qbang.org on behalf of YiQi Huang Sent: Wed 5/24/2006 12:50 AM To: RXTX Developers and Users Subject: Re: [Rxtx] install rxtx in XP Hi, Sorry guys.I follow Tod's instruction, and here is what i did: put RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll in C:\RXTX_files and I got a SimpleRead class attached below, compile it with : javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java it still saying "cannot find symbol". Is there anything I did wrong? Do I need the comm.jar from Sun? Thanks & regards YiQi Huang //////////////////////////////////////////////////////// // SimpleRead.java //////////////////////////////////////////////////////// import java.io.*; import java.util.*; import javax.comm.*; public class SimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals("COM1")) { //if (portId.getName().equals("/dev/term/a")) { SimpleRead reader = new SimpleRead(); } } } } public SimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { switch(event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3950 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20060523/b36d0c63/attachment-0004.bin From yhua537 at cse.unsw.edu.au Tue May 23 23:05:50 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 15:05:50 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: Yes, Michael you are right, it should be semicolons, But it still can't find the correct library. On Wed, 24 May 2006, Michael Mester wrote: > I believe the entries in the classpath need to be seperated with semicolons, not a colon as you have in your command below > > > -----Original Message----- > From: rxtx-bounces at qbang.org on behalf of YiQi Huang > Sent: Wed 5/24/2006 12:50 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] install rxtx in XP > > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > cheers YiQi Huang From tod at todbot.com Wed May 24 00:01:57 2006 From: tod at todbot.com (Tod E. Kurt) Date: Tue, 23 May 2006 23:01:57 -0700 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> Message-ID: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Yes, sorry, classpath entries are semicolon-separated on Windows and colon-separated on everything else. Your example code below is importing the wrong set of classes. It should not "import javax.comm.*", instead it should "import gnu.io.*". When I make that change, your example program compiles. The "javax.comm" package is the one released by Sun, the "gnu.io" package is the RXTX one. You might've seen some discussion that the two will be merged or become compatible, but that hasn't happened yet. -=tod On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > > Yes, Michael you are right, it should be semicolons, But it still > can't > find the correct library. > > On Wed, 24 May 2006, Michael Mester wrote: > >> I believe the entries in the classpath need to be seperated with >> semicolons, not a colon as you have in your command below >> >> >> -----Original Message----- >> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >> Sent: Wed 5/24/2006 12:50 AM >> To: RXTX Developers and Users >> Subject: Re: [Rxtx] install rxtx in XP >> >> Hi, >> >> Sorry guys.I follow Tod's instruction, and here is what i did: >> >> put >> RXTXcomm.jar, >> rxtxParallel.dll, >> rxtxSerial.dll >> in >> C:\RXTX_files >> >> and I got a SimpleRead class attached below, compile it with : >> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >> it still saying "cannot find symbol". >> >> Is there anything I did wrong? Do I need the comm.jar from Sun? >> >> Thanks & regards >> YiQi Huang >> >> >> //////////////////////////////////////////////////////// >> // SimpleRead.java >> //////////////////////////////////////////////////////// >> >> import java.io.*; >> import java.util.*; >> import javax.comm.*; >> >> public class SimpleRead >> implements Runnable, SerialPortEventListener { >> static CommPortIdentifier portId; >> static Enumeration portList; >> InputStream inputStream; >> SerialPort serialPort; >> Thread readThread; >> public static void main(String[] args) { >> portList = CommPortIdentifier.getPortIdentifiers(); >> while (portList.hasMoreElements()) { >> portId = (CommPortIdentifier) portList.nextElement(); >> if (portId.getPortType() == >> CommPortIdentifier.PORT_SERIAL) { >> if (portId.getName().equals("COM1")) { >> //if (portId.getName().equals("/dev/term/a")) { >> SimpleRead reader = new SimpleRead(); >> } >> } >> } >> } >> public SimpleRead() { >> try { >> serialPort = (SerialPort) portId.open("SimpleReadApp", >> 2000); >> } catch (PortInUseException e) {} >> try { >> inputStream = serialPort.getInputStream(); >> } catch (IOException e) {} >> try { >> serialPort.addEventListener(this); >> } catch (TooManyListenersException e) {} >> serialPort.notifyOnDataAvailable(true); >> try { >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, >> SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> } catch (UnsupportedCommOperationException e) {} >> readThread = new Thread(this); >> readThread.start(); >> } >> public void run() { >> try { >> Thread.sleep(20000); >> } catch (InterruptedException e) {} >> } >> public void serialEvent(SerialPortEvent event) { >> switch(event.getEventType()) { >> case SerialPortEvent.BI: >> case SerialPortEvent.OE: >> case SerialPortEvent.FE: >> case SerialPortEvent.PE: >> case SerialPortEvent.CD: >> case SerialPortEvent.CTS: >> case SerialPortEvent.DSR: >> case SerialPortEvent.RI: >> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >> break; >> case SerialPortEvent.DATA_AVAILABLE: >> byte[] readBuffer = new byte[20]; >> try { >> while (inputStream.available() > 0) { >> int numBytes = inputStream.read(readBuffer); >> } >> System.out.print(new String(readBuffer)); >> } catch (IOException e) {} >> break; >> } >> } >> } >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > cheers > YiQi Huang > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From joachim at buechse.de Wed May 24 00:10:06 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:10:06 +0200 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> Message-ID: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Hi Sean, my preferred way of dealing with RXTX on OS X is to include the RXTX classes into my application jar and to put the RXTX lib in the same directory as this jar. To make it even more comfortable, you can include the lib in the jar and have some startup code extract it and write it to a temporary file from which you load it with System.load(). Unfortunately the current version of RXTX for OS X requires tinkering with user groups as it is based on lockfiles - and hence it needs the RXTX OS X installer or you need to duplicated this functionality in your own installer. I have created my own native version which is not based on lockfiles but tty locking (the standard way to do it on OSX). I hope that these patches will be integrated soon into the distribution. Regards, Joachim On 23.05.2006, at 16:46, Sean Montgomery wrote: > Joachim and Tod mentioned how to keep the files RXTX requires on > Windows XP out of the Java installations - thanks gentlemen! Are > there similar suggestions for an RXTX install on OS X? The current > "canonical" OS X installation instructions "contaminate the Java > installation", to use Tod's words. Our app will run fine under 1.4.2 > and 5.0 on OS X, and a lot of users will have both. We've already > been burned by the recent switch from 1.4.2 to 5.0 as the platform > default. > > Any suggestions welcomed. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From joachim at buechse.de Wed May 24 00:16:12 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 24 May 2006 08:16:12 +0200 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <7017ECFC-B13E-4806-B321-9FFCAC5830F0@buechse.de> I assume you downloaded rxtx-217 (not 207). Instead of importing javax.comm.* you must import gnu.io.* The classes have the same name, but they are not in the same package. On 24.05.2006, at 06:50, YiQi Huang wrote: > Hi, > > Sorry guys.I follow Tod's instruction, and here is what i did: > > put > RXTXcomm.jar, > rxtxParallel.dll, > rxtxSerial.dll > in > C:\RXTX_files > > and I got a SimpleRead class attached below, compile it with : > javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java > it still saying "cannot find symbol". > > Is there anything I did wrong? Do I need the comm.jar from Sun? > > Thanks & regards > YiQi Huang > > > //////////////////////////////////////////////////////// > // SimpleRead.java > //////////////////////////////////////////////////////// > > import java.io.*; > import java.util.*; > import javax.comm.*; > > public class SimpleRead > implements Runnable, SerialPortEventListener { > static CommPortIdentifier portId; > static Enumeration portList; > InputStream inputStream; > SerialPort serialPort; > Thread readThread; > public static void main(String[] args) { > portList = CommPortIdentifier.getPortIdentifiers(); > while (portList.hasMoreElements()) { > portId = (CommPortIdentifier) portList.nextElement(); > if (portId.getPortType() == > CommPortIdentifier.PORT_SERIAL) { > if (portId.getName().equals("COM1")) { > //if (portId.getName().equals("/dev/term/a")) { > SimpleRead reader = new SimpleRead(); > } > } > } > } > public SimpleRead() { > try { > serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > } catch (PortInUseException e) {} > try { > inputStream = serialPort.getInputStream(); > } catch (IOException e) {} > try { > serialPort.addEventListener(this); > } catch (TooManyListenersException e) {} > serialPort.notifyOnDataAvailable(true); > try { > serialPort.setSerialPortParams(9600, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > } catch (UnsupportedCommOperationException e) {} > readThread = new Thread(this); > readThread.start(); > } > public void run() { > try { > Thread.sleep(20000); > } catch (InterruptedException e) {} > } > public void serialEvent(SerialPortEvent event) { > switch(event.getEventType()) { > case SerialPortEvent.BI: > case SerialPortEvent.OE: > case SerialPortEvent.FE: > case SerialPortEvent.PE: > case SerialPortEvent.CD: > case SerialPortEvent.CTS: > case SerialPortEvent.DSR: > case SerialPortEvent.RI: > case SerialPortEvent.OUTPUT_BUFFER_EMPTY: > break; > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[20]; > try { > while (inputStream.available() > 0) { > int numBytes = inputStream.read(readBuffer); > } > System.out.print(new String(readBuffer)); > } catch (IOException e) {} > break; > } > } > } > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From yhua537 at cse.unsw.edu.au Wed May 24 00:17:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 24 May 2006 16:17:45 +1000 (EST) Subject: [Rxtx] install rxtx in XP In-Reply-To: <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> References: <747DA8B134EE5842A336AA9F1AA379EAC06105@PELICAN3.spsnet.sps.edu> <27FDB777-F9C3-446F-B868-7D41A9AC63F8@todbot.com> Message-ID: Thanks Tod again, i kept reading "gnu.io.*" as "gun.io.*" last few hours after i read some commons from web. Thanks very much Tod. thanks YiQi Huang On Tue, 23 May 2006, Tod E. Kurt wrote: > Yes, sorry, classpath entries are semicolon-separated on Windows and > colon-separated on everything else. > > Your example code below is importing the wrong set of classes. It > should not "import javax.comm.*", instead it should "import > gnu.io.*". When I make that change, your example program compiles. > The "javax.comm" package is the one released by Sun, the "gnu.io" > package is the RXTX one. You might've seen some discussion that the > two will be merged or become compatible, but that hasn't happened yet. > > -=tod > > > On May 23, 2006, at 10:05 PM, YiQi Huang wrote: > >> >> Yes, Michael you are right, it should be semicolons, But it still >> can't >> find the correct library. >> >> On Wed, 24 May 2006, Michael Mester wrote: >> >>> I believe the entries in the classpath need to be seperated with >>> semicolons, not a colon as you have in your command below >>> >>> >>> -----Original Message----- >>> From: rxtx-bounces at qbang.org on behalf of YiQi Huang >>> Sent: Wed 5/24/2006 12:50 AM >>> To: RXTX Developers and Users >>> Subject: Re: [Rxtx] install rxtx in XP >>> >>> Hi, >>> >>> Sorry guys.I follow Tod's instruction, and here is what i did: >>> >>> put >>> RXTXcomm.jar, >>> rxtxParallel.dll, >>> rxtxSerial.dll >>> in >>> C:\RXTX_files >>> >>> and I got a SimpleRead class attached below, compile it with : >>> javac -classpath .:C:\RXTX_files\RXTXcomm.jar SimpleRead.java >>> it still saying "cannot find symbol". >>> >>> Is there anything I did wrong? Do I need the comm.jar from Sun? >>> >>> Thanks & regards >>> YiQi Huang >>> >>> >>> //////////////////////////////////////////////////////// >>> // SimpleRead.java >>> //////////////////////////////////////////////////////// >>> >>> import java.io.*; >>> import java.util.*; >>> import javax.comm.*; >>> >>> public class SimpleRead >>> implements Runnable, SerialPortEventListener { >>> static CommPortIdentifier portId; >>> static Enumeration portList; >>> InputStream inputStream; >>> SerialPort serialPort; >>> Thread readThread; >>> public static void main(String[] args) { >>> portList = CommPortIdentifier.getPortIdentifiers(); >>> while (portList.hasMoreElements()) { >>> portId = (CommPortIdentifier) portList.nextElement(); >>> if (portId.getPortType() == >>> CommPortIdentifier.PORT_SERIAL) { >>> if (portId.getName().equals("COM1")) { >>> //if (portId.getName().equals("/dev/term/a")) { >>> SimpleRead reader = new SimpleRead(); >>> } >>> } >>> } >>> } >>> public SimpleRead() { >>> try { >>> serialPort = (SerialPort) portId.open("SimpleReadApp", >>> 2000); >>> } catch (PortInUseException e) {} >>> try { >>> inputStream = serialPort.getInputStream(); >>> } catch (IOException e) {} >>> try { >>> serialPort.addEventListener(this); >>> } catch (TooManyListenersException e) {} >>> serialPort.notifyOnDataAvailable(true); >>> try { >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, >>> SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> } catch (UnsupportedCommOperationException e) {} >>> readThread = new Thread(this); >>> readThread.start(); >>> } >>> public void run() { >>> try { >>> Thread.sleep(20000); >>> } catch (InterruptedException e) {} >>> } >>> public void serialEvent(SerialPortEvent event) { >>> switch(event.getEventType()) { >>> case SerialPortEvent.BI: >>> case SerialPortEvent.OE: >>> case SerialPortEvent.FE: >>> case SerialPortEvent.PE: >>> case SerialPortEvent.CD: >>> case SerialPortEvent.CTS: >>> case SerialPortEvent.DSR: >>> case SerialPortEvent.RI: >>> case SerialPortEvent.OUTPUT_BUFFER_EMPTY: >>> break; >>> case SerialPortEvent.DATA_AVAILABLE: >>> byte[] readBuffer = new byte[20]; >>> try { >>> while (inputStream.available() > 0) { >>> int numBytes = inputStream.read(readBuffer); >>> } >>> System.out.print(new String(readBuffer)); >>> } catch (IOException e) {} >>> break; >>> } >>> } >>> } >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >>> >>> >> >> cheers >> YiQi Huang >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From smontgomery at mediaspansoftware.com Wed May 24 10:24:13 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 12:24:13 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: Tod & Joachim, Thanks for the info, that's very helpful. I'll give that a whirl when I move to rxtx 2.1. I'm still using the older 2.0.7 version for now (don't ask), which probably requires the Sun comm.jar, javax.comm.properties and librxtxSerial.jnilib to be in very specific places in each jvm's file hierarchy. From tjarvi at qbang.org Wed May 24 11:59:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 11:59:16 -0600 (MDT) Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: On Wed, 24 May 2006, Sean Montgomery wrote: > Tod & Joachim, > > Thanks for the info, that's very helpful. I'll give that a whirl > when I move to rxtx 2.1. I'm still using the older 2.0.7 version for > now (don't ask), which probably requires the Sun comm.jar, > javax.comm.properties and librxtxSerial.jnilib to be in very specific > places in each jvm's file hierarchy. > You will need comm.jar from Sun then. It must be Sun's version 2.* or older for Linux or Solaris. I assume they have this in download archives. The default offering from Sun is version 3.0. This version currently does not support rxtx. The older version will probably be fine for your needs. -- Trent Jarvi tjarvi at qbang.org From smontgomery at mediaspansoftware.com Wed May 24 12:19:06 2006 From: smontgomery at mediaspansoftware.com (Sean Montgomery) Date: Wed, 24 May 2006 14:19:06 -0400 Subject: [Rxtx] install on OS X (was: install rxtx in XP) In-Reply-To: References: <6C723901-168D-4A88-AA2E-FE8655EC2624@mediaspansoftware.com> <6FCF9566-2A2B-46A0-B93D-A74F15E65D89@buechse.de> Message-ID: <3939EFB8-11E1-4E3E-A684-5B3C525577CD@mediaspansoftware.com> Yup, that's right, thanks Trent. I've been using these files for quite a while now. Thanks for bringing it up. I almost didn't mention using 2.0.7 because I didn't want to give any new members of the list the wrong idea! :-) On May 24, 2006, at 1:59 PM, Trent Jarvi wrote: > On Wed, 24 May 2006, Sean Montgomery wrote: > >> Tod & Joachim, >> >> Thanks for the info, that's very helpful. I'll give that a whirl >> when I move to rxtx 2.1. I'm still using the older 2.0.7 version for >> now (don't ask), which probably requires the Sun comm.jar, >> javax.comm.properties and librxtxSerial.jnilib to be in very specific >> places in each jvm's file hierarchy. >> > > You will need comm.jar from Sun then. It must be Sun's version 2.* or > older for Linux or Solaris. I assume they have this in download > archives. > > The default offering from Sun is version 3.0. This version > currently does > not support rxtx. > > The older version will probably be fine for your needs. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From mark at mdsh.com Wed May 24 15:55:46 2006 From: mark at mdsh.com (Mark Himsley) Date: Wed, 24 May 2006 22:55:46 +0100 Subject: [Rxtx] install rxtx in XP In-Reply-To: References: Message-ID: <37B0FC4B1F3237321F093ABE@MacMini.local> On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) That's no problem. BUT, do note that the instructions I elaborated on are in the INSTALL file within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone please update the INSTALL file? > Unless it is absolutely required you should NOT install RXTX in your > global Java Runtime Environment. This will for sure create versioning > conflicts - if not now, than in the future, if not on your system > than at your clients. > > Instead put the dll in your application directory and include the > RXTXcomm.jar in your classpath. This is much safer and not a bit more > complicated. > > Regards, > Joachim > > On 23.05.2006, at 09:24, Mark Himsley wrote: > > > Download rxtx-2.1-7-bins-r2.zip from the 'Downloads' page off > > , it includes DLLs for Windows and the JAR > > for Java. > > > > Follow the Windows instructions in the INSTALL. > > > > ie > > > > RXTXcomm.jar goes in \jre\lib\ext (under java) > > rxtxSerial.dll goes in \jre\bin > > > > So, assuming a fairly standard Java install, copy RXTXcomm.jar into > > C:\Program Files\Java\jre1.5.0_06\lib\ext > > and copy rxtxSerial.dll into > > C:\Program Files\Java\jre1.5.0_06\bin > > > > Yes, it really is that simple. > > > > > > > > On 23 May 2006 08:03:05 +1000 YiQi Huang wrote: > > > >> I am new to serial port programming, and have no experience on > >> programming java in xp, but my project require me to builld a > >> communication link between xp and a UART device. > >> > >> Most of the information in the web site seems for linux only. > >> including > >> the commands such as export and chmod. How do I install rxtx in xp? > >> > >> cheers > >> YiQi Huang > > > > > > > > -- > > Mark Himsley > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Mark Himsley From tjarvi at qbang.org Wed May 24 16:41:46 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 24 May 2006 16:41:46 -0600 (MDT) Subject: [Rxtx] install rxtx in XP In-Reply-To: <37B0FC4B1F3237321F093ABE@MacMini.local> References: <37B0FC4B1F3237321F093ABE@MacMini.local> Message-ID: On Wed, 24 May 2006, Mark Himsley wrote: > > > On 23 May 2006 10:51:47 +0200 Joachim Buechse wrote: > >> I would recommend that you DO NOT FOLLOW this advice. (Sorry Mark) > > That's no problem. > > BUT, do note that the instructions I elaborated on are in the INSTALL file > within rxtx-2.1-7-bins-r2.zip. If that is now out of date then can someone > please update the INSTALL file? > > The INSTALL file may be updated by anyone at anytime. http://rxtx.qbang.org/wiki/index.php/Installation We are moving it to the wiki so end users may put the type of answers they would like to see in. Sometimes it's best if developers don't give what appears to be cryptic answers. You can even put in that jre/lib/ext is not the right place but you don't understand the classpath solution mentioned on the mail-list and then we know what to add. -- Trent Jarvi tjarvi at qbang.org From stramit at gmail.com Wed May 24 21:45:31 2006 From: stramit at gmail.com (Tim Cooper) Date: Thu, 25 May 2006 13:45:31 +1000 Subject: [Rxtx] Accessing Virtual Com Port Message-ID: Hi, I have to develop an application that talks to a virtual com port (in this case com3) which translates any messages sent across a USB cable to a micro. Using C++ I can talk to this com port and I know that it is configured, present, and working. For the application that I am trying to write I want to use RXTX for the communication. My problem is that the configured virtual port (in windows) is not showing up when I do an enumeration over the available ports. The output I get is (com 3 is not present) : Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 PORT FOUND: COM1 PORT FOUND: LPT1 Is there anything that I need to do to make com3 available to RXTX and my application? Timothy Cooper -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060524/c5591648/attachment-0004.html From antonio.luis at iscte.pt Thu May 25 01:39:13 2006 From: antonio.luis at iscte.pt (=?ISO-8859-1?Q?Ant=F3nio_Lopes?=) Date: Thu, 25 May 2006 08:39:13 +0100 Subject: [Rxtx] RXTX on Pocket PC Message-ID: <44755F21.8060103@iscte.pt> Hello everyone, I've been using RXTX to communicate with serial ports in Windows and it's been quite successful. However, I'm now considering porting my application from Windows to Pocket PC but I can't seem to find the RXTX binaries (*.jar and *.dll) to use in Pocket PC. I've been "digging" on the mailing list's archives and also on the web and I can't find these anywhere. Can anyone in this mailing list give me some pointers on this? Where can I find the necessary files and basic installation instructions? Thanks very much for your help. I very much appreciate any help that you can provide me. Regards, -- Ant?nio Lopes @contact: antonio.luis at iscte.pt @work: ADETTI - ISCTE @web: http://antonio.lopes.googlepages.com/home From doug at dupreeinc.com Fri May 26 15:45:50 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Fri, 26 May 2006 14:45:50 -0700 Subject: [Rxtx] rxtx slow startup Message-ID: <4477770E.9010400@dupreeinc.com> Hello, I hope there are people still reading this mailing list. The archive appeared to not have anything new after 4/2005. I was using the commapi from sun for a project where a java application reads data from test equipment connected to the serial port. I had to upgrade the ftdi vcp driver on my pc and the old sun commapi no longer works with hardware flow control. as an experiment I replaced the javax.com with gnu.io in the SerialDemo.java project that was included with the commapi. This compiled fine using JBuilder 2006 and JRE 1.5.0_05. RXTX also works with the latest ftdi drivers so life is wonderful again... almost... When using the commapi jar the SerialDemo program starts in about 1 second on my system. Using the RXTX jar it takes over 56 seconds to start. Has anyone else seen this problem? Is there a workaround to get the startup performance close to the old commapi? The last thing printed to the console before this delay is: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Thanks for your time! Doug From yhua537 at cse.unsw.edu.au Sat May 27 05:46:45 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 21:46:45 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <4477770E.9010400@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> Message-ID: hi Doug The archive hasn't been update for a long time, But people certainly still reading the list. I don't have enough experience to help on your problem, but without any detail about what your problem doing during that 56 seconds, it is hard to target the your question, I think. cheers YiQi On Fri, 26 May 2006, Doug Thistlethwaite wrote: > Hello, > > I hope there are people still reading this mailing list. The archive > appeared to not have anything new after 4/2005. > > I was using the commapi from sun for a project where a java application > reads data from test equipment connected to the serial port. I had to > upgrade the ftdi vcp driver on my pc and the old sun commapi no longer > works with hardware flow control. as an experiment I replaced the > javax.com with gnu.io in the SerialDemo.java project that was included > with the commapi. This compiled fine using JBuilder 2006 and JRE > 1.5.0_05. RXTX also works with the latest ftdi drivers so life is > wonderful again... almost... > > When using the commapi jar the SerialDemo program starts in about 1 > second on my system. Using the RXTX jar it takes over 56 seconds to > start. Has anyone else seen this problem? Is there a workaround to get > the startup performance close to the old commapi? > > The last thing printed to the console before this delay is: > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > Thanks for your time! > > Doug > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > ------------------------------- Just a student, Still a student ------------------------------- From yhua537 at cse.unsw.edu.au Sat May 27 06:04:26 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Sat, 27 May 2006 22:04:26 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: Sorry, I don't think you could understand what I mean .I mean this: Without any detail about what your program is doing during that 56 seconds, it is hard for anyone to target the problem. On Sat, 27 May 2006, YiQi Huang wrote: > hi Doug > > The archive hasn't been update for a long time, But people certainly still > reading the list. > > I don't have enough experience to help on your problem, but without any > detail about what your problem doing during that 56 seconds, it is hard to > target the your question, I think. > > cheers > YiQi > > On Fri, 26 May 2006, Doug Thistlethwaite wrote: > >> Hello, >> >> I hope there are people still reading this mailing list. The archive >> appeared to not have anything new after 4/2005. >> >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From jredman at ergotech.com Sat May 27 08:32:02 2006 From: jredman at ergotech.com (Jim Redman) Date: Sat, 27 May 2006 08:32:02 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> Message-ID: <447862E2.4080506@ergotech.com> Doug, Since you mentioned it, we have a system that is also seems slow. From memory (I don't have one of the slow systems around), I'm not sure that it's consistent, it seems that sometimes it may take longer than others. Since it's part of the bootup it hasn't raised a flag and I haven't researched it. The same code runs much faster on other systems, so now you've got me wondering what's different. The slow system boots DSL (http://www.damnsmalllinux.org/) from a compact flash. FC4 is on my desktop where I haven't noticed a slow down. I think that the rxtx code is the same in both cases with lock files disabled. The slow system has a bunch of serial ports defined, including 4 USB serial ports that do not exist - they are not plugged in. Any clues in there? Jim > On Fri, 26 May 2006, Doug Thistlethwaite wrote: >> I was using the commapi from sun for a project where a java application >> reads data from test equipment connected to the serial port. I had to >> upgrade the ftdi vcp driver on my pc and the old sun commapi no longer >> works with hardware flow control. as an experiment I replaced the >> javax.com with gnu.io in the SerialDemo.java project that was included >> with the commapi. This compiled fine using JBuilder 2006 and JRE >> 1.5.0_05. RXTX also works with the latest ftdi drivers so life is >> wonderful again... almost... >> >> When using the commapi jar the SerialDemo program starts in about 1 >> second on my system. Using the RXTX jar it takes over 56 seconds to >> start. Has anyone else seen this problem? Is there a workaround to get >> the startup performance close to the old commapi? >> >> The last thing printed to the console before this delay is: >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> >> Thanks for your time! >> >> Doug >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > ------------------------------- > Just a student, Still a student > ------------------------------- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From tjarvi at qbang.org Sat May 27 10:41:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 May 2006 10:41:54 -0600 (MDT) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447862E2.4080506@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: On Sat, 27 May 2006, Jim Redman wrote: > Doug, > > Since you mentioned it, we have a system that is also seems slow. From > memory (I don't have one of the slow systems around), I'm not sure that > it's consistent, it seems that sometimes it may take longer than others. > Since it's part of the bootup it hasn't raised a flag and I haven't > researched it. > > The same code runs much faster on other systems, so now you've got me > wondering what's different. > > The slow system boots DSL (http://www.damnsmalllinux.org/) from a > compact flash. FC4 is on my desktop where I haven't noticed a slow > down. I think that the rxtx code is the same in both cases with lock > files disabled. > > The slow system has a bunch of serial ports defined, including 4 USB > serial ports that do not exist - they are not plugged in. > > Any clues in there? > rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. When it does this, it will try to open each port and do a timed out read. most systems will not have entries in device if the port is not there. But some minimal systems will just put all the device files there in case hardware is added. The list of devices scanned used to be ~10-20 times longer than it is today. That was getting very slow. I suspect moving the device files not used to a backup directory would increase the enumeration. I'll look into why the mail-list archive is not updating. The last update was about when I thought I 'fixed' the cron jobs. I probably didn't actually fix it but rather moved the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon May 29 19:46:47 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 29 May 2006 19:46:47 -0600 (MDT) Subject: [Rxtx] Mail-List Archives are updating. Message-ID: It was pointed out earlier that the archive is dated. This was a missing crontab entry. The list is currently archived by the week on the web page. It is updated once a day. So every 7 days it starts a new link and updates it daily. I've been limited in what I could do while my cable modem was disconnected this last week. rxtx.org is something I do on my own time. The patches and credits will be comming next. Many of these can be seen in bugzilla right now. -- Trent Jarvi tjarvi at qbang.org From doug at dupreeinc.com Tue May 30 11:18:41 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 10:18:41 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> Message-ID: <447C7E71.4080204@dupreeinc.com> Trent, YiQi, and Jim: Thanks to all for the replies and information! I am just back from a long weekend and I am now trying to figure out what I was doing! :) As for more information. First off, this example is being run under windows XP. I am developing test equipment that communicates with a java application via a serial port. I have been using the commapi for several years and have not had a problem. Recently, I have started a design modification that will replace the RS232 connection with a USB port. I am using the ftdi module for prototyping and I discovered that their virtual com port driver was not compatible with the commapi that Sun released. It turns out that it has problems with hardware flow control ( it works on incoming but not outgoing communications). The way I figured this out was by experimenting with the SerialDemo that was included with the Sum commapi. One nice thing about this example is it has the ability to set incoming and outgoing flow control independently. After I installed RXTX into my JBuilder 2006 IDE, I just replaced all all instances of javax.comm with gnu.io and it compiled and runs without a hitch (except for the slow startup). I Paused the JBuilder IDE during this long pause and the last few entries in the stack trace are: testRead() : -1, gnu.io.RXTXCommDriver registerValidPorts() : 255, gnu.io.RXTXCommDriver registerScannedPorts() : 777, gnu.io.RXTXCommDriver This was all initiated by the following call in the programs init routine: Enumeration en = CommPortIdentifier.getPortIdentifiers(); After looking at this, My guess is that Trent is correct in that the delay is in scanning for ports. I guess one solution would be to not scan for ports, though it would be nice to detect what is available on the system. Is there any way to reduce the number of ports scanned by this function in windows XP? Thanks again for your time, Doug Trent Jarvi wrote: >On Sat, 27 May 2006, Jim Redman wrote: > > > >>Doug, >> >>Since you mentioned it, we have a system that is also seems slow. From >>memory (I don't have one of the slow systems around), I'm not sure that >>it's consistent, it seems that sometimes it may take longer than others. >>Since it's part of the bootup it hasn't raised a flag and I haven't >>researched it. >> >>The same code runs much faster on other systems, so now you've got me >>wondering what's different. >> >>The slow system boots DSL (http://www.damnsmalllinux.org/) from a >>compact flash. FC4 is on my desktop where I haven't noticed a slow >>down. I think that the rxtx code is the same in both cases with lock >>files disabled. >> >>The slow system has a bunch of serial ports defined, including 4 USB >>serial ports that do not exist - they are not plugged in. >> >>Any clues in there? >> >> >> > >rxtx will try to enumerate /dev/ttyS[0-255], /dev/USBttyS[0-255], .. > >When it does this, it will try to open each port and do a timed out read. >most systems will not have entries in device if the port is not there. >But some minimal systems will just put all the device files there in case >hardware is added. > >The list of devices scanned used to be ~10-20 times longer than it is >today. That was getting very slow. > >I suspect moving the device files not used to a backup directory would >increase the enumeration. > >I'll look into why the mail-list archive is not updating. The last update >was about when I thought I 'fixed' the cron jobs. I probably didn't >actually fix it but rather moved the problem. > >-- >Trent Jarvi >tjarvi at qbang.org > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/86796453/attachment-0004.html From doug at dupreeinc.com Tue May 30 14:36:09 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 30 May 2006 13:36:09 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447C7E71.4080204@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com> Message-ID: <447CACB9.1000801@dupreeinc.com> Hello all, I also notice this pause (not as long however) when I call: CommPortIdentifier.getPortIdentifier(PortName); I would think that if I supply the name of the port, it would not have to go through the same discovery process. If you have any ideas of how to get rid of this startup delay, I would really appreciate it. Thanks, Doug Doug Thistlethwaite wrote: > Trent, YiQi, and Jim: > > Thanks to all for the replies and information! I am just back from a > long weekend and I am now trying to figure out what I was doing! :) > > As for more information. First off, this example is being run under > windows XP. I am developing test equipment that communicates with a > java application via a serial port. I have been using the commapi for > several years and have not had a problem. Recently, I have started a > design modification that will replace the RS232 connection with a USB > port. I am using the ftdi module for prototyping and I discovered > that their virtual com port driver was not compatible with the commapi > that Sun released. It turns out that it has problems with hardware > flow control ( it works on incoming but not outgoing communications). > The way I figured this out was by experimenting with the SerialDemo > that was included with the Sum commapi. One nice thing about this > example is it has the ability to set incoming and outgoing flow > control independently. > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup). > > I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are: > > testRead() : -1, gnu.io.RXTXCommDriver > registerValidPorts() : 255, gnu.io.RXTXCommDriver > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > This was all initiated by the following call in the programs init routine: > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > After looking at this, My guess is that Trent is correct in that the > delay is in scanning for ports. I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system. Is there any way to reduce the number of ports scanned by > this function in windows XP? > > Thanks again for your time, > > Doug > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060530/edaa5c3c/attachment-0004.html From lynn at swcp.com Tue May 30 15:07:18 2006 From: lynn at swcp.com (lynn@swcp.com) Date: Tue, 30 May 2006 21:07:18 -0000 Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CACB9.1000801@dupreeinc.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: *IF* the name of the port is supplied, we might want to use the preferences mechanism (java.util.prefs) where we could have previously saved the info for the port. We could do a quick check to see that things have not changed before using it. If things have changed (or never been defined) we would do a full port scan and save detected ports in the preferences. This way if the hardware is not changed, you only pay the time penalty one time. just an idea... Lynn Doug Thistlethwaite said: > This is a multi-part message in MIME format. > --------------070808020900080005070500 > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > Content-Transfer-Encoding: 7bit > > Hello all, > > I also notice this pause (not as long however) when I call: > > CommPortIdentifier.getPortIdentifier(PortName); > > I would think that if I supply the name of the port, it would not have > to go through the same discovery process. If you have any ideas of how > to get rid of this startup delay, I would really appreciate it. > > Thanks, > > Doug > > Doug Thistlethwaite wrote: > > > Trent, YiQi, and Jim: > > > > Thanks to all for the replies and information! I am just back from a > > long weekend and I am now trying to figure out what I was doing! :) > > > > As for more information. First off, this example is being run under > > windows XP. I am developing test equipment that communicates with a > > java application via a serial port. I have been using the commapi for > > several years and have not had a problem. Recently, I have started a > > design modification that will replace the RS232 connection with a USB > > port. I am using the ftdi module for prototyping and I discovered > > that their virtual com port driver was not compatible with the commapi > > that Sun released. It turns out that it has problems with hardware > > flow control ( it works on incoming but not outgoing communications). > > The way I figured this out was by experimenting with the SerialDemo > > that was included with the Sum commapi. One nice thing about this > > example is it has the ability to set incoming and outgoing flow > > control independently. > > > > After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > > all instances of javax.comm with gnu.io and it compiled and runs > > without a hitch (except for the slow startup). > > > > I Paused the JBuilder IDE during this long pause and the last few > > entries in the stack trace are: > > > > testRead() : -1, gnu.io.RXTXCommDriver > > registerValidPorts() : 255, gnu.io.RXTXCommDriver > > registerScannedPorts() : 777, gnu.io.RXTXCommDriver > > > > This was all initiated by the following call in the programs init routine: > > > > Enumeration en = CommPortIdentifier.getPortIdentifiers(); > > > > After looking at this, My guess is that Trent is correct in that the > > delay is in scanning for ports. I guess one solution would be to not > > scan for ports, though it would be nice to detect what is available on > > the system. Is there any way to reduce the number of ports scanned by > > this function in windows XP? > > > > Thanks again for your time, > > > > Doug > > > > --------------070808020900080005070500 > Content-Type: text/html; charset=ISO-8859-1 > Content-Transfer-Encoding: 7bit > > > > > > > > > Hello all,
>
> I also notice this pause (not as long however) when I call:
>
>          CommPortIdentifier.getPortIdentifier(PortName);
>
> I would think that if I supply the name of the port, it would not have > to go through the same discovery process.  If you have any ideas of how > to get rid of this startup delay, I would really appreciate it.
>
> Thanks,
>
> Doug
>
> Doug Thistlethwaite wrote: >
> > Trent, YiQi, and Jim:
>
> Thanks to all for the replies and information!  I am just back from a > long weekend and I am now trying to figure out what I was doing! :)
>
> As for more information.  First off, this example is being run under > windows XP.  I am developing test equipment that communicates with a > java application via a serial port.  I have been using the commapi for > several years and have not had a problem.  Recently, I have started a > design modification that will replace the RS232 connection with a USB > port.  I am using the ftdi module for prototyping and I discovered that > their virtual com port driver was not compatible with the commapi that > Sun released.  It turns out that it has problems with hardware flow > control ( it works on incoming but not outgoing communications).  The > way I figured this out was by experimenting with the SerialDemo that > was included with the Sum commapi.  One nice thing about this example > is it has the ability to set incoming and outgoing flow control > independently.
>
> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all > all instances of javax.comm with gnu.io and it compiled and runs > without a hitch (except for the slow startup).
>
> I Paused the JBuilder IDE during this long pause and the last few > entries in the stack trace are:
>
> testRead() : -1, gnu.io.RXTXCommDriver
> registerValidPorts() : 255, gnu.io.RXTXCommDriver
> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>
> This was all initiated by the following call in the programs init > routine:
>
> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>
> After looking at this,  My guess is that Trent is correct in that the > delay is in scanning for ports.  I guess one solution would be to not > scan for ports, though it would be nice to detect what is available on > the system.  Is there any way to reduce the number of ports scanned by > this function in windows XP? 
>
> Thanks again for your time,
>
> Doug
>
>
> > > > --------------070808020900080005070500-- > -- From jredman at ergotech.com Tue May 30 15:42:35 2006 From: jredman at ergotech.com (Jim Redman) Date: Tue, 30 May 2006 15:42:35 -0600 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> Message-ID: <447CBC4B.2080206@ergotech.com> Lynn, If I understand your idea correctly, I don't think that this would work well for, say, USB ports since these can be easily added/removed by the end user. Jim lynn at swcp.com wrote: > *IF* the name of the port is supplied, we might want to use the preferences > mechanism (java.util.prefs) where we could have previously saved the info for > the port. We could do a quick check to see that things have not changed > before using it. If things have changed (or never been defined) we would do a > full port scan and save detected ports in the preferences. > > This way if the hardware is not changed, you only pay the time penalty one time. > > just an idea... > Lynn > > > Doug Thistlethwaite said: > >> This is a multi-part message in MIME format. >> --------------070808020900080005070500 >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >> Content-Transfer-Encoding: 7bit >> >> Hello all, >> >> I also notice this pause (not as long however) when I call: >> >> CommPortIdentifier.getPortIdentifier(PortName); >> >> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process. If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it. >> >> Thanks, >> >> Doug >> >> Doug Thistlethwaite wrote: >> >>> Trent, YiQi, and Jim: >>> >>> Thanks to all for the replies and information! I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :) >>> >>> As for more information. First off, this example is being run under >>> windows XP. I am developing test equipment that communicates with a >>> java application via a serial port. I have been using the commapi for >>> several years and have not had a problem. Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port. I am using the ftdi module for prototyping and I discovered >>> that their virtual com port driver was not compatible with the commapi >>> that Sun released. It turns out that it has problems with hardware >>> flow control ( it works on incoming but not outgoing communications). >>> The way I figured this out was by experimenting with the SerialDemo >>> that was included with the Sum commapi. One nice thing about this >>> example is it has the ability to set incoming and outgoing flow >>> control independently. >>> >>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup). >>> >>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are: >>> >>> testRead() : -1, gnu.io.RXTXCommDriver >>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>> >>> This was all initiated by the following call in the programs init routine: >>> >>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>> >>> After looking at this, My guess is that Trent is correct in that the >>> delay is in scanning for ports. I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system. Is there any way to reduce the number of ports scanned by >>> this function in windows XP? >>> >>> Thanks again for your time, >>> >>> Doug >>> >> --------------070808020900080005070500 >> Content-Type: text/html; charset=ISO-8859-1 >> Content-Transfer-Encoding: 7bit >> >> >> >> >> >> >> >> >> Hello all,
>>
>> I also notice this pause (not as long however) when I call:
>>
>>         >  CommPortIdentifier.getPortIdentifier(PortName);
>>
>> I would think that if I supply the name of the port, it would not have >> to go through the same discovery process.  If you have any ideas of how >> to get rid of this startup delay, I would really appreciate it.
>>
>> Thanks,
>>
>> Doug
>>
>> Doug Thistlethwaite wrote: >>
>> >> Trent, YiQi, and Jim:
>>
>> Thanks to all for the replies and information!  I am just back from a >> long weekend and I am now trying to figure out what I was doing! :)
>>
>> As for more information.  First off, this example is being run under >> windows XP.  I am developing test equipment that communicates with a >> java application via a serial port.  I have been using the commapi for >> several years and have not had a problem.  Recently, I have started a >> design modification that will replace the RS232 connection with a USB >> port.  I am using the ftdi module for prototyping and I discovered that >> their virtual com port driver was not compatible with the commapi that >> Sun released.  It turns out that it has problems with hardware flow >> control ( it works on incoming but not outgoing communications).  The >> way I figured this out was by experimenting with the SerialDemo that >> was included with the Sum commapi.  One nice thing about this example >> is it has the ability to set incoming and outgoing flow control >> independently.
>>
>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >> all instances of javax.comm with gnu.io and it compiled and runs >> without a hitch (except for the slow startup).
>>
>> I Paused the JBuilder IDE during this long pause and the last few >> entries in the stack trace are:
>>
>> testRead() : -1, gnu.io.RXTXCommDriver
>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>
>> This was all initiated by the following call in the programs init >> routine:
>>
>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>
>> After looking at this,  My guess is that Trent is correct in that the >> delay is in scanning for ports.  I guess one solution would be to not >> scan for ports, though it would be nice to detect what is available on >> the system.  Is there any way to reduce the number of ports scanned by >> this function in windows XP? 
>>
>> Thanks again for your time,
>>
>> Doug
>>
>>
>> >> >> >> --------------070808020900080005070500-- >> > > > -- Jim Redman (505) 662 5156 x85 http://www.ergotech.com From yhua537 at cse.unsw.edu.au Tue May 30 18:10:23 2006 From: yhua537 at cse.unsw.edu.au (YiQi Huang) Date: Wed, 31 May 2006 10:10:23 +1000 (EST) Subject: [Rxtx] rxtx slow startup In-Reply-To: <447CBC4B.2080206@ergotech.com> References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: Doug, In the SerialDemo, it allow us to save the parameters into a file, and use it when your program start up. Would this help? YiQi On Tue, 30 May 2006, Jim Redman wrote: > Lynn, > > If I understand your idea correctly, I don't think that this would work > well for, say, USB ports since these can be easily added/removed by the > end user. > > Jim > > lynn at swcp.com wrote: >> *IF* the name of the port is supplied, we might want to use the preferences >> mechanism (java.util.prefs) where we could have previously saved the info for >> the port. We could do a quick check to see that things have not changed >> before using it. If things have changed (or never been defined) we would do a >> full port scan and save detected ports in the preferences. >> >> This way if the hardware is not changed, you only pay the time penalty one time. >> >> just an idea... >> Lynn >> >> >> Doug Thistlethwaite said: >> >>> This is a multi-part message in MIME format. >>> --------------070808020900080005070500 >>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>> Content-Transfer-Encoding: 7bit >>> >>> Hello all, >>> >>> I also notice this pause (not as long however) when I call: >>> >>> CommPortIdentifier.getPortIdentifier(PortName); >>> >>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process. If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it. >>> >>> Thanks, >>> >>> Doug >>> >>> Doug Thistlethwaite wrote: >>> >>>> Trent, YiQi, and Jim: >>>> >>>> Thanks to all for the replies and information! I am just back from a >>>> long weekend and I am now trying to figure out what I was doing! :) >>>> >>>> As for more information. First off, this example is being run under >>>> windows XP. I am developing test equipment that communicates with a >>>> java application via a serial port. I have been using the commapi for >>>> several years and have not had a problem. Recently, I have started a >>>> design modification that will replace the RS232 connection with a USB >>>> port. I am using the ftdi module for prototyping and I discovered >>>> that their virtual com port driver was not compatible with the commapi >>>> that Sun released. It turns out that it has problems with hardware >>>> flow control ( it works on incoming but not outgoing communications). >>>> The way I figured this out was by experimenting with the SerialDemo >>>> that was included with the Sum commapi. One nice thing about this >>>> example is it has the ability to set incoming and outgoing flow >>>> control independently. >>>> >>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>> all instances of javax.comm with gnu.io and it compiled and runs >>>> without a hitch (except for the slow startup). >>>> >>>> I Paused the JBuilder IDE during this long pause and the last few >>>> entries in the stack trace are: >>>> >>>> testRead() : -1, gnu.io.RXTXCommDriver >>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>> >>>> This was all initiated by the following call in the programs init routine: >>>> >>>> Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>> >>>> After looking at this, My guess is that Trent is correct in that the >>>> delay is in scanning for ports. I guess one solution would be to not >>>> scan for ports, though it would be nice to detect what is available on >>>> the system. Is there any way to reduce the number of ports scanned by >>>> this function in windows XP? >>>> >>>> Thanks again for your time, >>>> >>>> Doug >>>> >>> --------------070808020900080005070500 >>> Content-Type: text/html; charset=ISO-8859-1 >>> Content-Transfer-Encoding: 7bit >>> >>> >>> >>> >>> >>> >>> >>> >>> Hello all,
>>>
>>> I also notice this pause (not as long however) when I call:
>>>
>>>         >>  CommPortIdentifier.getPortIdentifier(PortName);
>>>
>>> I would think that if I supply the name of the port, it would not have >>> to go through the same discovery process.  If you have any ideas of how >>> to get rid of this startup delay, I would really appreciate it.
>>>
>>> Thanks,
>>>
>>> Doug
>>>
>>> Doug Thistlethwaite wrote: >>>
>>> >>> Trent, YiQi, and Jim:
>>>
>>> Thanks to all for the replies and information!  I am just back from a >>> long weekend and I am now trying to figure out what I was doing! :)
>>>
>>> As for more information.  First off, this example is being run under >>> windows XP.  I am developing test equipment that communicates with a >>> java application via a serial port.  I have been using the commapi for >>> several years and have not had a problem.  Recently, I have started a >>> design modification that will replace the RS232 connection with a USB >>> port.  I am using the ftdi module for prototyping and I discovered that >>> their virtual com port driver was not compatible with the commapi that >>> Sun released.  It turns out that it has problems with hardware flow >>> control ( it works on incoming but not outgoing communications).  The >>> way I figured this out was by experimenting with the SerialDemo that >>> was included with the Sum commapi.  One nice thing about this example >>> is it has the ability to set incoming and outgoing flow control >>> independently.
>>>
>>> After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>> all instances of javax.comm with gnu.io and it compiled and runs >>> without a hitch (except for the slow startup).
>>>
>>> I Paused the JBuilder IDE during this long pause and the last few >>> entries in the stack trace are:
>>>
>>> testRead() : -1, gnu.io.RXTXCommDriver
>>> registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>> registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>
>>> This was all initiated by the following call in the programs init >>> routine:
>>>
>>> Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>
>>> After looking at this,  My guess is that Trent is correct in that the >>> delay is in scanning for ports.  I guess one solution would be to not >>> scan for ports, though it would be nice to detect what is available on >>> the system.  Is there any way to reduce the number of ports scanned by >>> this function in windows XP? 
>>>
>>> Thanks again for your time,
>>>
>>> Doug
>>>
>>>
>>> >>> >>> >>> --------------070808020900080005070500-- >>> >> >> >> > > -- > Jim Redman > (505) 662 5156 x85 > http://www.ergotech.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > cheers YiQi Huang From halbleib at rechnerbetriebsgruppe.de Wed May 31 02:06:16 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 10:06:16 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp Message-ID: <447D4E78.30302@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, I getting an error while reloading my app in tomcat. At the first start everything runs well, but if i reload mit webapp by tomcat manager i get the following error. java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader thrown while loading gnu.io.RXTXCommDriver Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in another classloader Is there a possibility to unload the native library rxtxSerial.dll? thx for all help! regards tom -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 b8FT80HQ1xlbDLnRecDANCc= =heb1 -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 02:52:17 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 10:52:17 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D4E78.30302@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> Message-ID: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Hello Tom, To the best of my knowledge it is impossible to unload native libraries once loaded into the JVM. The exception you see stems from the fact, that Tomcat creates a new classloader when you "reload" the weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar is loaded from the session class loader. Try to add RXTXComm.jar to your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. Regards, Joachim On 31.05.2006, at 10:06, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfU54dqa7IgZG0wQRAucyAJ46D5LzmBL7SLzWIa2kvlpXIsBUNQCdHH92 > b8FT80HQ1xlbDLnRecDANCc= > =heb1 > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From halbleib at rechnerbetriebsgruppe.de Wed May 31 03:28:35 2006 From: halbleib at rechnerbetriebsgruppe.de (Tom Halbleib) Date: Wed, 31 May 2006 11:28:35 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> Message-ID: <447D61C3.1030807@rechnerbetriebsgruppe.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Joachim, I'm still not getting it. How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml-file? Perhaps web.xml? Regards, Tom Joachim Buechse schrieb: > Hello Tom, > > To the best of my knowledge it is impossible to unload native > libraries once loaded into the JVM. The exception you see stems from > the fact, that Tomcat creates a new classloader when you "reload" the > weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar > is loaded from the session class loader. Try to add RXTXComm.jar to > your bootlclasspath (-Xbootclasspath/a:) and the problem should go away. > > Regards, > Joachim > > On 31.05.2006, at 10:06, Tom Halbleib wrote: > > Hi all, > > I getting an error while reloading my app in tomcat. At the first > start > everything runs well, but if i reload mit webapp by tomcat manager > i get > the following error. > > java.lang.UnsatisfiedLinkError: Native Library > C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in > another classloader thrown while loading gnu.io.RXTXCommDriver > Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: Native > Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already > loaded > in another classloader > > > Is there a possibility to unload the native library rxtxSerial.dll? > > thx for all help! > > regards > > tom _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL tzNy+/0iIUfkYYgt1+UT1ko= =pkpY -----END PGP SIGNATURE----- From joachim at buechse.de Wed May 31 04:03:42 2006 From: joachim at buechse.de (Joachim Buechse) Date: Wed, 31 May 2006 12:03:42 +0200 Subject: [Rxtx] Trouble reloading RXTX in WebApp In-Reply-To: <447D61C3.1030807@rechnerbetriebsgruppe.de> References: <447D4E78.30302@rechnerbetriebsgruppe.de> <4F5B543D-391B-4C9B-AB2F-BF7C5BAA8339@buechse.de> <447D61C3.1030807@rechnerbetriebsgruppe.de> Message-ID: -Xbootclasspath/a: is a start option to the java vm. Google is your friend in finding how to modfiy it and what it means: tomcat modifying bootclasspath Regards, Joachim On 31.05.2006, at 11:28, Tom Halbleib wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Joachim, > > I'm still not getting it. > How can I add RXTXcomm.jar to the "bootclasspath"? Is there a xml- > file? > Perhaps web.xml? > > Regards, > Tom > > Joachim Buechse schrieb: >> Hello Tom, >> >> To the best of my knowledge it is impossible to unload native >> libraries once loaded into the JVM. The exception you see stems from >> the fact, that Tomcat creates a new classloader when you "reload" the >> weblet. Apparently you have set Tomcat up in a way that RXTXcomm.jar >> is loaded from the session class loader. Try to add RXTXComm.jar to >> your bootlclasspath (-Xbootclasspath/a:) and the problem should go >> away. >> >> Regards, >> Joachim >> >> On 31.05.2006, at 10:06, Tom Halbleib wrote: >> >> Hi all, >> >> I getting an error while reloading my app in tomcat. At the first >> start >> everything runs well, but if i reload mit webapp by tomcat manager >> i get >> the following error. >> >> java.lang.UnsatisfiedLinkError: Native Library >> C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already loaded in >> another classloader thrown while loading gnu.io.RXTXCommDriver >> Exception in thread "DB Loader" java.lang.UnsatisfiedLinkError: >> Native >> Library C:\Programme\Java\jre1.5.0_06\bin\rxtxSerial.dll already >> loaded >> in another classloader >> >> >> Is there a possibility to unload the native library rxtxSerial.dll? >> >> thx for all help! >> >> regards >> >> tom > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFEfWHDdqa7IgZG0wQRAumzAKDNEwQIERV1WEh5AiMqlbwYDcCUoACeNdTL > tzNy+/0iIUfkYYgt1+UT1ko= > =pkpY > -----END PGP SIGNATURE----- > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From impakt01 at optusnet.com.au Wed May 31 06:55:42 2006 From: impakt01 at optusnet.com.au (Daren) Date: Wed, 31 May 2006 22:55:42 +1000 Subject: [Rxtx] (no subject) Message-ID: <200605311255.k4VCtguL001684@mail04.syd.optusnet.com.au> Hi All, I have been using rxtx for a little while and needed to get it working at 1953, like a past user in the mailing list, who seemed to have got it working by changing some C code. I wanted to build rxtx myself with these changes but don't know where to start. I have windows here and FC4 at home. I downloaded cygwin and mingw32, each build works by building a rxtxSerial.dll file that is ~11k smaller than the original, and I always get the following error when testing the dll: Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8077655 Function=[Unknown.] Library=C:\opt\java\j2sdk1.4.2\jre\bin\client\jvm.dll NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at gnu.io.RXTXPort.open(Native Method) - locked <0x1002c800> (a gnu.io.RXTXPort) at gnu.io.RXTXPort.(RXTXPort.java:84) Anyone know what im doing wrong? Daren -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060531/ade7ad37/attachment-0004.html From doug at dupreeinc.com Wed May 31 10:19:19 2006 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 31 May 2006 09:19:19 -0700 Subject: [Rxtx] rxtx slow startup In-Reply-To: References: <4477770E.9010400@dupreeinc.com> <447862E2.4080506@ergotech.com> <447C7E71.4080204@dupreeinc.com>, <447C7E71.4080204@dupreeinc.com> <447CBC4B.2080206@ergotech.com> Message-ID: <447DC207.3070702@dupreeinc.com> I am not sure what you are saying. The Save parameters menu option saves the current settings (baud, data bits, etc.). The long pause (~60 seconds) is when the application first starts (before loading the saved parameters). This does bring up a question, though I hate this type of kludge approach to getting this library to work... What exactly is a PortIdentifier? Is it always the same? If I stored the results from "CommPortIdentifier.getPortIdentifier(PortName);" in a file, could I use this the next time the program is executed? In this case I am using a virtual com port driver to connect to the device through a USB port. Doug YiQi Huang wrote: >Doug, > >In the SerialDemo, it allow us to save the parameters into a file, and use >it when your program start up. Would this help? > >YiQi > >On Tue, 30 May 2006, Jim Redman wrote: > > > >>Lynn, >> >>If I understand your idea correctly, I don't think that this would work >>well for, say, USB ports since these can be easily added/removed by the >>end user. >> >>Jim >> >>lynn at swcp.com wrote: >> >> >>>*IF* the name of the port is supplied, we might want to use the preferences >>>mechanism (java.util.prefs) where we could have previously saved the info for >>>the port. We could do a quick check to see that things have not changed >>>before using it. If things have changed (or never been defined) we would do a >>>full port scan and save detected ports in the preferences. >>> >>>This way if the hardware is not changed, you only pay the time penalty one time. >>> >>>just an idea... >>>Lynn >>> >>> >>>Doug Thistlethwaite said: >>> >>> >>> >>>>This is a multi-part message in MIME format. >>>>--------------070808020900080005070500 >>>>Content-Type: text/plain; charset=ISO-8859-1; format=flowed >>>>Content-Transfer-Encoding: 7bit >>>> >>>>Hello all, >>>> >>>>I also notice this pause (not as long however) when I call: >>>> >>>> CommPortIdentifier.getPortIdentifier(PortName); >>>> >>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process. If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it. >>>> >>>>Thanks, >>>> >>>>Doug >>>> >>>>Doug Thistlethwaite wrote: >>>> >>>> >>>> >>>>>Trent, YiQi, and Jim: >>>>> >>>>>Thanks to all for the replies and information! I am just back from a >>>>>long weekend and I am now trying to figure out what I was doing! :) >>>>> >>>>>As for more information. First off, this example is being run under >>>>>windows XP. I am developing test equipment that communicates with a >>>>>java application via a serial port. I have been using the commapi for >>>>>several years and have not had a problem. Recently, I have started a >>>>>design modification that will replace the RS232 connection with a USB >>>>>port. I am using the ftdi module for prototyping and I discovered >>>>>that their virtual com port driver was not compatible with the commapi >>>>>that Sun released. It turns out that it has problems with hardware >>>>>flow control ( it works on incoming but not outgoing communications). >>>>>The way I figured this out was by experimenting with the SerialDemo >>>>>that was included with the Sum commapi. One nice thing about this >>>>>example is it has the ability to set incoming and outgoing flow >>>>>control independently. >>>>> >>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>>without a hitch (except for the slow startup). >>>>> >>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>>entries in the stack trace are: >>>>> >>>>>testRead() : -1, gnu.io.RXTXCommDriver >>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver >>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver >>>>> >>>>>This was all initiated by the following call in the programs init routine: >>>>> >>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers(); >>>>> >>>>>After looking at this, My guess is that Trent is correct in that the >>>>>delay is in scanning for ports. I guess one solution would be to not >>>>>scan for ports, though it would be nice to detect what is available on >>>>>the system. Is there any way to reduce the number of ports scanned by >>>>>this function in windows XP? >>>>> >>>>>Thanks again for your time, >>>>> >>>>>Doug >>>>> >>>>> >>>>> >>>>--------------070808020900080005070500 >>>>Content-Type: text/html; charset=ISO-8859-1 >>>>Content-Transfer-Encoding: 7bit >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>>Hello all,
>>>>
>>>>I also notice this pause (not as long however) when I call:
>>>>
>>>>        >>>> >>>> >>> CommPortIdentifier.getPortIdentifier(PortName);
>>> >>> >>>>
>>>>I would think that if I supply the name of the port, it would not have >>>>to go through the same discovery process.  If you have any ideas of how >>>>to get rid of this startup delay, I would really appreciate it.
>>>>
>>>>Thanks,
>>>>
>>>>Doug
>>>>
>>>>Doug Thistlethwaite wrote: >>>>
>>>> >>>>Trent, YiQi, and Jim:
>>>>
>>>>Thanks to all for the replies and information!  I am just back from a >>>>long weekend and I am now trying to figure out what I was doing! :)
>>>>
>>>>As for more information.  First off, this example is being run under >>>>windows XP.  I am developing test equipment that communicates with a >>>>java application via a serial port.  I have been using the commapi for >>>>several years and have not had a problem.  Recently, I have started a >>>>design modification that will replace the RS232 connection with a USB >>>>port.  I am using the ftdi module for prototyping and I discovered that >>>>their virtual com port driver was not compatible with the commapi that >>>>Sun released.  It turns out that it has problems with hardware flow >>>>control ( it works on incoming but not outgoing communications).  The >>>>way I figured this out was by experimenting with the SerialDemo that >>>>was included with the Sum commapi.  One nice thing about this example >>>>is it has the ability to set incoming and outgoing flow control >>>>independently.
>>>>
>>>>After I installed RXTX into my JBuilder 2006 IDE, I just replaced all >>>>all instances of javax.comm with gnu.io and it compiled and runs >>>>without a hitch (except for the slow startup).
>>>>
>>>>I Paused the JBuilder IDE during this long pause and the last few >>>>entries in the stack trace are:
>>>>
>>>>testRead() : -1, gnu.io.RXTXCommDriver
>>>>registerValidPorts() : 255, gnu.io.RXTXCommDriver
>>>>registerScannedPorts() : 777, gnu.io.RXTXCommDriver
>>>>
>>>>This was all initiated by the following call in the programs init >>>>routine:
>>>>
>>>>Enumeration en = CommPortIdentifier.getPortIdentifiers();
>>>>
>>>>After looking at this,  My guess is that Trent is correct in that the >>>>delay is in scanning for ports.  I guess one solution would be to not >>>>scan for ports, though it would be nice to detect what is available on >>>>the system.  Is there any way to reduce the number of ports scanned by >>>>this function in window